pkg-aarch64-linux-musl/PKGBUILD

53 lines
1.2 KiB
Bash
Raw Permalink Normal View History

# Maintainer: Allen Wild <allenwild93@gmail.com>
# Contributor: Riley Trautman <asonix.dev@gmail.com>
2017-12-09 02:14:13 +08:00
pkgname=aarch64-linux-musl
2024-05-23 12:51:25 +08:00
pkgver=1.2.5
2021-02-10 11:24:47 +08:00
pkgrel=1
2017-12-09 02:14:13 +08:00
pkgdesc='Lightweight implementation of C standard library'
arch=('i686' 'x86_64')
url='https://musl.libc.org'
2017-12-09 02:14:13 +08:00
license=('MIT')
options=('staticlibs' '!buildflags' '!strip')
depends=('aarch64-linux-gnu-gcc')
2024-09-20 16:47:20 +08:00
source=(git+https://gitea.classfun.cn:4443/mirrors/musl.git)
sha512sums=('SKIP')
_target=aarch64-linux-gnu
2017-12-09 02:14:13 +08:00
_sysroot=/usr/$_target/lib/musl
2024-09-20 16:47:20 +08:00
pkgver() {
cd "$srcdir/musl"
git describe --tags --abbrev=0 | sed 's,^v,,'
2017-12-09 02:14:13 +08:00
}
2024-09-20 16:47:20 +08:00
prepare() {
cd "$srcdir/musl"
git checkout "$(git describe --tags --abbrev=0)"
}
2017-12-09 02:14:13 +08:00
2024-09-20 16:47:20 +08:00
build() {
cd "$srcdir/musl"
2024-09-20 16:55:35 +08:00
./configure \
2024-09-20 16:47:20 +08:00
--prefix=$_sysroot \
--exec-prefix=/usr \
--target=$_target \
--enable-wrapper=all
make
2017-12-09 02:14:13 +08:00
}
2024-09-20 16:47:20 +08:00
package() {
cd "$srcdir/musl"
make DESTDIR="$pkgdir" install
mv "$pkgdir"/lib/ld-musl*.so* "$pkgdir$_sysroot"/lib/
rmdir "$pkgdir"/lib
pushd "$pkgdir"/usr/bin
local _bin
for _bin in *; do
mv "$_bin" "${_target%-gnu}-$_bin"
done
popd
install -Dm0644 README "$pkgdir"/usr/share/doc/$pkgname/README
install -Dm0644 COPYRIGHT "$pkgdir"/usr/share/licenses/$pkgname/COPYRIGHT
}