summaryrefslogtreecommitdiff
path: root/PKGBUILD
blob: 11cb0206d9df67c1842391b1c5380c17cd9fcdec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Maintainer: aqua <aqua@iserlohn-fortress.net>
# Maintainer: (AUR) Marc Tiehuis <marctiehuis at gmail.com>

pkgname=zig-git
pkgver=0.9.0.r844.g4ac37eb48
pkgrel=1
pkgdesc="a programming language prioritizing robustness, optimality, and clarity"
arch=('i686' 'x86_64')
url='https://ziglang.org'
license=('MIT')
depends=('clang' 'llvm>=10' 'lld')
makedepends=('cmake' 'git')
provides=(zig)
conflicts=(zig)
source=("git+https://github.com/zig-lang/zig.git")
md5sums=('SKIP')

pkgver() {
    mkdir -p build
    cd build
    cmake ../zig -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_PREFIX=/usr -DZIG_PREFER_CLANG_CPP_DYLIB=ON > /dev/null

    grep ZIG_VERSION_STRING config.h | sed 's/#define\ ZIG_VERSION_STRING\ //;s/-dev\./.r/;s/+/.g/;s/\"//g'
}

build() {
    cd build
    make DESTDIR=.
}

check() {
    cd zig
    ../build/zig build test
}

package() {
    install -Dm644 zig/LICENSE "$pkgdir/usr/share/licenses/$provides/LICENSE"
    make -C build DESTDIR="$pkgdir" install
}