On 2017/08/01 09:33, Stuart Henderson wrote:
> There is another way around it, using --with-data-packaging=archive, but
> that breaks use within chroot (notably the php-intl module, but we might
> also have a problem if we enable smtputf8 in postfix) unless the data
> file is copied in. There is another way we could handle that, add a
> second (and possibly third) copy of the data file to either icu4c or
> to other packages using it, but that's not particularly appealing..
> 
> If anyone has other ideas of how to quieten this (er, maybe not a
> strcmp in ld.so though.. :) please speak up!

In the absence of other ideas, here's an initial diff that installs
a copy of the data file in the www chroot. There are various ways we
could do this, this is the dumb-and-simple method of putting it in
the main package, an alternative would be to add a subpackage just
for this that the various php*-intl versions could depend on.

Index: Makefile
===================================================================
RCS file: /cvs/ports/textproc/icu4c/Makefile,v
retrieving revision 1.64
diff -u -p -r1.64 Makefile
--- Makefile    26 Jul 2017 22:45:30 -0000      1.64
+++ Makefile    23 Aug 2017 15:44:13 -0000
@@ -7,7 +7,7 @@ COMMENT=                International Components for U
 VERSION=               58.2
 DISTNAME=              icu4c-${VERSION:S/./_/g}-src
 PKGNAME=               icu4c-${VERSION}
-REVISION=              4
+REVISION=              5
 
 MAJ_V=                 ${VERSION:R}
 SO_VERSION=            13.0
@@ -36,7 +36,8 @@ USE_GMAKE=            Yes
 CONFIGURE_STYLE=       gnu
 CONFIGURE_ARGS=                --enable-static \
                        --disable-renaming \
-                       --disable-samples
+                       --disable-samples \
+                       --with-data-packaging=archive
 # needs icu-le-hb
 CONFIGURE_ARGS +=      --disable-layoutex
 
@@ -59,34 +60,25 @@ CXXFLAGS +=         -O1 -fno-stack-protector
 .endif
 
 .include <bsd.port.arch.mk>
-PKG_ARGS +=            -Dbe=0 -Dle=0
-.if ${MACHINE_ARCH} == "arm" || ${MACHINE_ARCH} == "powerpc"
-# XXX breaks icu in chroot (e.g. php-intl) because the dat file won't be found
-CONFIGURE_ARGS +=      --with-data-packaging=archive
-.  if ${PROPERTIES:Mbe}
-PKG_ARGS +=            -Dbe=1
-TEST_ENV +=            ICU_DATA="${WRKBUILD}/data/out/build/icudt${MAJ_V}b"
-.  else
-PKG_ARGS +=            -Dle=1
-TEST_ENV +=            ICU_DATA="${WRKBUILD}/data/out/build/icudt${MAJ_V}l"
-.  endif
-.endif
 
-# https://bugzilla.redhat.com/show_bug.cgi?id=889781
 .if ${PROPERTIES:Mbe}
+ENDIAN_DATA =          icudt${MAJ_V}b
+# https://bugzilla.redhat.com/show_bug.cgi?id=889781
 CONFIGURE_ENV +=       CPPFLAGS="-DU_IS_BIG_ENDIAN=1"
+.else
+ENDIAN_DATA =          icudt${MAJ_V}l
 .endif
 
-TEST_DEPENDS=          ${BASE_PKGPATH}=${VERSION}
+WWW_PREFIX =           ${TRUEPREFIX:S/\///}
+SUBST_VARS +=          ENDIAN_DATA WWW_PREFIX
+TEST_ENV +=            ICU_DATA="${WRKBUILD}/data/out/build/${ENDIAN_DATA}"
 
-# XXX prevent "WARNING: symbol(icudt58_dat) size mismatch"
-.if ! ${PROPERTIES:Mclang} 
-post-extract:
-       sed -i 's/^DYNAMICCFLAGS = .*/& -finhibit-size-directive/' \
-               ${WRKSRC}/stubdata/Makefile.in
-.endif
+TEST_DEPENDS=          ${BASE_PKGPATH}=${VERSION}
 
 post-install:
        find ${PREFIX}/lib -type l -name 'libicu*.so*' -exec rm '{}' \;
+       ${INSTALL_DATA_DIR} 
${WRKINST}/var/www/${TRUEPREFIX}/share/icu/${VERSION}/
+       ${INSTALL_DATA} ${PREFIX}/share/icu/${VERSION}/${ENDIAN_DATA}.dat \
+               ${WRKINST}/var/www/${TRUEPREFIX}/share/icu/${VERSION}/
 
 .include <bsd.port.mk>
Index: pkg/PFRAG.be
===================================================================
RCS file: pkg/PFRAG.be
diff -N pkg/PFRAG.be
--- pkg/PFRAG.be        17 Oct 2014 08:35:10 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,2 +0,0 @@
-@comment $OpenBSD: PFRAG.be,v 1.1 2014/10/17 08:35:10 ajacoutot Exp $
-share/icu/${VERSION}/icudt${MAJ_V}b.dat
Index: pkg/PFRAG.le
===================================================================
RCS file: pkg/PFRAG.le
diff -N pkg/PFRAG.le
--- pkg/PFRAG.le        17 Oct 2014 08:35:10 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,2 +0,0 @@
-@comment $OpenBSD: PFRAG.le,v 1.1 2014/10/17 08:35:10 ajacoutot Exp $
-share/icu/${VERSION}/icudt${MAJ_V}l.dat
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/textproc/icu4c/pkg/PLIST,v
retrieving revision 1.21
diff -u -p -r1.21 PLIST
--- pkg/PLIST   24 May 2017 15:44:42 -0000      1.21
+++ pkg/PLIST   23 Aug 2017 15:44:13 -0000
@@ -226,10 +226,15 @@ lib/pkgconfig/icu-uc.pc
 @bin sbin/icupkg
 share/icu/
 share/icu/${VERSION}/
+share/icu/${VERSION}/${ENDIAN_DATA}.dat
 share/icu/${VERSION}/LICENSE
 share/icu/${VERSION}/config/
 share/icu/${VERSION}/config/mh-bsd-gcc
 share/icu/${VERSION}/install-sh
 share/icu/${VERSION}/mkinstalldirs
-%%be%%
-%%le%%
+@cwd /var/www
+${WWW_PREFIX}/
+${WWW_PREFIX}/share/
+${WWW_PREFIX}/share/icu/
+${WWW_PREFIX}/share/icu/${VERSION}/
+${WWW_PREFIX}/share/icu/${VERSION}/${ENDIAN_DATA}.dat

Reply via email to