# Contributor: William Pitcock # Maintainer: Timo Teräs pkgname=musl pkgver=0.9.14 pkgrel=11 pkgdesc="the musl c library (libc) implementation" url="http://www.musl-libc.org/" arch="all" 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 0001-updates-from-git.patch 0002-fix-hangs-in-localtime-for-near-overflowing-time_t.patch 0003-fix-failure-of-fchmod-fstat-fchdir-and-fchown-to-pro.patch 1001-add-basic-dns-record-parsing-functions.patch 1002-add-sys-quota.h-and-quotactl-syscall-wrapper.patch 1003-add-netinet-igmp.h-and-multicast-groups-to-netinet-i.patch 1004-define-and-implement-herror.patch 1005-add-TCP_INFO-and-TCP_MD5SIG-socket-option-related-st.patch 2001-workaround-gcc-pr58245.patch getopt_long.c __stack_chk_fail_local.c getent ldconfig " _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/ # remove libintl wrappers that we don't want rm src/locale/intl.c include/libintl.h } install_sysroot_headers() { cd "$_builddir" if [ -z "${CBUILDROOT}" ]; then echo "CBUILDROOT not must be set!" return 1 fi case "$CARCH" in arm*) ARCH="arm" ;; x86) ARCH="i386" ;; x86_64) ARCH="x86_64" ;; esac make ARCH="$ARCH" prefix=/usr DESTDIR="${CBUILDROOT}" install-headers || return 1 } build() { cd "$_builddir" # provide minimal libssp_nonshared.a so we don't need libssp from gcc ${CROSS_COMPILE}gcc $CPPFLAGS $CFLAGS -c "$srcdir"/__stack_chk_fail_local.c -o __stack_chk_fail_local.o || return 1 ${CROSS_COMPILE}ar r libssp_nonshared.a __stack_chk_fail_local.o || return 1 # 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 cp libssp_nonshared.a "$pkgdir"/usr/lib || return 1 # 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 install -D "$srcdir"/ldconfig "$subpkgdir"/sbin/ldconfig } 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="bfb685695aa942e64c63170589e575b2 musl-0.9.14.tar.gz de075c4b6ff2bf406f437d100f06c6bd 0001-updates-from-git.patch 6cb4691d52d1567346e648567df283de 0002-fix-hangs-in-localtime-for-near-overflowing-time_t.patch 1190ec4f2310129c5363dd4eae29a72c 0003-fix-failure-of-fchmod-fstat-fchdir-and-fchown-to-pro.patch a3810683ef61ac27e2f6ec9801280c81 1001-add-basic-dns-record-parsing-functions.patch 06a67be89404258c321c08348cb547ce 1002-add-sys-quota.h-and-quotactl-syscall-wrapper.patch bb7b6eb67c1749943f378c88acc48e5c 1003-add-netinet-igmp.h-and-multicast-groups-to-netinet-i.patch fcf15ee683ea241ad26330c28934fa27 1004-define-and-implement-herror.patch e46d5241827593673a3d8f1a6b8bacdc 1005-add-TCP_INFO-and-TCP_MD5SIG-socket-option-related-st.patch 7a09c5cd7b3e9532e6902f54a5e928bb 2001-workaround-gcc-pr58245.patch 61c6c1e84ed1df82abbe6d75e90cf21c getopt_long.c 0df687757221bbb0fc1aa67f1bd646f9 __stack_chk_fail_local.c ef81489a6258501cf45db58dfc6d5211 getent 33e4fd94e2560e008e2c3b431d0e3419 ldconfig" sha256sums="982e9de1287cf95f9aa526adba008660d8885bfccc41faf5c613ea47f1922872 musl-0.9.14.tar.gz d8e303e61f2cc220ce2b7ffd992d37406b87dd2a4062f61f5de3e0df144227b0 0001-updates-from-git.patch 3efe2d67f6e1601dd1c946f79e142dc1c4aeb8f1d3256bf48dec2057a506d5fe 0002-fix-hangs-in-localtime-for-near-overflowing-time_t.patch 027720d36cbca364690f5eaae5dcf7efef74b8eae784e8a048fd46a4f2732329 0003-fix-failure-of-fchmod-fstat-fchdir-and-fchown-to-pro.patch 758390768b1bc4159d56908ca332b9640cd0552ed3b4b2b8d4a6d499c54c11a1 1001-add-basic-dns-record-parsing-functions.patch 4ef5ae263b55c0c691c5fb212bcdaa2050091e6acfa2a6dffc597db9743b8c53 1002-add-sys-quota.h-and-quotactl-syscall-wrapper.patch f57dee5a9309055b298056e4d4107c67e3b0d5f164ab277ffcb353fb1688a2d2 1003-add-netinet-igmp.h-and-multicast-groups-to-netinet-i.patch 995d3e6a7013f220cf3fdeae7ebfd84a1dc2517ebf53e712ab10c8b379e8ac9e 1004-define-and-implement-herror.patch 2fb0f1b6f7f0092f5f8f144cede321ad375379e93805440af538d2be846d0c24 1005-add-TCP_INFO-and-TCP_MD5SIG-socket-option-related-st.patch 45d6efda7450809e4e68f6e951431dcadf6cb7f0260930d50a9f1a8667aca49f 2001-workaround-gcc-pr58245.patch d9b644ec20bc33e81a7c52b9fcf7973d835923a69faf50f03db45534b811bd96 getopt_long.c 299a7d75a09de3e2e11e7fb4acc3182e4a14e868093d2f30938fce9bfcff13da __stack_chk_fail_local.c d6996273f5aaaed429058257e4646b243d9e3a4d8609522f802762453f5be4cb getent 306c6ca7407560340797866e077e053627ad409277d1b9da58106fce4cf717cb ldconfig" sha512sums="e5c3f7b1549dc2f9cbd3359cc413f761d5967607c23705f651c33d0ae93f00582193a41fe1f87158467d58d8eba2d7c09e0fe2f2b2c02c1dda78eee1a4cecff6 musl-0.9.14.tar.gz 1f93d537e707c60f53823419477fd9165e0aa8b6b28c6b95b80222c943b572029dcdaec2c1bb34e20e5c8c73c6869b89f5bea5b99f401db64d0a4c00abc4b092 0001-updates-from-git.patch 0ffe19fad7a8c572cd9f8a5bb7dec02fe9ac9555a09f74008fa7d7741e76a969e087670f132038c2a238b523b8c636bbc82e1f29db6b77b195d7b3b8efd90137 0002-fix-hangs-in-localtime-for-near-overflowing-time_t.patch 7c50c54c2fea33ff2a217eaf145bfc38524afcc7ca43d50463c89741b4d966bb77c6ca53ccc1752b08b6d92b2a53996b730a222d355d68bcd8df8b66b5ed8e32 0003-fix-failure-of-fchmod-fstat-fchdir-and-fchown-to-pro.patch dad965258daf69371b844f76bfe5a914b0eca0ca76f3fc340b8fd7acf598b5f87bbe6d68b1f43ed0293ee0ed3bfd85d5173ccc169aa6265646248d5b8a906708 1001-add-basic-dns-record-parsing-functions.patch c64a8c5fa7f0ad095e9281cf23eeed70f476adadb044eb8ac8e038153fd19accf601d82cf89dc289c933b7cbfce3e59ba6c03fa5f7a3a63038905453b5b152a1 1002-add-sys-quota.h-and-quotactl-syscall-wrapper.patch a8bb390658552b766c1d92cf261bc77bd2369cd185d9803f2ba0265713de16f812dfe916a4d1b428bf5073848741800d856571009042e7514098344d31751f45 1003-add-netinet-igmp.h-and-multicast-groups-to-netinet-i.patch c510abb133aedc25a421837ee9e8e02d22d512fab2534d7ac612c2df1df28484d4a7e9ccef0ceec85ba2fb27ecea916d242dfbfff13159d22c4da4757a06e4f5 1004-define-and-implement-herror.patch a6bd33dcd80a525b9aacb5947ed294fd67148b83c02b139dcb8af39aaff0a27964aa6a640b07331d0f433df22ca3f177d7422b61917d42307cefddf7352002e5 1005-add-TCP_INFO-and-TCP_MD5SIG-socket-option-related-st.patch 69ad3fc851b44f33dd7c98b83fd0adbd149b37263d17b989f4d7338ee0703dfe8994f4299744e2509492300227d652de6f21b6cdba9b633fcefd3d9f7ca0cf20 2001-workaround-gcc-pr58245.patch 140f3f20d30bd95ebce8c41b8cc7f616c6cbedf4ea06c729c21014e74f6043796825cc40ebc5180620ea38173afdba23f09ebf6d8b11fa05440b14d23764fca9 getopt_long.c 062bb49fa54839010acd4af113e20f7263dde1c8a2ca359b5fb2661ef9ed9d84a0f7c3bc10c25dcfa10bb3c5a4874588dff636ac43d5dbb3d748d75400756d0b __stack_chk_fail_local.c 4d92f934d760cf5157d80f19fd766be6b673c65317229b32ac824d9d192f6abcc414e2382b2416dfd5c2f757b46ced98c18e4762bf91f5a48647e0ee61813b06 getent 69f097faa9ccb981e78c3a914ad68a51771637d9aecd2dbc807003ac30663e6d921091a48ff529dfff27a6cd55b0808f91683118acf7acdf406d37266e622b17 ldconfig"