icu: use separate .dat file for data
This changes the build from using data embedded in libicudata.so to using a separate .dat file which is then loaded. This allows manipulation of this data using icu tools, and fixes cross-compiling from little endian to big endian architectures, as we can handle the endian conversion ourselves.
This commit is contained in:
parent
20c39aad29
commit
797da0dbd2
1 changed files with 42 additions and 2 deletions
|
@ -3,12 +3,14 @@
|
||||||
# next soname bump.
|
# next soname bump.
|
||||||
pkgname=icu
|
pkgname=icu
|
||||||
version=64.2
|
version=64.2
|
||||||
revision=1
|
revision=2
|
||||||
wrksrc=icu
|
wrksrc=icu
|
||||||
build_wrksrc=source
|
build_wrksrc=source
|
||||||
build_style=gnu-configure
|
build_style=gnu-configure
|
||||||
|
# use archive data instead of .so data for correct cross-compiling
|
||||||
|
configure_args="--with-data-packaging=archive"
|
||||||
hostmakedepends="pkg-config"
|
hostmakedepends="pkg-config"
|
||||||
short_desc="Robust and full-featured Unicode services"
|
short_desc="Robust and fully-featured Unicode libraries"
|
||||||
maintainer="Juan RP <xtraeme@voidlinux.org>"
|
maintainer="Juan RP <xtraeme@voidlinux.org>"
|
||||||
license="ICU"
|
license="ICU"
|
||||||
homepage="http://www.icu-project.org/"
|
homepage="http://www.icu-project.org/"
|
||||||
|
@ -19,6 +21,12 @@ if [ "$CROSS_BUILD" ]; then
|
||||||
configure_args+=" --with-cross-build=${XBPS_BUILDDIR}/${wrksrc}/host-icu"
|
configure_args+=" --with-cross-build=${XBPS_BUILDDIR}/${wrksrc}/host-icu"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# we will be managing icudata manually, because when cross-compiling for
|
||||||
|
# another endianness the output data is broken... fortunately, we can use
|
||||||
|
# icupkg to convert host-endianness data to target-endianness data
|
||||||
|
_icu_dat="icudt${version%.*}"
|
||||||
|
_icu_data="source/data/in"
|
||||||
|
|
||||||
pre_configure() {
|
pre_configure() {
|
||||||
|
|
||||||
# strtod_l() is not supported by musl; also xlocale.h is missing
|
# strtod_l() is not supported by musl; also xlocale.h is missing
|
||||||
|
@ -51,10 +59,36 @@ pre_configure() {
|
||||||
# probably other stuff breaks too, so let's just do it.
|
# probably other stuff breaks too, so let's just do it.
|
||||||
# See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=653457
|
# See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=653457
|
||||||
sed -e 's,-nostdlib,,g' -i ${wrksrc}/source/config/mh-linux
|
sed -e 's,-nostdlib,,g' -i ${wrksrc}/source/config/mh-linux
|
||||||
|
|
||||||
|
export CFLAGS="${CFLAGS} -DICU_DATA_DIR=\\\"/usr/share/icu/${version}\\\""
|
||||||
|
export CXXFLAGS="${CFLAGS} -DICU_DATA_DIR=\\\"/usr/share/icu/${version}\\\""
|
||||||
|
|
||||||
|
# makefile dependency bug: this directory needs to be created manually
|
||||||
|
mkdir -p ${wrksrc}/source/data/out/tmp
|
||||||
}
|
}
|
||||||
|
|
||||||
post_install() {
|
post_install() {
|
||||||
vlicense $wrksrc/LICENSE
|
vlicense $wrksrc/LICENSE
|
||||||
|
|
||||||
|
# handled separately
|
||||||
|
rm -f ${DESTDIR}/usr/share/icu/${version}/${_icu_dat}${XBPS_TARGET_ENDIAN%e}.dat
|
||||||
|
|
||||||
|
# for little endian just use the file that's there
|
||||||
|
if [ "$XBPS_TARGET_ENDIAN" != "be" ]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
# for big endian, we need to convert the file that's there with icupkg
|
||||||
|
local _icupkg_path="${DESTDIR}/usr"
|
||||||
|
if [ "$CROSS_BUILD" ]; then
|
||||||
|
_icupkg_path="${wrksrc}/host-icu"
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -f ${wrksrc}/${_icu_data}/${_icu_dat}b.dat
|
||||||
|
|
||||||
|
LD_LIBRARY_PATH="${_icupkg_path}/lib" ${_icupkg_path}/bin/icupkg -tb \
|
||||||
|
${wrksrc}/${_icu_data}/${_icu_dat}l.dat \
|
||||||
|
${wrksrc}/${_icu_data}/${_icu_dat}b.dat
|
||||||
}
|
}
|
||||||
|
|
||||||
icu-devel_package() {
|
icu-devel_package() {
|
||||||
|
@ -74,5 +108,11 @@ icu-libs_package() {
|
||||||
short_desc+=" - shared libs"
|
short_desc+=" - shared libs"
|
||||||
pkg_install() {
|
pkg_install() {
|
||||||
vmove "usr/lib/*.so.*"
|
vmove "usr/lib/*.so.*"
|
||||||
|
|
||||||
|
# install data manually
|
||||||
|
vmkdir "usr/share/icu/${version}"
|
||||||
|
install -Dm644 \
|
||||||
|
${wrksrc}/${_icu_data}/${_icu_dat}${XBPS_TARGET_ENDIAN%e}.dat \
|
||||||
|
${PKGDESTDIR}/usr/share/icu/${version}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue