summaryrefslogtreecommitdiff
path: root/repo/zig
diff options
context:
space:
mode:
Diffstat (limited to 'repo/zig')
-rw-r--r--repo/zig/llvm-include.patch12
-rw-r--r--repo/zig/zig.xibuild52
2 files changed, 64 insertions, 0 deletions
diff --git a/repo/zig/llvm-include.patch b/repo/zig/llvm-include.patch
new file mode 100644
index 0000000..7cefa89
--- /dev/null
+++ b/repo/zig/llvm-include.patch
@@ -0,0 +1,12 @@
+Our llvm include path is not in the include list tried by default.
+
+--- zig-0.9.1.orig/cmake/Findllvm.cmake
++++ zig-0.9.1/cmake/Findllvm.cmake
+@@ -12,6 +12,7 @@
+ /usr/lib/llvm/13/include
+ /usr/lib/llvm-13/include
+ /usr/lib/llvm-13.0/include
++ /usr/lib/llvm13/include
+ /usr/local/llvm13/include
+ /usr/local/llvm130/include
+ /usr/local/opt/llvm@13/include
diff --git a/repo/zig/zig.xibuild b/repo/zig/zig.xibuild
new file mode 100644
index 0000000..59146b1
--- /dev/null
+++ b/repo/zig/zig.xibuild
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+NAME="zig"
+DESC="general-purpose programming language designed for robustness, optimality, and maintainability"
+
+MAKEDEPS=" cmake clang llvm lld libstdc++ zlib libxml2"
+
+PKG_VER=0.9.1
+SOURCE="https://github.com/ziglang/zig/archive/$PKG_VER.tar.gz"
+
+ADDITIONAL="
+llvm-include.patch
+"
+
+prepare () {
+ apply_patches
+}
+
+build() {
+ mkdir -p build
+ cd build
+ cmake \
+ -DCMAKE_BUILD_TYPE=None \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
+ -DCMAKE_C_FLAGS="$CFLAGS" \
+ -DZIG_VERSION="$PKG_VER" \
+ ..
+ make
+}
+
+#check() {
+# ./zig build test \
+# -Dskip-release \
+# -Dskip-release-small \
+# -Dskip-release-fast \
+# -Dskip-non-native \
+# -Dskip-libc
+#}
+
+package() {
+ cd ..
+ make -C build DESTDIR="$PKG_DEST" install
+
+ # Documentation is generated as part of `./zig build test` in check().
+ # If this is no longer the case at some point it can be
+ # generated explicitly using `./zig build docs`.
+ ### it is not built now ###
+ #install -Dm644 zig-cache/langref.html \
+ # "$PKG_DEST"/usr/share/doc/zig/langref.html
+}
+