aboutsummaryrefslogtreecommitdiffstats
path: root/testing/zig/APKBUILD
blob: 12563410c3d1aa3d14da7dbe62ac1ac51eb3f449 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Contributor: Milan P. Stanić <mps@arvanta.net>
# Maintainer: Milan P. Stanić <mps@arvanta.net>
pkgname="zig"
pkgver="0.5.0"
pkgrel=0
pkgdesc="general-purpose programming language designed for robustness, optimality, and maintainability"
url="https://ziglang.org/"
arch="x86_64"
license="MIT"
options="!check" # works, but fail at the end, need to be fixed 
makedepends="cmake clang-dev clang-libs llvm9-libs llvm-dev lld-dev libstdc++
	zlib-static libxml2-dev llvm9-static clang-static lld-static"
subpackages="$pkgname-dev"
source="https://ziglang.org/download/$pkgver/zig-$pkgver.tar.xz
	fix-build.zig.patch"

builddir="$srcdir"/$pkgname-$pkgver

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DZIG_FORCE_EXTERNAL_LLD=ON \
		-DZIG_SKIP_INSTALL_LIB_FILES=ON \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		${CMAKE_CROSSOPTS} .
	make
}

check() {
	./zig build test
}

package() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DZIG_FORCE_EXTERNAL_LLD=ON \
		-DZIG_SKIP_INSTALL_LIB_FILES=OFF \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		${CMAKE_CROSSOPTS} .
	make DESTDIR="$pkgdir" install
}

sha512sums="1ce479077d2501c160bcac318b3d59e66921207855f56d900b9a59c44b14116639de10c5b578663b4963ccc8d49bb0d5aa75afb8987f5df1950037248561d1e2  zig-0.5.0.tar.xz
9972f52663c061df59363215e1624773d28a1a85c473250f0e16b78d59c6f9e8987267e55148609b0cbad5f722d365aad7554d7f547060c377edd91dd371ff82  fix-build.zig.patch"