# icu - Unicode and globalisation support
# Generated from manifest.tsv by gen-ports.py. Edit the manifest, not this file,
# unless the package needs something the template cannot express - in which case
# drop a `recipe.local` beside it and it will be preserved.
name=icu
version=78.1
release=1
desc="Unicode and globalisation support"
url="https://icu.unicode.org/"
license="ICU"
depend="glibc"
makedepend=""
source="https://github.com/unicode-org/icu/releases/download/release-78.1/icu4c-78.1-sources.tgz"
sha256="SKIP"

build() {
	# icu4c's real configure/source tree lives under source/, not the
	# tarball's top level (which is just README/license/packaging files).
	cd "icu/source"
	# ICU renames every exported C symbol with a version suffix by default
	# (ucnv_reset -> ucnv_reset_78), meant for embedding multiple ICU
	# versions side by side. A system-wide ICU package needs plain names -
	# every consumer (Qt6Core included) links against ucnv_reset, not a
	# version-suffixed one, and distros disable this for exactly that
	# reason.
	_opts="--prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib --disable-renaming"
	_help=$(./configure --help 2>/dev/null)
	case "$_help" in *--disable-static*)  _opts="$_opts --disable-static" ;; esac
	case "$_help" in *--disable-nls*)     _opts="$_opts --disable-nls" ;; esac
	case "$_help" in *--disable-dependency-tracking*) _opts="$_opts --disable-dependency-tracking" ;; esac
	# shellcheck disable=SC2086
	./configure $_opts
	gmake -j"$JOBS"
}

package() {
	cd "icu/source"
	gmake DESTDIR="$pkgdir" install
}
