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-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-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"
|
|
|
|
"wrappers.cpp"
|
2023-12-08 02:05:38 +00:00
|
|
|
)
|
|
|
|
sha256sums=(
|
|
|
|
"7a35eae33d5372a7c0da1188de798726f68825513b7ae3ebe97aaaa52114f039"
|
2023-12-08 20:54:14 +00:00
|
|
|
"11b8d09dcf92a0f91c5c82defb5ad9ff4acf5cf073a80c317204baa922d136b4"
|
|
|
|
"34927e9de1a3e48fa8ccbbe5dbc13b2f4b04c66672f65b2647ab341007c84cf4"
|
|
|
|
"8c15025c99091ab2b903232359093029e15658d05484aae8254005046d86ff3a"
|
|
|
|
"cb3e01d5011c48b86f390246a3b710e02fd2e28278743f65098c4242c3cb3241"
|
|
|
|
"2827fefaf25076d5638d713f4dbd99c44330ca83d28989566cc1c089c66c4613"
|
|
|
|
"55b485a26ec69a4fdb44169b12e09d239ad2eea922a2de8d56caf76fd8355e12"
|
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-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-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-05 04:47:04 +00:00
|
|
|
}
|