From 4ba25cb640e4e591c325be51ecd8ae76bf5fe099 Mon Sep 17 00:00:00 2001 From: Marius Strobl Date: Mon, 18 Feb 2008 21:48:57 +0000 Subject: [PATCH] Fix `mkisofs -input-charset`: - The configure script adds dependencies on libiconv and libintl when found so set USE_GETTEXT and USE_ICONV accordingly. If these libraries are not yet installed, these dependencies can be turned off by defining WITHOUT_NLS. There's no easy way to force these dependencies off as the configure script doesn't offer such a knob and modifying its tests is not allowed. - When setting USE_GETTEXT and USE_ICONV, also add OSDEFS to the MAKE_ENV as a hack to pass -I${LOCALBASE}/include as CPPFLAGS so the installed iconv.h is found. - Install the charset conversion tables. - Set ${INS_BASE} to ${LOCALBASE} in DEFAULTS/Defaults.freebsd so the path constructed by libsiconv and mkisofs points to the installed conversion tables. - Fix a bug that caused the 'iconv:' prefix not to be stripped from the implied '-output-charset' when the conversion tables are not found or '-input-charset' is used with the 'iconv:' prefix. Submitted by: jkim Approved by: netchild --- sysutils/cdrtools-devel/Makefile | 31 +++++++++--- .../files/patch-libsiconv-sic_nls.c | 45 +++++++++++++++++ sysutils/cdrtools-devel/pkg-plist | 49 +++++++++++++++++++ 3 files changed, 119 insertions(+), 6 deletions(-) create mode 100644 sysutils/cdrtools-devel/files/patch-libsiconv-sic_nls.c diff --git a/sysutils/cdrtools-devel/Makefile b/sysutils/cdrtools-devel/Makefile index b999940ea8e0..483c49ee8fae 100644 --- a/sysutils/cdrtools-devel/Makefile +++ b/sysutils/cdrtools-devel/Makefile @@ -23,6 +23,7 @@ PORTNAME= cdrtools PORTVERSION= 2.01.01a37 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= sysutils audio MASTER_SITES= ftp://ftp.berlios.de/pub/cdrecord/alpha/ \ @@ -38,15 +39,22 @@ MAN8= isoinfo.8 mkisofs.8 MLINKS= isoinfo.8 devdump.8 isoinfo.8 isodump.8 isoinfo.8 isovfy.8 \ mkisofs.8 mkhybrid.8 DOCS= README.FreeBSD README.mkisofs +CDDA2WAVDOCS= FAQ Frontends HOWTOUSE OtherProgs README THANKS TODO CDRECORDDOCS= README README.ATAPI README.DiskT@2 README.WORM README.audio \ README.cdplus README.cdrw README.cdtext README.clone \ README.copy README.multi README.raw README.rscsi README.sony \ README.verify -CDDA2WAVDOCS= FAQ Frontends HOWTOUSE OtherProgs README THANKS TODO MKISOFSDOCS= README README.compression README.eltorito README.graft_dirs \ README.hfs_boot README.hfs_magic README.hide README.joliet \ README.macosx README.mkhybrid README.prep_boot README.rootinfo \ README.session README.sort README.sparcboot README.sunx86boot +SICONVTABLES= cp10000 cp10006 cp10007 cp10029 cp10079 cp10081 cp1250 \ + cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258 \ + cp437 cp737 cp775 cp850 cp852 cp855 cp857 cp860 cp861 \ + cp862 cp863 cp864 cp865 cp866 cp869 cp874 iso8859-1 \ + iso8859-10 iso8859-11 iso8859-13 iso8859-14 iso8859-15 \ + iso8859-16 iso8859-2 iso8859-3 iso8859-4 iso8859-5 \ + iso8859-6 iso8859-7 iso8859-8 iso8859-9 koi8-r koi8-u NO_LATEST_LINK= yes USE_BZIP2= yes @@ -67,13 +75,20 @@ PKGNAMESUFFIX?= -devel .include CCOM!= ${BASENAME} ${CC} -MAKE_ENV= CCOM=${CCOM} LANG=C +MAKE_ENV= CCOM=${CCOM} LANG=C INS_BASE=${LOCALBASE} CDRTLSTARGET= ${ARCH}-freebsd-${CCOM} .if ${OSVERSION} >= 501104 && ${OSVERSION} < 502113 IGNORE= does not work with mlockall(2) on your version of FreeBSD 5.x. Please update to FreeBSD 5.3 or later in order to use this port .endif +.if exists(${LOCALBASE}/lib/libiconv.a) || \ + exists(${LOCALBASE}/lib/libintl.a) || !defined(WITHOUT_NLS) +MAKE_ENV+= OSDEFS=-I${LOCALBASE}/include +USE_GETTEXT= yes +USE_ICONV= yes +.endif + .if exists(${LOCALBASE}/lib/libcdio.a) || defined(WITH_CDDB) WITH_CDDB= yes LIB_DEPENDS+= cddb.4:${PORTSDIR}/audio/libcddb \ @@ -112,10 +127,10 @@ post-patch: .if !defined(WITH_RSCSI) @${RM} ${WRKSRC}/TARGETS/55rscsi .endif -.for i in btcflash/btcflash.1 cdda2wav/cdda2wav.1 cdrecord/README.rscsi \ - cdrecord/cdrecord.1 cdrecord/cdrecord.dfl cdrecord/defaults.c \ - include/schily/deflts.h librscg/scsi-remote.c readcd/readcd.1 \ - rscsi/rscsi.c rscsi/rscsi.dfl scgcheck/scgcheck.1 +.for i in DEFAULTS/Defaults.freebsd btcflash/btcflash.1 cdda2wav/cdda2wav.1 \ + cdrecord/README.rscsi cdrecord/cdrecord.1 cdrecord/cdrecord.dfl \ + cdrecord/defaults.c include/schily/deflts.h librscg/scsi-remote.c \ + readcd/readcd.1 rscsi/rscsi.c rscsi/rscsi.dfl scgcheck/scgcheck.1 @${REINPLACE_CMD} -e 's|\/opt\/schily|${PREFIX}|g; \ s|\/usr\/local|${PREFIX}|g; s|\/etc\/default|${PREFIX}\/etc|g; \ s|\/var\/adm\/messages|\/var\/run\/dmesg.boot|g' ${WRKSRC}/${i} @@ -160,6 +175,10 @@ do-install: .if !exists(${PREFIX}/etc/cdrecord) @${INSTALL_DATA} ${WRKSRC}/cdrecord/cdrecord.dfl ${PREFIX}/etc/cdrecord .endif + @${MKDIR} ${PREFIX}/lib/siconv +.for i in ${SICONVTABLES} + @${INSTALL_DATA} ${WRKSRC}/libsiconv/tables/${i} ${PREFIX}/lib/siconv +.endfor .if defined(WITH_RSCSI) @${INSTALL_DATA} ${WRKSRC}/rscsi/rscsi.dfl ${PREFIX}/etc/rscsi.sample .if !exists(${PREFIX}/etc/rscsi) diff --git a/sysutils/cdrtools-devel/files/patch-libsiconv-sic_nls.c b/sysutils/cdrtools-devel/files/patch-libsiconv-sic_nls.c new file mode 100644 index 000000000000..13da1d9ffb6d --- /dev/null +++ b/sysutils/cdrtools-devel/files/patch-libsiconv-sic_nls.c @@ -0,0 +1,45 @@ +########################################################################### +# This patch was contributed by Jung-uk Kim . +########################################################################### +# The contents of this file are subject to the terms of the +# Common Development and Distribution License, Version 1.0 only +# (the "License"). You may not use this file except in compliance +# with the License. +# +# See the file CDDL.Schily.txt in this distribution for details. +# +# When distributing Covered Code, include this CDDL HEADER in each +# file and include the License file CDDL.Schily.txt from this distribution. +########################################################################### +# The file CDDL.Schily.txt can be found in the original cdrtools tarball, +# which is mirrored at ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/. +########################################################################### + +--- libsiconv/sic_nls.c.orig 2007-11-27 16:49:03.000000000 -0500 ++++ libsiconv/sic_nls.c 2008-02-09 03:13:23.000000000 -0500 +@@ -422,12 +422,15 @@ + siconvt_t *sp; + iconv_t to; + iconv_t from; +- char *nm = sip->sic_name; ++ char *nm; + + if ((sp = (siconvt_t *)malloc(sizeof (siconvt_t))) + == NULL) { + return ((siconvt_t *)NULL); + } ++ nm = sip->sic_name; ++ if (strncmp("iconv:", sip->sic_name, 6) == 0) ++ nm = &sip->sic_name[6]; + if ((from = iconv_open("UCS-2BE", nm)) == (iconv_t)-1) { + free(sp); + return ((siconvt_t *)NULL); +@@ -437,7 +440,7 @@ + iconv_close(from); + return ((siconvt_t *)NULL); + } +- sp->sic_name = nm; /* Allow to compare name pointers */ ++ sp->sic_name = sip->sic_name; /* Allow to compare name pointers */ + sip->sic_uni2cs = NULL; + sip->sic_cs2uni = NULL; + sip->sic_cd2uni = from; diff --git a/sysutils/cdrtools-devel/pkg-plist b/sysutils/cdrtools-devel/pkg-plist index a4dcc1109868..df634bc6065c 100644 --- a/sysutils/cdrtools-devel/pkg-plist +++ b/sysutils/cdrtools-devel/pkg-plist @@ -11,6 +11,55 @@ bin/mkhybrid bin/mkisofs bin/readcd bin/scgcheck +lib/siconv/cp10000 +lib/siconv/cp10006 +lib/siconv/cp10007 +lib/siconv/cp10029 +lib/siconv/cp10079 +lib/siconv/cp10081 +lib/siconv/cp1250 +lib/siconv/cp1251 +lib/siconv/cp1252 +lib/siconv/cp1253 +lib/siconv/cp1254 +lib/siconv/cp1255 +lib/siconv/cp1256 +lib/siconv/cp1257 +lib/siconv/cp1258 +lib/siconv/cp437 +lib/siconv/cp737 +lib/siconv/cp775 +lib/siconv/cp850 +lib/siconv/cp852 +lib/siconv/cp855 +lib/siconv/cp857 +lib/siconv/cp860 +lib/siconv/cp861 +lib/siconv/cp862 +lib/siconv/cp863 +lib/siconv/cp864 +lib/siconv/cp865 +lib/siconv/cp866 +lib/siconv/cp869 +lib/siconv/cp874 +lib/siconv/iso8859-1 +lib/siconv/iso8859-10 +lib/siconv/iso8859-11 +lib/siconv/iso8859-13 +lib/siconv/iso8859-14 +lib/siconv/iso8859-15 +lib/siconv/iso8859-16 +lib/siconv/iso8859-2 +lib/siconv/iso8859-3 +lib/siconv/iso8859-4 +lib/siconv/iso8859-5 +lib/siconv/iso8859-6 +lib/siconv/iso8859-7 +lib/siconv/iso8859-8 +lib/siconv/iso8859-9 +lib/siconv/koi8-r +lib/siconv/koi8-u +@dirrm lib/siconv %%RSCSI%%sbin/rscsi %%RSCSI%%@exec chmod u+s %B/%f @unexec if cmp -s %D/etc/cdrecord.sample %D/etc/cdrecord; then rm -f %D/etc/cdrecord; else echo "If permanently deleting this package, %D/etc/cdrecord must be removed manually."; fi