# Contributor: Sergey Lukin # Contributor: Jakub Jirutka # Maintainer: Natanael Copa pkgname=icu pkgver=73.2 pkgrel=2 pkgdesc="International Components for Unicode library" url="https://icu.unicode.org/" arch="all" license="ICU" depends_dev="$pkgname=$pkgver-r$pkgrel" makedepends="python3 py3-yaml" checkdepends="diffutils" install="$pkgname-data-en.post-install" subpackages=" $pkgname-static $pkgname-dev $pkgname-doc $pkgname-libs $pkgname-data-en:_data_en:noarch $pkgname-data-full:_data_full:noarch " source="https://github.com/unicode-org/icu/releases/download/release-${pkgver//./-}/icu4c-${pkgver//./_}-src.tgz https://github.com/unicode-org/icu/releases/download/release-${pkgver//./-}/icu4c-${pkgver//./_}-data.zip https://github.com/unicode-org/icu/releases/download/release-${pkgver//./-}/icu4c-${pkgver//./_}-data-bin-b.zip https://github.com/unicode-org/icu/releases/download/release-${pkgver//./-}/icu4c-${pkgver//./_}-data-bin-l.zip cal-regression.patch standardize-vtzone-output.patch data-filter-en.yml " builddir="$srcdir/icu/source" # seems to fail check now with gcc13, only on x86 case "$CARCH" in x86) options="$options !check" ;; esac # secfixes: # 66.1-r0: # - CVE-2020-21913 # 65.1-r1: # - CVE-2020-10531 # 57.1-r1: # - CVE-2016-6293 # 58.1-r1: # - CVE-2016-7415 # 58.2-r2: # - CVE-2017-7867 # - CVE-2017-7868 case "$CARCH" in s390x) _icudtfile=icudt${pkgver%%.*}b.dat;; *) _icudtfile=icudt${pkgver%%.*}l.dat;; esac prepare() { default_prepare rm -rf data mv "$srcdir"/data . } build() { _yaml2json "$srcdir"/data-filter-en.yml > data-filter-en.json export ICU_DATA_FILTER_FILE="./data-filter-en.json" case "$CARCH" in armv7) # bus error with -Os for some reason export CFLAGS="$CFLAGS -O2" export CXXFLAGS="$CXXFLAGS -O2" ;; esac ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --sysconfdir=/etc \ --with-data-packaging=archive \ --disable-samples \ --enable-static \ --mandir=/usr/share/man make } check() { # Tests need full data. export ICU_DATA="$srcdir"/$_icudtfile CINTLTST_OPTS='-w' make check } package() { make -j1 DESTDIR="$pkgdir" install chmod +x "$pkgdir"/usr/bin/icu-config install -Dm644 "$srcdir"/icu/license.html -t "$pkgdir"/usr/share/licenses/icu/ } dev() { default_dev amove usr/lib/icu amove usr/lib/libicutest.so.* amove usr/share/icu/*/LICENSE amove usr/share/icu/*/config amove usr/share/icu/*/install-sh amove usr/share/icu/*/mkinstalldirs } libs() { pkgdesc="$pkgdesc (libraries)" depends="$pkgname-data=$pkgver-r$pkgrel" replaces="icu" # Data stub required by the Common and I18n libraries. amove usr/lib/libicudata.so.[0-9]* # A library that contains many locale based internationalization (i18n) functions. amove usr/lib/libicui18n.so.[0-9]* # An optional library that provides a stdio like API with Unicode support. amove usr/lib/libicuio.so.[0-9]* # Base library required by all other ICU libraries. amove usr/lib/libicuuc.so.[0-9]* # An internal library that contains internal APIs that are only used by ICU’s tools. # Keep in the base package. #amove usr/lib/libicutu.so.[0-9]* } _data_en() { pkgdesc="Stripped down ICU data with only en_US/GB locale and no legacy charset converters" provides="$pkgname-data=$pkgver-r$pkgrel" provider_priority=100 # highest (other provider is icu-data-full) replaces="$pkgname-data<71.1-r1" amove usr/share/icu/$pkgver/$_icudtfile } _data_full() { pkgdesc="Full ICU data" provides="$pkgname-data=$pkgver-r$pkgrel" provider_priority=10 # lowest (other provider is icu-data-en) replaces="$pkgname-data<71.1-r1" install -D -m644 "$srcdir"/$_icudtfile -t "$subpkgdir"/usr/share/icu/$pkgver/ } _yaml2json() { python3 -c 'import sys, yaml, json; json.dump(yaml.safe_load(sys.stdin), sys.stdout)' <"$1" } sha512sums=" 76dd782db6205833f289d7eb68b60860dddfa3f614f0ba03fe7ec13117077f82109f0dc1becabcdf4c8a9c628b94478ab0a46134bdb06f4302be55f74027ce62 icu4c-73_2-src.tgz 7f25816de4062fe79eaf350cb5230747643b9bb08c60443b4e1b2d79eb1ce3192ae9a767107171b85bda4cfc1969035ce09cebc81add0590eb4d61ca33aa0730 icu4c-73_2-data.zip 8512947da7b2a927627abed6bd7e04218cd4fcd02d44eb72a82ffa87aedabfc3be5d3152e9fba33a769ef35e2db55764c2ab8f5bd65b4e89aa9c15b33392e078 icu4c-73_2-data-bin-b.zip 420c2f5090927dab13f5449da3b0ec7bf86a91ea8723f177aca2907a8eea9bcb4c3475b66c54355ae320001813db57a00afdab00bd85b8c36d39adedcab80bfc icu4c-73_2-data-bin-l.zip 09dd560bf5cfa5c32fc6f1f04b209446fa3b5306e9c237ee78afeea4588030bac1e3daf03a1e7f6273c85ecfacd9b938518fc194c11d7f5259e2b7730fc2a56d cal-regression.patch c76fd529f92a7b27a45a307c8bb91c109910d012478414b08983af3320e29fbe76e03d8434c4efbde68ecaa56a86130d6514428c5a1085985634bc3650e8e96e standardize-vtzone-output.patch 609541c1ac10c12b2b52f7800a2057d5c97e49dc9a1774a1b53e13d88599128baa7637f1a63b4de52dfe58b1038c7f3462ef29ad223dbe2ecb2862e3249a1cf4 data-filter-en.yml "