iglunix/pkgs/zig/build.sh

41 lines
857 B
Bash
Raw Normal View History

2021-02-03 13:03:52 +00:00
pkgname=zig
pkgver=master
2021-02-03 13:03:52 +00:00
fetch() {
curl -L "https://github.com/ziglang/zig/archive/refs/heads/master.tar.gz" -o $pkgname-$pkgver.tar.gz
tar -xf $pkgname-$pkgver.tar.gz
2021-02-03 13:03:52 +00:00
mkdir $pkgname-$pkgver/build
cp ../llvm-req-arch.patch .
cd $pkgname-$pkgver
patch -p1 < ../llvm-req-arch.patch
2021-02-03 13:03:52 +00:00
}
build() {
cd $pkgname-$pkgver
cd build
cmake -G Ninja ../ \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib
samu
}
package() {
cd $pkgname-$pkgver
cd build
DESTDIR=$pkgdir samu install
rm -rf $pkgdir/usr/lib/zig/libc/glibc
rm -rf $pkgdir/usr/lib/zig/libc/mingw
rm -rf $pkgdir/usr/lib/zig/libc/wasi
rm -rf $pkgdir/usr/lib/zig/libc/include/*gnu*
rm -rf $pkgdir/usr/lib/zig/libc/include/*glibc*
rm -rf $pkgdir/usr/lib/zig/libc/include/*windows*
2021-02-03 13:03:52 +00:00
}
license() {
cd $pkgname-$pkgver
cat LICENSE
# cat COPYING
}