sthen 5eb473200e Switch icu4c back to --with-data-packaging=archive to place the data in
a separate file rather than directly in icudata.so to avoid the symbol
size warnings from ld.so.

As this data file is needed at runtime, provide a subpackage containing
a second copy installed under /var/www for use with chrooted web
applications (notably php-intl) that use icu4c. (Applications using
chroot jails other than /var/www will need a further copy of the data
file).

Feedback/ok ajacoutot@, bumps to follow.
2017-08-24 09:44:34 +00:00

89 lines
2.3 KiB
Makefile

# $OpenBSD: Makefile,v 1.65 2017/08/24 09:44:34 sthen Exp $
NOT_FOR_ARCHS= ${GCC3_ARCHS}
COMMENT-main= International Components for Unicode
COMMENT-wwwdata= ICU data file for use with /var/www chroot jails
VERSION= 58.2
DISTNAME= icu4c-${VERSION:S/./_/g}-src
PKGNAME-main= icu4c-${VERSION}
PKGNAME-wwwdata= icu4c-wwwdata-${VERSION}
REVISION-main= 5
MAJ_V= ${VERSION:R}
SO_VERSION= 13.0
.for _lib in icudata icui18n icuio icutest icutu icuuc
SHARED_LIBS+= ${_lib} ${SO_VERSION}
.endfor
SUBST_VARS+= MAJ_V VERSION
CATEGORIES= textproc devel
DPB_PROPERTIES= parallel
HOMEPAGE= http://www.icu-project.org
MAINTAINER= Antoine Jacoutot <ajacoutot@openbsd.org>
# ICU: http://source.icu-project.org/repos/icu/icu/trunk/license.html
PERMIT_PACKAGE_CDROM= Yes
WANTLIB= c m pthread ${COMPILER_LIBCXX}
MASTER_SITES= http://download.icu-project.org/files/icu4c/${VERSION}/ \
${MASTER_SITE_SOURCEFORGE:=icu/}
EXTRACT_SUFX= .tgz
USE_GMAKE= Yes
CONFIGURE_STYLE= gnu
CONFIGURE_ARGS= --enable-static \
--disable-renaming \
--disable-samples \
--with-data-packaging=archive
# needs icu-le-hb
CONFIGURE_ARGS += --disable-layoutex
SEPARATE_BUILD= Yes
WRKDIST= ${WRKDIR}/icu
WRKSRC= ${WRKDIST}/source
MULTI_PACKAGES= -main -wwwdata
# see readme.html
CXXFLAGS += -DICU_NO_USER_DATA_OVERRIDE
MAKE_FLAGS= VERBOSE=1 \
SO_TARGET_VERSION=${SO_VERSION} \
SO_TARGET_VERSION_MAJOR=${SO_VERSION:R} \
PKGDATA_INVOKE_OPTS="SO_TARGET_VERSION=${SO_VERSION} SO_TARGET_VERSION_MAJOR=${SO_VERSION:R}"
# icupkg segfaults during the build
.if ${MACHINE_ARCH} == "arm"
CFLAGS += -O1 -fno-stack-protector
CXXFLAGS += -O1 -fno-stack-protector
.endif
.include <bsd.port.arch.mk>
.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
PREFIX-wwwdata = /var/www${TRUEPREFIX}
SUBST_VARS += ENDIAN_DATA
TEST_ENV += ICU_DATA="${WRKBUILD}/data/out/build/${ENDIAN_DATA}"
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>