# Contributor: Sergey Lukin # Maintainer: Natanael Copa pkgname=icu pkgver=58.2 # convert x.y.z to x_y_z _ver=${pkgver//./_} pkgrel=1 pkgdesc="International Components for Unicode library" url="http://www.icu-project.org/" arch="all" license="custom:icu" subpackages="$pkgname-dev $pkgname-doc $pkgname-libs" depends= makedepends= source="http://download.icu-project.org/files/icu4c/${pkgver}/${pkgname}4c-$_ver-src.tgz icu-timezone.patch icu-58.1-iterator-reset.patch " # secfixes: # 57.1-r1: # - CVE-2016-6293 # 58.1-r1: # - CVE-2016-7415 builddir="$srcdir"/icu/source prepare() { cd "$builddir" update_config_sub || return 1 # strtod_l() is not supported by musl; also xlocale.h is missing # It is not possible to disable its use via configure switches or env vars # so monkey patching is needed. Idea was stollen from openembedded # https://github.com/openembedded/openembedded-core/blob/master/meta/recipes-support/icu/icu.inc#L30 sed -i -e 's,DU_HAVE_STRTOD_L=1,DU_HAVE_STRTOD_L=0,' configure.ac sed -i -e 's,DU_HAVE_STRTOD_L=1,DU_HAVE_STRTOD_L=0,' configure local x # https://bugs.icu-project.org/trac/ticket/6102 for x in ARFLAGS CFLAGS CPPFLAGS CXXFLAGS FFLAGS LDFLAGS; do sed -i -e "/^${x} =.*/s:@${x}@::" "config/Makefile.inc.in" \ || return 1 done for i in $source; do case "$i" in *.patch) msg "Applying $i" patch -p1 -i "$srcdir"/$i || return 1 ;; esac done } build() { cd "$builddir" ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --sysconfdir=/etc \ --with-data-packaging=library \ --disable-samples \ --mandir=/usr/share/man \ || return 1 make || return 1 } package() { cd "$builddir" make -j1 DESTDIR="$pkgdir" install || return 1 chmod +x "$pkgdir"/usr/bin/icu-config install -Dm644 "$srcdir"/icu/license.html \ "$pkgdir"/usr/share/licenses/icu/license.html } libs() { default_libs replaces="icu" } md5sums="fac212b32b7ec7ab007a12dff1f3aea1 icu4c-58_2-src.tgz 2c81d9c9a6ea0af5b7391e001f37a5e0 icu-timezone.patch 7119b3fc32f4785588b2dc55a62ba85f icu-58.1-iterator-reset.patch" sha256sums="2b0a4410153a9b20de0e20c7d8b66049a72aef244b53683d0d7521371683da0c icu4c-58_2-src.tgz 1c3c432228ee254af7adc995d65b65a4c9dac3b868fe1e49fe588a0ffa55a158 icu-timezone.patch 62b593b019baf172ccccc001df1bb2a204aab4d84a5731e10449ae4260eede21 icu-58.1-iterator-reset.patch" sha512sums="5c21af748f48b392e6c0412bd0aee92162ea931820dcbfab4ec6e0299868504b303d88f7586cc95de55c777ac0dca3a29d6c8ca0892c646ebc864c8a5b5a162a icu4c-58_2-src.tgz 40489c36e28e160f08e045acab6c19cdb712ad3b7f87f67099deac7d579aaf13d8841cd3278a6bb0e998b5c34a378348a13fcc8bb14c9c4eb4f6adbd10d66825 icu-timezone.patch c97986e188bc0f3daa2d3bebed309b87704797f527197fde910794499d1079ea0ce33a75124d2f9a8fd451d91a44d8d5077fc77c1cd49aee53bdbaf61a5826d1 icu-58.1-iterator-reset.patch"