2023-12-08 02:05:38 +00:00
|
|
|
# Maintainer: Daryl Ronningen <relms@relms.dev>
|
2023-12-05 04:47:04 +00:00
|
|
|
|
2023-12-08 20:54:14 +00:00
|
|
|
_llvmver=17.0.6
|
2023-12-05 04:47:04 +00:00
|
|
|
pkgname=musl
|
|
|
|
pkgver=1.2.4
|
|
|
|
pkgrel=1
|
2023-12-08 02:05:38 +00:00
|
|
|
pkgdesc="Lightweight implementation of C standard library"
|
|
|
|
arch=("x86_64")
|
|
|
|
url="https://musl.libc.org/"
|
|
|
|
license=("MIT")
|
2023-12-13 10:05:01 +00:00
|
|
|
depends=("utmps")
|
2023-12-08 20:54:14 +00:00
|
|
|
optdepends=(
|
|
|
|
"argp-standalone: Port of argp from Glibc"
|
|
|
|
"musl-fts: adds fts(3) functions"
|
|
|
|
"musl-obstack: add obstack from Glibc"
|
|
|
|
)
|
2023-12-11 13:18:00 +00:00
|
|
|
backup=("etc/ld-musl-$CARCH.path")
|
2023-12-13 10:05:01 +00:00
|
|
|
options=(staticlibs)
|
2023-12-08 02:05:38 +00:00
|
|
|
source=(
|
|
|
|
"https://musl.libc.org/releases/musl-$pkgver.tar.gz"
|
2023-12-08 20:54:14 +00:00
|
|
|
"https://github.com/llvm/llvm-project/releases/download/llvmorg-$_llvmver/compiler-rt-$_llvmver.src.tar.xz"
|
|
|
|
"0001-elf.h-add-typedefs-for-Elf64_Relr-and-Elf32_Relr.patch"
|
|
|
|
"0002-scudo-add-necessary-plumbing.patch"
|
|
|
|
"0003-scudo-clean-up-lingering-weak-symbols-we-don-t-want.patch"
|
|
|
|
"0004-do-not-rely-on-system-headers-for-cpu-info.patch"
|
2023-12-11 13:18:00 +00:00
|
|
|
"0005-Revert-remove-LFS64-symbol-aliases-replace-with-dyna.patch"
|
|
|
|
"0006-Revert-remove-LFS64-programming-interfaces-macro-onl.patch"
|
2023-12-08 20:54:14 +00:00
|
|
|
"wrappers.cpp"
|
2023-12-11 13:18:00 +00:00
|
|
|
"ld-musl.path"
|
2023-12-08 02:05:38 +00:00
|
|
|
)
|
|
|
|
sha256sums=(
|
|
|
|
"7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039"
|
2023-12-08 20:54:14 +00:00
|
|
|
"11b8d09dcf92a0f91c5c82defb5ad9ff4acf5cf073a80c317204baa922d136b4"
|
2023-12-11 13:18:00 +00:00
|
|
|
"1eed14011716974fcc7d9ff6cbfd46e3bf247e43152c69fd4d0e68a26129277f"
|
|
|
|
"416dac6bdbd19e65e6c8717e573a424e0efb61e26b28ed5a161a0a2420df8f3b"
|
|
|
|
"5c84f0cea68f9cc04356b75193d16d31852e468d06182163783997f8eced6574"
|
|
|
|
"9b119297d5d1550d57d98ad0c3a6f87e654c852430db44e1df53afacae1fc141"
|
|
|
|
"017751764328d3c4fc3bd5873b0cee446df470432c6464e0cb663ba12dae808d"
|
|
|
|
"0c6c89c7b0c4e3918de323d0015f28ec6e8f7d27301f56a95bb55e1bb31e5d54"
|
2023-12-08 20:54:14 +00:00
|
|
|
"55b485a26ec69a4fdb44169b12e09d239ad2eea922a2de8d56caf76fd8355e12"
|
2023-12-11 13:18:00 +00:00
|
|
|
"de2f97888ddbaca502e0e7417c6ab7be1123c8d1d33a18aa7df7fa95887be11b"
|
2023-12-08 02:05:38 +00:00
|
|
|
)
|
2023-12-05 04:47:04 +00:00
|
|
|
|
|
|
|
prepare() {
|
2023-12-08 02:05:38 +00:00
|
|
|
cd $pkgname-$pkgver
|
2023-12-05 04:47:04 +00:00
|
|
|
|
2023-12-08 20:54:14 +00:00
|
|
|
# Add scudo
|
|
|
|
mkdir -p src/malloc/scudo/scudo/
|
|
|
|
cp -r $srcdir/compiler-rt-$_llvmver.src/lib/scudo/standalone/*.{cpp,h,inc} src/malloc/scudo/
|
|
|
|
cp -r $srcdir/compiler-rt-$_llvmver.src/lib/scudo/standalone/include/scudo/*.h src/malloc/scudo/scudo/
|
|
|
|
|
|
|
|
# Add wrappers from chimera linux
|
|
|
|
rm src/malloc/scudo/wrappers*
|
|
|
|
cp -r $srcdir/wrappers.cpp src/malloc/scudo/
|
|
|
|
|
|
|
|
patch -p1 <$srcdir/0001-elf.h-add-typedefs-for-Elf64_Relr-and-Elf32_Relr.patch
|
|
|
|
patch -p1 <$srcdir/0002-scudo-add-necessary-plumbing.patch
|
|
|
|
patch -p1 <$srcdir/0003-scudo-clean-up-lingering-weak-symbols-we-don-t-want.patch
|
|
|
|
patch -p1 <$srcdir/0004-do-not-rely-on-system-headers-for-cpu-info.patch
|
2023-12-11 13:18:00 +00:00
|
|
|
patch -p1 <$srcdir/0005-Revert-remove-LFS64-symbol-aliases-replace-with-dyna.patch
|
|
|
|
patch -p1 <$srcdir/0006-Revert-remove-LFS64-programming-interfaces-macro-onl.patch
|
2023-12-05 04:47:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
2023-12-08 02:05:38 +00:00
|
|
|
cd $pkgname-$pkgver
|
2023-12-08 20:54:14 +00:00
|
|
|
|
|
|
|
./configure --prefix=/usr --with-malloc=scudo
|
2023-12-08 02:05:38 +00:00
|
|
|
make
|
2023-12-05 04:47:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
2023-12-08 02:05:38 +00:00
|
|
|
cd $pkgname-$pkgver
|
|
|
|
make DESTDIR="$pkgdir" install
|
2023-12-05 04:47:04 +00:00
|
|
|
|
2023-12-08 02:05:38 +00:00
|
|
|
mv $pkgdir/lib/* $pkgdir/usr/lib/
|
|
|
|
rm -rf $pkgdir/lib
|
|
|
|
mkdir $pkgdir/usr/bin
|
2023-12-08 20:54:14 +00:00
|
|
|
ln -s ../lib/ld-musl-$CARCH.so.1 $pkgdir/usr/bin/ldd
|
2023-12-05 04:47:04 +00:00
|
|
|
|
2023-12-11 13:18:00 +00:00
|
|
|
install -Dm644 $srcdir/ld-musl.path $pkgdir/etc/ld-musl-$CARCH.path
|
|
|
|
|
2023-12-08 02:05:38 +00:00
|
|
|
install -Dm0644 README "$pkgdir"/usr/share/doc/musl/README
|
|
|
|
install -Dm0644 COPYRIGHT "$pkgdir"/usr/share/licenses/musl/COPYRIGHT
|
2023-12-12 07:46:03 +00:00
|
|
|
|
2023-12-13 10:05:01 +00:00
|
|
|
# utmps replacement
|
|
|
|
rm -rf $pkgdir/usr/include/utmpx.h
|
2023-12-05 04:47:04 +00:00
|
|
|
}
|