redox/recipes/archives/bzip2/recipe.toml
Andi McClure 60779ecf51 Merge branch 'missing-descriptions' into 'master'
Recipe fixup: Fix errors in recipe files, add descriptions for all non-WIP

See merge request redox-os/redox!2363
2026-11-03 20:17:59 +00:00

53 lines
1.6 KiB
TOML

[package]
description = "Compression library and tools, bzip2/.bz2 format"
[source]
tar = "https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz"
blake3 = "97af3f520629c65fe41292f77e6ca798fe594d7987bfb2aebe7c6fcdc7ab5ed2"
[build]
template = "custom"
script = """
DYNAMIC_INIT
# This installs the static library regardless of config options
# The static lib is preferred according to the README because it's faster
rsync -av --delete "${COOKBOOK_SOURCE}/" ./
"${COOKBOOK_MAKE}" -j"${COOKBOOK_MAKE_JOBS}" \
AR="${AR}" \
CC="${CC}" \
RANLIB="${RANLIB}" \
PREFIX="${COOKBOOK_STAGE}/usr" \
install
if [ "${COOKBOOK_DYNAMIC}" = "1" ]; then
# However, distros distribute libbz2 as well so we'll support it too
# Linking the lib fails if we don't rebuild the objects from earlier
"${COOKBOOK_MAKE}" clean
# This DOES NOT build/clobber the binaries already built above
"${COOKBOOK_MAKE}" -f Makefile-libbz2_so \
-j"${COOKBOOK_MAKE_JOBS}" \
AR="${AR}" \
CC="${CC}" \
RANLIB="${RANLIB}" \
PREFIX="${COOKBOOK_STAGE}/usr"
cp -av libbz2.so* "${COOKBOOK_STAGE}/usr/lib"
ln -s "libbz2.so.1.0" "${COOKBOOK_STAGE}/usr/lib/libbz2.so.1"
ln -s "libbz2.so.1.0" "${COOKBOOK_STAGE}/usr/lib/libbz2.so"
fi
# Change symlinks in usr/bin as relative
find "${COOKBOOK_STAGE}/usr/bin" -type l | while read -r link; do
target=$(readlink "$link")
if [[ "$target" = /* ]]; then
ln -snfr "$target" "$link"
fi
done
mkdir -p "${COOKBOOK_STAGE}/usr/lib/pkgconfig" "${COOKBOOK_STAGE}/usr/share/"
cp "${COOKBOOK_RECIPE}/pkgconfig" "${COOKBOOK_STAGE}/usr/lib/pkgconfig/bzip2.pc"
mv "${COOKBOOK_STAGE}/usr/man" "${COOKBOOK_STAGE}/usr/share/"
"""