Newer
Older
# Contributor: William Pitcock <nenolod@dereferenced.org>
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=musl
pkgdesc="the musl c library (libc) implementation"
url="http://www.musl-libc.org/"
license="MIT"
depends=""
depends_dev=""
makedepends="$depends_dev"
install=""
subpackages="$pkgname-dev $pkgname-utils"
[ "${CTARGET#*musl}" = "$CTARGET" ] && subpackages="$subpackages musl-gcc:crosstool"
source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz
_builddir="$srcdir"/musl-$pkgver
prepare() {
local i
cd "$_builddir"
for i in $source; do
case $i in
*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
esac
done
# use GNU compatible getopt() from BSD
rm -f src/misc/getopt*.c
cp "$srcdir"/getopt_long.c src/misc/
LDFLAGS="$LDFLAGS -Wl,-soname,libc.musl-${CARCH}.so.1" \
./configure \
--host=$CHOST \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--localstatedir=/var \
|| return 1
make || return 1
}
package() {
cd "$_builddir"
make DESTDIR="$pkgdir" install || return 1
rm -f "$pkgdir"/usr/lib/*.la
# make LDSO the be the real file, and libc the symlink (will be upstream change)
local LDSO=$(make -f Makefile --eval "$(echo -e 'print-ldso:\n\t@echo $$(basename $(LDSO_PATHNAME))')" print-ldso)
mv -f "$pkgdir"/usr/lib/libc.so "$pkgdir"/lib/"$LDSO" || return 1
ln -sf "$LDSO" "$pkgdir"/lib/libc.musl-${CARCH}.so.1 || return 1
ln -sf ../../lib/"$LDSO" "$pkgdir"/usr/lib/libc.so || return 1
mkdir -p "$pkgdir"/usr/bin
ln -sf ../../lib/"$LDSO" "$pkgdir"/usr/bin/ldd || return 1
utils() {
mkdir -p "$subpkgdir"/usr/bin
mv "$pkgdir"/usr/bin/ldd "$subpkgdir"/usr/bin
find "$pkgdir" -type d -delete 2>/dev/null
install -D "$srcdir"/getent "$subpkgdir"/usr/bin/getent
}
mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/musl-gcc.specs "$subpkgdir"/usr/lib
find "$pkgdir" -type d -delete 2>/dev/null
md5sums="6af97d6157a2f4ee7a17af2316389fd7 musl-0.9.13.tar.gz
61c6c1e84ed1df82abbe6d75e90cf21c getopt_long.c
ef81489a6258501cf45db58dfc6d5211 getent"
sha256sums="9ad29ff43dd767956280e58229fd5ae2ff0f3cec026063b381a72d1b743428e5 musl-0.9.13.tar.gz
d9b644ec20bc33e81a7c52b9fcf7973d835923a69faf50f03db45534b811bd96 getopt_long.c
d6996273f5aaaed429058257e4646b243d9e3a4d8609522f802762453f5be4cb getent"
sha512sums="623a7addd032b2fed5850451225c45fac07e0496467c9f3b3355baab6d0b8aeb011af6ed7c298dd396b3820d5bd82fc84fe95e79e3dc9ad7ee9b96f954e0cc5b musl-0.9.13.tar.gz
140f3f20d30bd95ebce8c41b8cc7f616c6cbedf4ea06c729c21014e74f6043796825cc40ebc5180620ea38173afdba23f09ebf6d8b11fa05440b14d23764fca9 getopt_long.c
4d92f934d760cf5157d80f19fd766be6b673c65317229b32ac824d9d192f6abcc414e2382b2416dfd5c2f757b46ced98c18e4762bf91f5a48647e0ee61813b06 getent"