Bug 186637 - converters/recode doesn't build on FreeBSD 10
Summary: converters/recode doesn't build on FreeBSD 10
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Dmitry Sivachenko
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-10 21:40 UTC by Mark Knight
Modified: 2014-02-18 19:40 UTC (History)
0 users

See Also:


Attachments
recode.patch (10.76 KB, patch)
2014-02-11 19:17 UTC, Tijl Coosemans
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Knight 2014-02-10 21:40:00 UTC
--- libiconv.lo ---
cd /usr/ports/convertors/record on FreeBSD 10 yields:

libtool: compile:  cc -DLIBDIR=\"/usr/local/lib\" -DHAVE_CONFIG_H -I.. -I. -I../lib -I/usr/local/include -I/usr/local/include -DLIBICONV_PLUG -O2 -pipe -fPIC -DLIBICONV_PLUG -fno-strict-aliasing -c libiconv.c  -fPIC -DPIC -o .libs/libiconv.o
libiconv.c:50:3: warning: implicit declaration of function 'iconvctl' is invalid in C99 [-Wimplicit-function-declaration]
  iconvctl (conversion, ICONV_SET_TRANSLITERATE, &transliterate);
  ^
libiconv.c:50:25: error: use of undeclared identifier 'ICONV_SET_TRANSLITERATE'
  iconvctl (conversion, ICONV_SET_TRANSLITERATE, &transliterate);
                        ^
libiconv.c:51:33: error: use of undeclared identifier 'ICONV_SET_TRANSLITERATE'
  iconvctl (conversion_to_utf8, ICONV_SET_TRANSLITERATE, &transliterate);
                                ^
libiconv.c:102:8: error: use of undeclared identifier 'ICONV_SET_TRANSLITERATE'
                            ICONV_SET_TRANSLITERATE, &transliterate);
                            ^
libiconv.c:104:8: error: use of undeclared identifier 'ICONV_SET_TRANSLITERATE'
                            ICONV_SET_TRANSLITERATE, &transliterate);
                            ^
1 warning and 4 errors generated.
*** [libiconv.lo] Error code 1

make[3]: stopped in /usr/ports/converters/recode/work/recode-3.6/src
1 error

Fix: This patch seems to help but should be checked:



-USES=          gettext iconv perl5
+#USES=         gettext iconv perl5
+USES=          gettext iconv:translit perl5
 USE_AUTOTOOLS= libtool
 USE_PERL5=     patch run build
 USE_LDCONFIG=  yes--gJQmVZXDumqSlJ1CiUgRjm8KocvKe3516y5qfiiAJ7J0bzJ6
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

Index: Makefile
===================================================================
--- Makefile    (revision 343581)
+++ Makefile    (working copy)
@@ -11,7 +11,8 @@
 MAINTAINER=    demon@FreeBSD.org
 COMMENT=       Converts files between character sets and usages
How-To-Repeat: Not sure if it's related but I have convertors/libiconv installed
per http://svnweb.freebsd.org/ports?view=revision&revision=341775
Comment 1 Tijl Coosemans freebsd_committer freebsd_triage 2014-02-11 18:53:17 UTC
Responsible Changed
From-To: freebsd-ports-bugs->demon

Fix synopsis and assign.
Comment 2 Tijl Coosemans freebsd_committer freebsd_triage 2014-02-11 19:17:02 UTC
Hi,

Here's a more extensive patch that avoids using iconv:translit.

- Convert USE_AUTOTOOLS=libtool to USES=libtool.
- Replace PERL with REINPLACE_CMD in post-patch.
- Replace "iconv.h" with "${ICONV_PREFIX}/include/iconv.h" so
  /usr/include/iconv.h is included on FreeBSD 10 even when
  converters/iconv is installed.  The port uses iconvctl(3) which
  isn't declared in /usr/local/include/iconv.h with -DLIBICONV_PLUG.
- files/patch-lib-error.c: Implement program_name using __progname.
- files/patch-libiconv-Makefile.in: remove because the libiconv
  directory isn't built.
- files/patch-src-Makefile.in:
  + Remove chunks that aren't needed.
  + Remove ../lib/libreco.a from LIBS so CFLAGS+=-fPIC can be removed
    from the port Makefile.  Instead, just copy lib/error.c (the only
    file needed from libreco.a) to src/error.c and compile it into
    librecode.so.

Redports results: https://redports.org/buildarchive/20140211181800-36108/
Comment 3 dfilter service freebsd_committer freebsd_triage 2014-02-18 19:34:17 UTC
Author: tijl
Date: Tue Feb 18 19:34:04 2014
New Revision: 344949
URL: http://svnweb.freebsd.org/changeset/ports/344949
QAT: https://qat.redports.org/buildarchive/r344949/

Log:
  - Convert USE_AUTOTOOLS=libtool to USES=libtool.
  - Replace PERL with REINPLACE_CMD in post-patch.
  - Replace "iconv.h" with "${ICONV_PREFIX}/include/iconv.h" so
    /usr/include/iconv.h is included on FreeBSD 10 even when
    converters/iconv is installed.  The port uses iconvctl(3) which
    isn't declared in /usr/local/include/iconv.h with -DLIBICONV_PLUG.
  - files/patch-lib-error.c: Implement program_name using __progname.
  - files/patch-libiconv-Makefile.in: deleted because the libiconv
    directory isn't built.
  - files/patch-src-Makefile.in:
    + Remove chunks that aren't needed.
    + Remove ../lib/libreco.a from LIBS so CFLAGS+=-fPIC can be removed
      from the port Makefile.  Instead, just copy lib/error.c (the only
      file needed from libreco.a) to src/error.c and compile it into
      librecode.so.
  
  PR:		186637
  Approved by:	demon (maintainer)

Deleted:
  head/converters/recode/files/patch-libiconv-Makefile.in
Modified:
  head/converters/recode/Makefile
  head/converters/recode/files/patch-lib-error.c
  head/converters/recode/files/patch-src-Makefile.in
  head/converters/recode/pkg-plist

Modified: head/converters/recode/Makefile
==============================================================================
--- head/converters/recode/Makefile	Tue Feb 18 19:34:02 2014	(r344948)
+++ head/converters/recode/Makefile	Tue Feb 18 19:34:04 2014	(r344949)
@@ -3,7 +3,7 @@
 
 PORTNAME=	recode
 PORTVERSION=	3.6
-PORTREVISION=	9
+PORTREVISION=	10
 CATEGORIES=	converters
 MASTER_SITES=	${MASTER_SITE_GNU}
 MASTER_SITE_SUBDIR=	recode
@@ -11,14 +11,13 @@ MASTER_SITE_SUBDIR=	recode
 MAINTAINER=	demon@FreeBSD.org
 COMMENT=	Converts files between character sets and usages
 
-USES=		gettext iconv perl5
-USE_AUTOTOOLS=	libtool
-USE_PERL5=	patch run build
+GNU_CONFIGURE=	yes
+USES=		gettext iconv libtool perl5
+USE_PERL5=	run build
 USE_LDCONFIG=	yes
 CONFIGURE_ARGS=	--without-included-gettext
 CPPFLAGS+=	-I${LOCALBASE}/include
 LDFLAGS+=	-L${LOCALBASE}/lib ${ICONV_LIB}
-CFLAGS+=	-fPIC
 
 INFO=		recode
 
@@ -27,11 +26,13 @@ post-extract:
 	@${RM} -f ${WRKSRC}/doc/${PORTNAME}.info*
 
 post-patch:
-	@${PERL} -pi -e '\
-		if (/Project-Id-Version/) { \
+	@${REINPLACE_CMD} -E \
+		'/Project-Id-Version/ { \
 			s/3\.[45](r|\.[0-9])?/3.6/; \
-			s/: (Free )?recode/: GNU recode/; \
-		} \
-	' ${WRKSRC}/i18n/*.po
+			s/: (Free )?recode/: GNU recode/; }' \
+		${WRKSRC}/i18n/*.po
+	@${REINPLACE_CMD} 's,"iconv\.h","${ICONV_PREFIX}/include/iconv.h",' \
+		${WRKSRC}/src/libiconv.c
+	@${CP} ${WRKSRC}/lib/error.c ${WRKSRC}/src
 
 .include <bsd.port.mk>

Modified: head/converters/recode/files/patch-lib-error.c
==============================================================================
--- head/converters/recode/files/patch-lib-error.c	Tue Feb 18 19:34:02 2014	(r344948)
+++ head/converters/recode/files/patch-lib-error.c	Tue Feb 18 19:34:04 2014	(r344949)
@@ -1,28 +1,12 @@
 --- lib/error.c.orig	Thu Aug  3 03:21:13 2000
 +++ lib/error.c	Thu Apr 17 00:29:29 2003
-@@ -25,6 +25,16 @@
- # include <config.h>
- #endif
- 
-+# ifdef __FreeBSD__
-+# include <sys/types.h>
-+# include <sys/exec.h>
-+# include <sys/param.h>
-+# include <vm/vm.h>
-+# include <vm/vm_param.h>
-+# include <vm/pmap.h>
-+# include <vm/swap_pager.h>
-+# endif
-+
- #include <stdio.h>
- 
- #if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC
-@@ -80,7 +90,11 @@
+@@ -80,7 +80,12 @@
  
  /* The calling program should define program_name and set it to the
     name of the executing program.  */
 +# ifdef __FreeBSD__
-+# define program_name *((struct ps_strings *)PS_STRINGS)->ps_argvstr
++extern char *__progname;
++# define program_name __progname
 +# else
  extern char *program_name;
 +# endif

Modified: head/converters/recode/files/patch-src-Makefile.in
==============================================================================
--- head/converters/recode/files/patch-src-Makefile.in	Tue Feb 18 19:34:02 2014	(r344948)
+++ head/converters/recode/files/patch-src-Makefile.in	Tue Feb 18 19:34:04 2014	(r344949)
@@ -1,11 +1,8 @@
 --- src/Makefile.in
 +++ src/Makefile.in
-@@ -129,11 +129,11 @@ L_SURFACES =
- recode_SOURCES = main.c freeze.c mixed.c
- recode_LDADD = librecode.la ../lib/libreco.a
+@@ -131,9 +131,9 @@ L_SURFACES =
  
--librecode_la_SOURCES = argmatch.c charname.c combine.c fr-charname.c hash.c iconv.c libiconv.c localcharset.c merged.c names.c outer.c quotearg.c recode.c request.c strip-pool.c task.c xmalloc.c $(C_STEPS)
-+librecode_la_SOURCES = argmatch.c charname.c combine.c fr-charname.c hash.c libiconv.c localcharset.c merged.c names.c outer.c quotearg.c recode.c request.c strip-pool.c task.c xmalloc.c $(C_STEPS)
+ librecode_la_SOURCES = argmatch.c charname.c combine.c fr-charname.c hash.c iconv.c libiconv.c localcharset.c merged.c names.c outer.c quotearg.c recode.c request.c strip-pool.c task.c xmalloc.c $(C_STEPS)
  
 -librecode_la_LDFLAGS = -version-info 0:0:0
 +librecode_la_LDFLAGS = -version-info 3:6:0
@@ -15,100 +12,12 @@
  DEFS = -DLIBDIR=\"$(libdir)\" @DEFS@
  
  ETAGS_ARGS = $(L_STEPS)
-@@ -153,11 +153,11 @@ LTLIBRARIES =  $(lib_LTLIBRARIES)
- 
- CPPFLAGS = @CPPFLAGS@
- LDFLAGS = @LDFLAGS@
--LIBS = @LIBS@
-+LIBS = @LIBS@ ../lib/libreco.a
+@@ -157,7 +157,7 @@ LTLIBRARIES =  $(lib_LTLIBRARIES)
  ANSI2KNR = @ANSI2KNR@
  librecode_la_LIBADD = 
  librecode_la_OBJECTS =  argmatch$U.lo charname$U.lo combine$U.lo \
 -fr-charname$U.lo hash$U.lo iconv$U.lo libiconv$U.lo localcharset$U.lo \
-+fr-charname$U.lo hash$U.lo libiconv$U.lo localcharset$U.lo \
++fr-charname$U.lo hash$U.lo error$U.lo libiconv$U.lo localcharset$U.lo \
  merged$U.lo names$U.lo outer$U.lo quotearg$U.lo recode$U.lo \
  request$U.lo strip-pool$U.lo task$U.lo xmalloc$U.lo african$U.lo \
  afrtran$U.lo applemac$U.lo atarist$U.lo bangbang$U.lo cdcnos$U.lo \
-@@ -359,8 +359,6 @@ ibmpc_.c: ibmpc.c $(ANSI2KNR)
- 	$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/ibmpc.c; then echo $(srcdir)/ibmpc.c; else echo ibmpc.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > ibmpc_.c
- iconqnx_.c: iconqnx.c $(ANSI2KNR)
- 	$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/iconqnx.c; then echo $(srcdir)/iconqnx.c; else echo iconqnx.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > iconqnx_.c
--iconv_.c: iconv.c $(ANSI2KNR)
--	$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/iconv.c; then echo $(srcdir)/iconv.c; else echo iconv.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > iconv_.c
- lat1asci_.c: lat1asci.c $(ANSI2KNR)
- 	$(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/lat1asci.c; then echo $(srcdir)/lat1asci.c; else echo lat1asci.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > lat1asci_.c
- lat1ltex_.c: lat1ltex.c $(ANSI2KNR)
-@@ -425,7 +423,7 @@ bangbang_.lo base64_.o base64_.lo cdcnos_.o cdcnos_.lo charname_.o \
- charname_.lo combine_.o combine_.lo dump_.o dump_.lo ebcdic_.o \
- ebcdic_.lo endline_.o endline_.lo flat_.o flat_.lo fr-charname_.o \
- fr-charname_.lo freeze_.o freeze_.lo hash_.o hash_.lo html_.o html_.lo \
--ibmpc_.o ibmpc_.lo iconqnx_.o iconqnx_.lo iconv_.o iconv_.lo \
-+ibmpc_.o ibmpc_.lo iconqnx_.o iconqnx_.lo \
- lat1asci_.o lat1asci_.lo lat1ltex_.o lat1ltex_.lo lat1txte_.o \
- lat1txte_.lo libiconv_.o libiconv_.lo localcharset_.o localcharset_.lo \
- main_.o main_.lo merged_.o merged_.lo mixed_.o mixed_.lo mule_.o \
-@@ -575,64 +573,6 @@ ibmpc.lo ibmpc.o : ibmpc.c common.h ../config.h xalloc.h argmatch.h \
- 	../lib/error.h recodext.h recode.h
- iconqnx.lo iconqnx.o : iconqnx.c common.h ../config.h xalloc.h \
- 	argmatch.h ../lib/error.h recodext.h recode.h
--iconv.lo iconv.o : iconv.c common.h ../config.h xalloc.h argmatch.h \
--	../lib/error.h recodext.h recode.h ../libiconv/iconv.h \
--	../libiconv/libcharset.h ../libiconv/converters.h \
--	../libiconv/ascii.h ../libiconv/utf8.h ../libiconv/ucs2.h \
--	../libiconv/ucs2be.h ../libiconv/ucs2le.h ../libiconv/ucs4.h \
--	../libiconv/ucs4be.h ../libiconv/ucs4le.h ../libiconv/utf16.h \
--	../libiconv/utf16be.h ../libiconv/utf16le.h ../libiconv/utf7.h \
--	../libiconv/ucs2internal.h ../libiconv/ucs2swapped.h \
--	../libiconv/ucs4internal.h ../libiconv/ucs4swapped.h \
--	../libiconv/java.h ../libiconv/iso8859_1.h \
--	../libiconv/iso8859_2.h ../libiconv/iso8859_3.h \
--	../libiconv/iso8859_4.h ../libiconv/iso8859_5.h \
--	../libiconv/iso8859_6.h ../libiconv/iso8859_7.h \
--	../libiconv/iso8859_8.h ../libiconv/iso8859_9.h \
--	../libiconv/iso8859_10.h ../libiconv/iso8859_13.h \
--	../libiconv/iso8859_14.h ../libiconv/iso8859_15.h \
--	../libiconv/iso8859_16.h ../libiconv/koi8_r.h \
--	../libiconv/koi8_u.h ../libiconv/koi8_ru.h ../libiconv/cp1250.h \
--	../libiconv/cp1251.h ../libiconv/cp1252.h ../libiconv/cp1253.h \
--	../libiconv/cp1254.h ../libiconv/cp1255.h ../libiconv/cp1256.h \
--	../libiconv/cp1257.h ../libiconv/cp1258.h ../libiconv/cp850.h \
--	../libiconv/cp866.h ../libiconv/mac_roman.h \
--	../libiconv/mac_centraleurope.h ../libiconv/mac_iceland.h \
--	../libiconv/mac_croatian.h ../libiconv/mac_romania.h \
--	../libiconv/mac_cyrillic.h ../libiconv/mac_ukraine.h \
--	../libiconv/mac_greek.h ../libiconv/mac_turkish.h \
--	../libiconv/mac_hebrew.h ../libiconv/mac_arabic.h \
--	../libiconv/mac_thai.h ../libiconv/hp_roman8.h \
--	../libiconv/nextstep.h ../libiconv/armscii_8.h \
--	../libiconv/georgian_academy.h ../libiconv/georgian_ps.h \
--	../libiconv/mulelao.h ../libiconv/cp1133.h ../libiconv/tis620.h \
--	../libiconv/cp874.h ../libiconv/viscii.h ../libiconv/tcvn.h \
--	../libiconv/iso646_jp.h ../libiconv/jisx0201.h \
--	../libiconv/jisx0208.h ../libiconv/jisx0212.h \
--	../libiconv/iso646_cn.h ../libiconv/gb2312.h \
--	../libiconv/isoir165.h ../libiconv/isoir165ext.h \
--	../libiconv/gbk.h ../libiconv/gbkext1.h ../libiconv/gbkext2.h \
--	../libiconv/gbkext_inv.h ../libiconv/cp936ext.h \
--	../libiconv/cns11643.h ../libiconv/cns11643_1.h \
--	../libiconv/cns11643_2.h ../libiconv/cns11643_3.h \
--	../libiconv/cns11643_inv.h ../libiconv/big5.h \
--	../libiconv/ksc5601.h ../libiconv/johab_hangul.h \
--	../libiconv/euc_jp.h ../libiconv/sjis.h ../libiconv/cp932.h \
--	../libiconv/cp932ext.h ../libiconv/iso2022_jp.h \
--	../libiconv/iso2022_jp1.h ../libiconv/iso2022_jp2.h \
--	../libiconv/euc_cn.h ../libiconv/ces_gbk.h \
--	../libiconv/gb18030.h ../libiconv/gb18030ext.h \
--	../libiconv/gb18030uni.h ../libiconv/iso2022_cn.h \
--	../libiconv/iso2022_cnext.h ../libiconv/hz.h \
--	../libiconv/euc_tw.h ../libiconv/ces_big5.h ../libiconv/cp950.h \
--	../libiconv/cp950ext.h ../libiconv/big5hkscs.h \
--	../libiconv/hkscs.h ../libiconv/euc_kr.h ../libiconv/cp949.h \
--	../libiconv/uhc_1.h ../libiconv/uhc_2.h ../libiconv/johab.h \
--	../libiconv/iso2022_kr.h ../libiconv/cjk_variants.h \
--	../libiconv/translit.h ../libiconv/encodings.def \
--	../libiconv/encodings_local.def ../libiconv/flags.h \
--	../libiconv/loops.h ../libiconv/loop_unicode.h \
--	../libiconv/loop_wchar.h ../libiconv/aliases.h
- lat1asci.lo lat1asci.o : lat1asci.c common.h ../config.h xalloc.h \
- 	argmatch.h ../lib/error.h recodext.h recode.h
- lat1ltex.lo lat1ltex.o : lat1ltex.c common.h ../config.h xalloc.h \

Modified: head/converters/recode/pkg-plist
==============================================================================
--- head/converters/recode/pkg-plist	Tue Feb 18 19:34:02 2014	(r344948)
+++ head/converters/recode/pkg-plist	Tue Feb 18 19:34:04 2014	(r344949)
@@ -5,6 +5,7 @@ lib/librecode.a
 lib/librecode.la
 lib/librecode.so
 lib/librecode.so.3
+lib/librecode.so.3.0.6
 man/man1/recode.1.gz
 share/locale/da/LC_MESSAGES/recode.mo
 share/locale/de/LC_MESSAGES/recode.mo
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 4 Tijl Coosemans freebsd_committer freebsd_triage 2014-02-18 19:36:17 UTC
State Changed
From-To: open->closed

Committed in r344949.