Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 05 Oct 2012 17:50:28 +0200
From:      Alex Dupre <ale@FreeBSD.org>
To:        Greg Larkin <glarkin@FreeBSD.org>, Joe Marcus Clarke <marcus@freebsd.org>, gnome@FreeBSD.org, autotools@FreeBSD.org
Subject:   charset.alias
Message-ID:  <506F01C4.6040704@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------090808030106000205030802
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit

Hi All,
the latest update to devel/patch spotted a (new, at least for me)
problem related to charset.alias file. After a little research I found
that gettext install both charset.alias and locale.alias and no other
ports should install them. So devel/patch should be fixed.
But in my research I found another issue: charset.alias should be
actually installed by converters/libiconv, and in fact it installs a
private copy in a different directory. And actually the one installed by
libiconv is quite correct, while the one installed by gettext is wrong
(it was correct for FreeBSD 4.x that misses nl_langinfo()).
In the end, a created a patch for the following affected ports:
converters/libiconv
devel/gettext
devel/patch
ports-mgmt/portlint

Please have a look at it and comment.

-- 
Alex Dupre

--------------090808030106000205030802
Content-Type: text/plain; charset=ISO-8859-15;
 name="charset.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="charset.patch"

Index: converters/libiconv/files/patch-ae
===================================================================
--- converters/libiconv/files/patch-ae	(revision 305297)
+++ converters/libiconv/files/patch-ae	(working copy)
@@ -1,15 +1,7 @@
 --- libcharset/lib/Makefile.in.orig	2009-03-26 08:01:00.000000000 -0400
 +++ libcharset/lib/Makefile.in	2009-06-06 15:28:00.000000000 -0400
-@@ -10,6 +10,7 @@ prefix = @prefix@
- local_prefix = /usr/local
- exec_prefix = @exec_prefix@
- libdir = @libdir@
-+sysconfdir = ${exec_prefix}/libdata
+@@ -44,7 +44,7 @@ SHELL = /bin/sh
  
- # Programs used by "make":
- CC = @CC@
-@@ -44,7 +45,7 @@ SHELL = /bin/sh
- 
  # Before making a release, change this according to the libtool documentation,
  # section "Library interface versions".
 -LIBCHARSET_VERSION_INFO = 1:0:0
@@ -17,47 +9,3 @@
  
  # Needed by $(LIBTOOL).
  top_builddir = ..
-@@ -59,7 +60,7 @@ libcharset.la : $(OBJECTS)
- 	$(LIBTOOL_LINK) $(CC) $(LDFLAGS) $(CFLAGS) -o libcharset.la -rpath $(libdir) -version-info $(LIBCHARSET_VERSION_INFO) -no-undefined $(OBJECTS)
- 
- localcharset.lo : $(srcdir)/localcharset.c
--	$(LIBTOOL_COMPILE) $(CC) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(DEFS) -c $(srcdir)/localcharset.c
-+	$(LIBTOOL_COMPILE) $(CC) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(DEFS) -DLIBDIR=\"$(sysconfdir)\" -c $(srcdir)/localcharset.c
- 
- relocatable.lo : $(srcdir)/relocatable.c $(srcdir)/relocatable.h
- 	$(LIBTOOL_COMPILE) $(CC) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(DEFS) -c $(srcdir)/relocatable.c
-@@ -80,7 +81,7 @@ ref-del.sed : $(srcdir)/ref-del.sin
- # $(libdir) and $(includedir) - don't use $(prefix) and $(exec_prefix) here.
- install-lib : all force
- 	$(mkinstalldirs) $(libdir)
--	$(LIBTOOL_INSTALL) $(INSTALL_DATA) libcharset.la $(libdir)/libcharset.la
-+	$(LIBTOOL_INSTALL) cp libcharset.la $(libdir)/libcharset.la
- 	test -f $(libdir)/charset.alias && orig=$(libdir)/charset.alias \
- 	                                || orig=charset.alias; \
- 	sed -f ref-add.sed $$orig > $(libdir)/t-charset.alias; \
-@@ -108,16 +109,17 @@ install : all force
- 	  need_charset_alias=false ; \
- 	fi ; \
- 	$(mkinstalldirs) $(DESTDIR)$(libdir) ; \
--	$(LIBTOOL_INSTALL) $(INSTALL_DATA) libcharset.la $(DESTDIR)$(libdir)/libcharset.la
--	if test -f $(DESTDIR)$(libdir)/charset.alias; then \
--	  sed -f ref-add.sed $(DESTDIR)$(libdir)/charset.alias > $(DESTDIR)$(libdir)/t-charset.alias; \
--	  $(INSTALL_DATA) $(DESTDIR)$(libdir)/t-charset.alias $(DESTDIR)$(libdir)/charset.alias; \
--	  rm -f $(DESTDIR)$(libdir)/t-charset.alias; \
-+	$(mkinstalldirs) $(DESTDIR)$(sysconfdir) ; \
-+	$(LIBTOOL_INSTALL) cp libcharset.la $(DESTDIR)$(libdir)/libcharset.la
-+	if test -f $(DESTDIR)$(sysconfdir)/charset.alias; then \
-+	  sed -f ref-add.sed $(DESTDIR)$(sysconfdir)/charset.alias > $(DESTDIR)$(sysconfdir)/t-charset.alias; \
-+	  $(INSTALL_DATA) $(DESTDIR)$(sysconfdir)/t-charset.alias $(DESTDIR)$(sysconfdir)/charset.alias; \
-+	  rm -f $(DESTDIR)$(sysconfdir)/t-charset.alias; \
- 	else \
- 	  if $$need_charset_alias; then \
--	    sed -f ref-add.sed charset.alias > $(DESTDIR)$(libdir)/t-charset.alias; \
--	    $(INSTALL_DATA) $(DESTDIR)$(libdir)/t-charset.alias $(DESTDIR)$(libdir)/charset.alias; \
--	    rm -f $(DESTDIR)$(libdir)/t-charset.alias; \
-+	    sed -f ref-add.sed charset.alias > $(DESTDIR)$(sysconfdir)/t-charset.alias; \
-+	    $(INSTALL_DATA) $(DESTDIR)$(sysconfdir)/t-charset.alias $(DESTDIR)$(sysconfdir)/charset.alias; \
-+	    rm -f $(DESTDIR)$(sysconfdir)/t-charset.alias; \
- 	  fi ; \
- 	fi
- 
Index: converters/libiconv/files/patch-libcharset::lib::config.charset
===================================================================
--- converters/libiconv/files/patch-libcharset::lib::config.charset	(revision 305297)
+++ converters/libiconv/files/patch-libcharset::lib::config.charset	(working copy)
@@ -35,8 +35,8 @@
 +	echo "eucJP EUC-JP"
 +	echo "eucKR EUC-KR"
 +	echo "Big5 BIG5"
++	echo "Big5HKSCS BIG5-HKSCS"
 +	echo "SJIS SHIFT_JIS"
-+	echo "Shift_JIS SHIFT_JIS"
 +        ;;
    netbsd*)
      echo "646 ASCII"
Index: converters/libiconv/pkg-plist
===================================================================
--- converters/libiconv/pkg-plist	(revision 305297)
+++ converters/libiconv/pkg-plist	(working copy)
@@ -2,6 +2,7 @@
 include/iconv.h
 include/libcharset.h
 include/localcharset.h
+lib/charset.alias
 lib/libcharset.a
 lib/libcharset.la
 lib/libcharset.so
@@ -10,7 +11,6 @@
 lib/libiconv.la
 lib/libiconv.so
 lib/libiconv.so.3
-libdata/charset.alias
 %%DOCSDIR%%/iconv.1.html
 %%DOCSDIR%%/iconv.3.html
 %%DOCSDIR%%/iconv_close.3.html
Index: converters/libiconv/Makefile
===================================================================
--- converters/libiconv/Makefile	(revision 305297)
+++ converters/libiconv/Makefile	(working copy)
@@ -7,6 +7,7 @@
 
 PORTNAME=	libiconv
 PORTVERSION=	1.14
+PORTREVISION=	1
 CATEGORIES=	converters devel
 MASTER_SITES=	GNU
 
Index: devel/gettext/pkg-plist
===================================================================
--- devel/gettext/pkg-plist	(revision 305297)
+++ devel/gettext/pkg-plist	(working copy)
@@ -25,7 +25,6 @@
 include/gettext-po.h
 include/libintl.h
 @exec /bin/mkdir -p %D/lib/gettext
-lib/charset.alias
 lib/libasprintf.a
 lib/libasprintf.la
 lib/libasprintf.so
Index: devel/gettext/Makefile
===================================================================
--- devel/gettext/Makefile	(revision 305297)
+++ devel/gettext/Makefile	(working copy)
@@ -7,6 +7,7 @@
 
 PORTNAME=	gettext
 PORTVERSION=	0.18.1.1
+PORTREVISION=	1
 CATEGORIES=	devel
 MASTER_SITES=	${MASTER_SITE_GNU}
 MASTER_SITE_SUBDIR=	gettext
@@ -65,6 +66,10 @@
 post-patch:
 	@${FIND} ${WRKSRC} -name configure -print | ${XARGS} \
 	    ${REINPLACE_CMD} -e 's|mkdir gmkdir|mkdir|'
+	@${FIND} ${WRKSRC} -name Makefile.in -print | ${XARGS} ${REINPLACE_CMD} \
+	    -e 's|need_charset_alias=true|need_charset_alias=false|' \
+	    -e 's|test -f $$(charset_alias)|false|' \
+	    -e 's|test -f $$(DESTDIR)$$(libdir)/charset.alias|false|'
 .if defined (NOPORTDOCS)
 .for dir in runtime tools
 	@${REINPLACE_CMD} -e 's|^SUBDIRS = doc|SUBDIRS =|' \
Index: devel/patch/Makefile
===================================================================
--- devel/patch/Makefile	(revision 305301)
+++ devel/patch/Makefile	(working copy)
@@ -7,6 +7,7 @@
 
 PORTNAME=	patch
 PORTVERSION=	2.7
+PORTREVISION=	1
 CATEGORIES=	devel
 MASTER_SITES=	${MASTER_SITE_GNU}
 MASTER_SITE_SUBDIR=	patch
@@ -20,9 +21,15 @@
 CONFIGURE_ARGS+=--program-prefix=g
 USE_GMAKE=	yes
 USE_XZ=		yes
+USE_ICONV=	yes
 
 MAN1=		gpatch.1
-PLIST_FILES=	bin/gpatch \
-		lib/charset.alias
+PLIST_FILES=	bin/gpatch
 
+post-patch:
+	@${REINPLACE_CMD} \
+	    -e 's|need_charset_alias=true|need_charset_alias=false|' \
+	    -e 's|test -f $$(charset_alias)|false|' \
+	    ${WRKSRC}/lib/Makefile.in
+
 .include <bsd.port.mk>
Index: ports-mgmt/portlint/src/portlint.pl
===================================================================
--- ports-mgmt/portlint/src/portlint.pl	(revision 305297)
+++ ports-mgmt/portlint/src/portlint.pl	(working copy)
@@ -836,8 +836,15 @@
 				"disallowed.");
 		}
 
-		if ($_ =~ /charset\.alias$/ || $_ =~ /locale\.alias$/) {
-			&perror("WARN", $file, $., "installing charset.alias or locale.alias, ".
+		if ($_ =~ /charset\.alias$/) {
+			&perror("WARN", $file, $., "installing charset.alias, ".
+				"please add USE_ICONV=yes and remove installation of ".
+				"charset.alias by setting need_charset_alias=false. ".
+				"See devel/gettext post-patch for an example.");
+		}
+
+		if ($_ =~ /locale\.alias$/) {
+			&perror("WARN", $file, $., "installing locale.alias, ".
 				"please add USE_GETTEXT=yes and use libintl from devel/gettext ".
 				"instead of from outdated bundled one if possible. ".
 				"See http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/71531 ".
Index: ports-mgmt/portlint/Makefile
===================================================================
--- ports-mgmt/portlint/Makefile	(revision 305297)
+++ ports-mgmt/portlint/Makefile	(working copy)
@@ -8,7 +8,7 @@
 #
 
 PORTNAME=	portlint
-PORTVERSION=	2.13.12
+PORTVERSION=	2.13.13
 CATEGORIES=	ports-mgmt
 MASTER_SITES=	# none
 DISTFILES=	# none

--------------090808030106000205030802--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?506F01C4.6040704>