#TODO: promote
[source]
tar = "https://github.com/unicode-org/icu/releases/download/release-78.3/icu4c-78.3-sources.tgz"
blake3 = "5657d84c78549f198f1335ec9d2f1de2b0ac2771fe081cbf00016370872c13f3"
patches = ["redox.patch"]

[build]
dependencies = [
    "host:libicu"
]
template = "custom"
script = """
DYNAMIC_INIT
COOKBOOK_CONFIGURE="${COOKBOOK_SOURCE}/source/configure"
COOKBOOK_CONFIGURE_FLAGS+=(
    icu_cv_host_frag=mh-linux
)
if [ "$TARGET" != "$COOKBOOK_HOST_TARGET" ]; then
COOKBOOK_CONFIGURE_FLAGS+=(
    --with-cross-build="${COOKBOOK_TOOLCHAIN}/usr"
)
fi

# libicu uses TARGET for something else
(unset TARGET && cookbook_configure)

if [ "$TARGET" = "$COOKBOOK_HOST_TARGET" ]; then
# this is not ideal, but there's no other better way
rsync -a ./ "${COOKBOOK_STAGE}/usr"
fi

"""
