musl_root/pkgs/musl-libc/build.sh

38 lines
696 B
Bash
Executable File

#!/bin/bash
pkgname="musl-libc"
pkgver="1.1.20"
src="https://www.musl-libc.org/releases/musl-${pkgver}.tar.gz"
prepare () {
[ -f "${pkgname}-src.tar.gz" ] || curl -o "${pkgname}-src.tar.gz" "${src}"
tar -C "${srcdir}" -xvf "${pkgname}-src.tar.gz"
}
build () {
cd "${srcdir}/musl-${pkgver}"
for p in "${wd}"/patches/*.patch; do
patch -u -p0 < "${p}"
done
mkdir build && cd build
../configure \
--prefix=/usr
make
}
package () {
cd "${srcdir}/musl-${pkgver}/build"
make DESTDIR="${pkgdir}" install
# Fix mislocated ld-musl-*.so
mv "${pkgdir}"/lib/ld-musl*.so* "${pkgdir}"/usr/lib
rmdir "${pkgdir}"/lib
}
. ../common.sh