summaryrefslogtreecommitdiff
path: root/repo/zig
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-09-10 23:00:02 +0100
committerdavidovski <david@davidovski.xyz>2022-09-10 23:00:02 +0100
commit24998e21676efbd0801bb9a56d167eaf273d44d7 (patch)
treebd5c13247a9e3d25211f41f358718f2d7447a60c /repo/zig
parentc38dfe6188112ca490090966a63faefe5ec7e9a0 (diff)
Added cmatrix and updated a few
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
+}
+