ports/161417: [patch] Mk/bsd.port.mk: USE_ICONV, treat iconv() in libc
Nali Toja
nalitoja at gmail.com
Sun Oct 9 09:30:02 UTC 2011
>Number: 161417
>Category: ports
>Synopsis: [patch] Mk/bsd.port.mk: USE_ICONV, treat iconv() in libc
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Sun Oct 09 09:30:01 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Nali Toja
>Release: FreeBSD 10.0-CURRENT amd64
>Organization:
>Environment:
>Description:
Don't depend on converters/libiconv if base system is built WITH_ICONV.
And fix build with a few popular ports.
To reduce the number of false positives try
$ ln -s /usr/lib/libc.so /usr/lib/libiconv.so
$ ln -s /usr/lib/libc.a /usr/lib/libiconv.a
as some ports explicitly add -liconv to LDFLAGS.
>How-To-Repeat:
$ cd www/firefox; make install
$ ldd /usr/local/lib/firefox/libxul.so | fgrep iconv
>Fix:
--- base_iconv.diff begins here ---
Index: Mk/bsd.port.mk
===================================================================
RCS file: /a/.csup/ports/Mk/bsd.port.mk,v
retrieving revision 1.696
diff -u -p -r1.696 bsd.port.mk
--- Mk/bsd.port.mk 23 Sep 2011 22:20:46 -0000 1.696
+++ Mk/bsd.port.mk 8 Oct 2011 05:35:41 -0000
@@ -1835,7 +1842,7 @@ USE_LDCONFIG= ${PREFIX}/lib
IGNORE= has USE_LDCONFIG32 set to yes, which is not correct
.endif
-.if defined(USE_ICONV)
+.if !exists(/usr/include/iconv.h) && defined(USE_ICONV)
LIB_DEPENDS+= iconv.3:${PORTSDIR}/converters/libiconv
.endif
Index: Mk/bsd.gnome.mk
===================================================================
RCS file: /a/.csup/ports/Mk/bsd.gnome.mk,v
retrieving revision 1.173
diff -u -p -r1.173 bsd.gnome.mk
--- Mk/bsd.gnome.mk 12 Aug 2011 08:03:18 -0000 1.173
+++ Mk/bsd.gnome.mk 8 Oct 2011 05:29:47 -0000
@@ -479,7 +479,7 @@ intltool_BUILD_DEPENDS= ${intltool_DETEC
intlhack_PRE_PATCH= ${FIND} ${WRKSRC} -name "intltool-merge.in" | ${XARGS} ${REINPLACE_CMD} -e \
's|mkdir $$lang or|mkdir $$lang, 0777 or| ; \
s|^push @INC, "/.*|push @INC, "${LOCALBASE}/share/intltool";| ; \
- s|/usr/bin/iconv|${LOCALBASE}/bin/iconv|g ; \
+ s|/usr/bin/iconv|iconv|g ; \
s|unpack *[(]'"'"'U\*'"'"'|unpack ('"'"'C*'"'"'|'
intlhack_USE_GNOME_IMPL=intltool
Index: devel/gettext/files/patch-gettext-tools_src_write-po.c
===================================================================
RCS file: devel/gettext/files/patch-gettext-tools_src_write-po.c
diff -N devel/gettext/files/patch-gettext-tools_src_write-po.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ devel/gettext/files/patch-gettext-tools_src_write-po.c 8 Oct 2011 18:41:39 -0000
@@ -0,0 +1,11 @@
+--- gettext-tools/src/write-po.c~
++++ gettext-tools/src/write-po.c
+@@ -51,6 +51,8 @@
+ #include "po-xerror.h"
+ #include "gettext.h"
+
++#undef HAVE_ICONV
++
+ /* Our regular abbreviation. */
+ #define _(str) gettext (str)
+
Index: devel/glib20/Makefile
===================================================================
RCS file: /a/.csup/ports/devel/glib20/Makefile,v
retrieving revision 1.179
diff -u -p -r1.179 Makefile
--- devel/glib20/Makefile 25 Sep 2011 15:43:59 -0000 1.179
+++ devel/glib20/Makefile 8 Oct 2011 05:19:35 -0000
@@ -41,7 +41,7 @@ USE_GMAKE= yes
MAKE_JOBS_SAFE= yes
USE_PYTHON= yes
USE_PERL5= yes
-CONFIGURE_ARGS= --enable-static --with-libiconv=gnu \
+CONFIGURE_ARGS= --enable-static \
--disable-gtk-doc --with-html-dir=${PREFIX}/share/doc \
--disable-man --without-xml-catalog \
--disable-dtrace \
@@ -79,6 +79,8 @@ CONFIGURE_ARGS+= --enable-debug=yes
.endif
post-patch:
+ @${REINPLACE_CMD} '/ac_fn_c_check_func/s/iconv_open/lib&/' \
+ ${WRKSRC}/configure
@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g ; \
s|/usr/share/locale/locale|${LOCALBASE}/share/locale/locale|g' \
${WRKSRC}/glib/gutils.c
Index: devel/gio-fam-backend/Makefile
===================================================================
RCS file: /a/.csup/ports/devel/gio-fam-backend/Makefile,v
retrieving revision 1.22
diff -u -p -r1.22 Makefile
--- devel/gio-fam-backend/Makefile 23 Sep 2011 22:21:57 -0000 1.22
+++ devel/gio-fam-backend/Makefile 8 Oct 2011 05:51:35 -0000
@@ -31,10 +31,14 @@ USE_GNOME= gnomehack pkgconfig _glib20
USE_FAM= yes
USE_GMAKE= yes
MAKE_JOBS_SAFE= yes
-CONFIGURE_ARGS= --enable-static --with-libiconv=gnu
+CONFIGURE_ARGS= --enable-static
CONFIGURE_ENV= PTHREAD_CFLAGS="${PTHREAD_CFLAGS}" \
PTHREAD_LIBS="${PTHREAD_LIBS}"
CPPFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib -lintl
+post-patch:
+ @${REINPLACE_CMD} '/ac_fn_c_check_func/s/iconv_open/lib&/' \
+ ${WRKSRC}/configure
+
.include <bsd.port.mk>
--- base_iconv.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list