summaryrefslogtreecommitdiff
path: root/repo/system/musl.xibuild
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-02-26 23:52:03 +0000
committerdavidovski <david@davidovski.xyz>2022-02-26 23:52:03 +0000
commit7e7775ad670c99b2823d812c782f6ff258e79b9b (patch)
tree6839757e3b96634aa51c902e1ab25b6a9bb707be /repo/system/musl.xibuild
parent26477da178fa7c84edff5fd9d3c8ef28c0c3ad7d (diff)
replaced glibc with musl
Diffstat (limited to 'repo/system/musl.xibuild')
-rw-r--r--repo/system/musl.xibuild47
1 files changed, 47 insertions, 0 deletions
diff --git a/repo/system/musl.xibuild b/repo/system/musl.xibuild
new file mode 100644
index 0000000..921736d
--- /dev/null
+++ b/repo/system/musl.xibuild
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+MAKEDEPS=""
+DEPS=""
+
+PKG_VER=1.2.2
+SOURCE=https://musl.libc.org/releases/musl-$PKG_VER.tar.gz
+
+ADDITIONAL="
+ https://raw.githubusercontent.com/dslm4515/Musl-LFS/master/patches/musl-mlfs/fix-utmp-wtmp-paths.patch
+ https://raw.githubusercontent.com/dslm4515/Musl-LFS/master/patches/musl-mlfs/change-scheduler-functions-Linux-compatib.patch
+ https://raw.githubusercontent.com/dslm4515/Musl-LFS/master/patches/musl-alpine/0001-riscv64-define-ELF_NFPREG.patch
+ https://raw.githubusercontent.com/dslm4515/Musl-LFS/master/patches/musl-alpine/handle-aux-at_base.patch
+ https://raw.githubusercontent.com/dslm4515/Musl-LFS/master/patches/musl-alpine/syscall-cp-epoll.patch
+"
+
+DESC="Implementation of the C standard library built on top of the Linux system call API"
+
+prepare () {
+ for p in *.patch; do
+ patch -Np1 -i $p || true
+ done
+}
+
+build () {
+ LDFLAGS="$LDFLAGS -Wl,-soname,libc.musl-${CARCH}.so.1" \
+./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --disable-gcc-wrapper
+ make
+}
+
+package () {
+ make DESTDIR=$PKG_DEST install
+ ln -sv /lib/ld-musl-$ARCH.so.1 $PKG_DEST/bin/ldd
+ ln -sv libc.so $PKG_DEST/usr/lib/libc.musl-x86_64.so.1
+
+ cat > $PKG_DEST/etc/ld-musl-x86_64.path << "EOF"
+/lib
+/usr/local/lib
+/usr/lib
+EOF
+
+ rm -v $PKG_DEST/usr/include/utmpx.h
+}
+