Subject: pkg/36753: textproc/intltool: broken intltool-merge on system with non-gnu iconv
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <yx@rtk0.lneuro.x.ua>
List: pkgsrc-bugs
Date: 08/08/2007 22:10:01
>Number:         36753
>Category:       pkg
>Synopsis:       textproc/intltool: broken intltool-merge on system with non-gnu iconv
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 08 22:10:00 +0000 2007
>Originator:     Yakovetsky Vladimir
>Release:        NetBSD 4.99.27
>Organization:
>Environment:
System: NetBSD lrou.x.ua 4.99.27 NetBSD 4.99.27 (lrou_odd-1.840) #0: Wed Aug 8 16:16:50 EEST 2007 yx@lrou.x.ua:/sys/arch/i386/compile/lrou_odd i386
Architecture: i386
Machine: i386
>Description:
intltool-0.36.0: broken intltool-merge on system with non-gnu iconv

>How-To-Repeat:
 for example, build scrollkeeper

% cd /usr/pkgsrc/textproc/scrollkeeper
% make
...
LC_ALL=C ../../intltool-merge ../../po scrollkeeper_cl.xml.in scrollkeeper_cl.xml -x -u -c ../../po/.intltool-merge-cache
iconv: unknown option -- -
Usage: iconv [-cs] -f <from> -t <to> [file ...]
	iconv -l
 *** GNU iconv is not found on this system!
 *** Without it, intltool-merge can not convert encodings.
../../buildtools/scrollkeeper-tree-separate scrollkeeper_cl.xml ../../cl/templates
I/O warning : failed to load external entity "scrollkeeper_cl.xml"
File does not contain well-formed XML
gmake[3]: *** [all] Error 1
gmake[3]: Leaving directory `/usr/obj/textproc/scrollkeeper/work/scrollkeeper-0.3.14/cl/templates'
gmake[2]: *** [all-recursive] Error 1
gmake[2]: Leaving directory `/usr/obj/textproc/scrollkeeper/work/scrollkeeper-0.3.14/cl'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/usr/obj/textproc/scrollkeeper/work/scrollkeeper-0.3.14'
gmake: *** [all] Error 2
*** Error code 2

Stop.
make: stopped in /usr/pkgsrc/textproc/scrollkeeper
*** Error code 1

Stop.
make: stopped in /usr/pkgsrc/textproc/scrollkeeper


>Fix:
:r /usr/pkgsrc/textproc/intltool/patches/patch-aa
--- intltool-merge.in.in.orig
+++ intltool-merge.in.in
@@ -100,24 +100,13 @@
 {
     my ($file) = @_;
     # If either a file exists, or when run it returns 0 exit status
-    return 1 if ((-x $file) or (system("$file --version >$devnull") == 0));
+    return 1 if ((-x $file) or (system("$file -l >$devnull") == 0));
     return 0;
 }
 
-sub isGNUGettextTool
+if (! isProgramInPath ("$iconv"))
 {
-    my ($file) = @_;
-    # Check that we are using GNU gettext tools
-    if (isProgramInPath ($file)) {
-        my $version = `$file --version`;
-        return 1 if ($version =~ m/.*\(GNU .*\).*/);
-    }
-    return 0;
-}
-
-if (! isGNUGettextTool ("$iconv"))
-{
-	print STDERR " *** GNU iconv is not found on this system!\n".
+	print STDERR " *** iconv is not found on this system!\n".
 		     " *** Without it, intltool-merge can not convert encodings.\n";
 	exit;
 }