# Contributor: William Pitcock # Maintainer: William Pitcock pkgname=musl pkgver=0.9.12 pkgrel=0 pkgdesc="the musl c library (libc) implementation" url="http://www.musl-libc.org/" arch="x86 x86_64 arm armel" 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 getopt_long.c getent " _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/ } build() { local _ldflags cd "$_builddir" # note: not autotools 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 } crosstool() { mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/usr/lib mv "$pkgdir"/usr/bin/musl-gcc "$subpkgdir"/usr/bin mv "$pkgdir"/usr/lib/musl-gcc.specs "$subpkgdir"/usr/lib find "$pkgdir" -type d -delete 2>/dev/null } md5sums="100c8e932d0785c35b92539f025aa76f musl-0.9.12.tar.gz 61c6c1e84ed1df82abbe6d75e90cf21c getopt_long.c ef81489a6258501cf45db58dfc6d5211 getent" sha256sums="72353f9e1f2fdaf5e88223dcd1cfa5555f5a364eb5e4a9967de1fd44cc4c6d3e musl-0.9.12.tar.gz d9b644ec20bc33e81a7c52b9fcf7973d835923a69faf50f03db45534b811bd96 getopt_long.c d6996273f5aaaed429058257e4646b243d9e3a4d8609522f802762453f5be4cb getent" sha512sums="6f27b523a241e3a066c5b5f7309226fa97ce32354c149a189f299b3593ead3e7552c03520478f16dcbb27a52c5fe3320a7e5672b88612d7e4594b0514399eb71 musl-0.9.12.tar.gz 140f3f20d30bd95ebce8c41b8cc7f616c6cbedf4ea06c729c21014e74f6043796825cc40ebc5180620ea38173afdba23f09ebf6d8b11fa05440b14d23764fca9 getopt_long.c 4d92f934d760cf5157d80f19fd766be6b673c65317229b32ac824d9d192f6abcc414e2382b2416dfd5c2f757b46ced98c18e4762bf91f5a48647e0ee61813b06 getent"