diff options
Diffstat (limited to 'main/musl')
-rw-r--r-- | main/musl/APKBUILD | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/main/musl/APKBUILD b/main/musl/APKBUILD index 5d7effbc25..cab3874a96 100644 --- a/main/musl/APKBUILD +++ b/main/musl/APKBUILD @@ -10,7 +10,8 @@ license="MIT" depends="" depends_dev="!uclibc-dev" makedepends="$depends_dev" -subpackages="$pkgname-dev $pkgname-utils $pkgname-dbg libc6-compat:compat" +subpackages="$pkgname-dev $pkgname-dbg libc6-compat:compat" +[ "$BOOTSTRAP" != "nolibc" ] && subpackages="$subpackages $pkgname-utils" source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz ldconfig @@ -20,15 +21,13 @@ source="http://www.musl-libc.org/releases/musl-$pkgver.tar.gz iconv.c " -_builddir="$srcdir"/musl-$pkgver +builddir="$srcdir"/musl-$pkgver install_sysroot_headers() { - cd "$_builddir" - if [ -z "${CBUILDROOT}" ]; then - echo "CBUILDROOT not must be set!" - return 1 - fi + cd "$builddir" + [ -z "${CBUILDROOT}" ] && die "CBUILDROOT not set" case "$CARCH" in + aarch64*) ARCH="aarch64" ;; arm*) ARCH="arm" ;; x86) ARCH="i386" ;; x86_64) ARCH="x86_64" ;; @@ -38,13 +37,13 @@ install_sysroot_headers() { } build() { - cd "$_builddir" + 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 - if [ "$BOOTSTRAP" != "noutils" ]; then + if [ "$BOOTSTRAP" != "nolibc" ]; then # getconf/getent/iconv local i for i in getconf getent iconv ; do @@ -67,7 +66,7 @@ build() { } package() { - cd "$_builddir" + cd "$builddir" make DESTDIR="$pkgdir" install || return 1 cp libssp_nonshared.a "$pkgdir"/usr/lib || return 1 @@ -77,8 +76,6 @@ package() { 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 # remove libintl.h, currently we don't want by default any NLS # and use GNU gettext where needed. the plan is to migrate to @@ -92,16 +89,13 @@ utils() { license="MIT BSD GPL2+" mkdir -p "$subpkgdir"/usr/bin "$subpkgdir"/sbin - mv "$pkgdir"/usr/bin/ldd "$subpkgdir"/usr/bin - find "$pkgdir" -type d -delete 2>/dev/null - - if [ "$BOOTSTRAP" != "noutils" ]; then - install -D \ - "$_builddir"/getent \ - "$_builddir"/getconf \ - "$_builddir"/iconv \ - "$subpkgdir"/usr/bin - fi + ln -sf ../../lib/"$LDSO" "$subpkgdir"/usr/bin/ldd || return 1 + + install -D \ + "$builddir"/getent \ + "$builddir"/getconf \ + "$builddir"/iconv \ + "$subpkgdir"/usr/bin install -D -m755 "$srcdir"/ldconfig "$subpkgdir"/sbin } |