[arch-commits] Commit in (zig zig/repos zig/trunk zig/trunk/PKGBUILD)

Daurnimator daurnimator at archlinux.org
Tue Apr 9 10:27:45 UTC 2019


    Date: Tuesday, April 9, 2019 @ 10:27:44
  Author: daurnimator
Revision: 450581

Add zig

Added:
  zig/
  zig/repos/
  zig/trunk/
  zig/trunk/PKGBUILD

----------+
 PKGBUILD |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

Added: zig/trunk/PKGBUILD
===================================================================
--- zig/trunk/PKGBUILD	                        (rev 0)
+++ zig/trunk/PKGBUILD	2019-04-09 10:27:44 UTC (rev 450581)
@@ -0,0 +1,59 @@
+# Maintainer: Daurnimator <daurnimator at archlinux.org>
+# Contributor: Marc Tiehuis <marctiehuis at gmail.com>
+
+pkgname=zig
+pkgver=0.4.0
+pkgrel=1
+pkgdesc='a programming language prioritizing robustness, optimality, and maintainability'
+arch=('x86_64')
+url='https://ziglang.org/'
+license=('MIT')
+depends=('clang' 'llvm-libs' 'lld')
+makedepends=('cmake' 'llvm')
+source=("https://ziglang.org/download/$pkgver/zig-$pkgver.tar.xz"
+        'force_dynamic_llvm.patch'
+        'no_stage2_artifacts.patch')
+sha256sums=('fec1f3f6b359a3d942e0a7f9157b3b30cde83927627a0e1ea95c54de3c526cfc'
+            '986ffeb8f53c4b1651dcf8d252e5a5ffe85243b2dccc211c4ca972522eabd015'
+            '487546991703485d688413546ad36f334019c51c5a4a20f7ab750a521cb03f9b')
+
+prepare() {
+    cd "$pkgname-$pkgver"
+    patch -Np1 -i "../force_dynamic_llvm.patch"
+    patch -Np1 -i "../no_stage2_artifacts.patch"
+}
+
+build() {
+    cd "$pkgname-$pkgver"
+    mkdir -p build
+    cd build
+    # The zig CMakeLists uses build type Debug if not set
+    # override it back to None so makepkg env vars are respected
+    # Zig vendors LLD as a workaround for an upstream bug when targetting OSX
+    # - https://github.com/ziglang/zig/issues/662
+    # - https://bugs.llvm.org/show_bug.cgi?id=32254
+    # - http://lists.llvm.org/pipermail/llvm-dev/2017-August/116904.html
+    cmake \
+        -DCMAKE_BUILD_TYPE=None \
+        -DCMAKE_INSTALL_PREFIX=/usr \
+        -DZIG_FORCE_EXTERNAL_LLD=ON \
+        ..
+    make
+}
+
+check() {
+    cd "$pkgname-$pkgver/build"
+
+    # test suite requires zig to be installed first
+    # https://github.com/ziglang/zig/issues/2221
+
+    # For now, just check the version subcommand works
+    ./zig version
+}
+
+package() {
+    cd "$pkgname-$pkgver"
+    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+
+    make -C build DESTDIR="$pkgdir" install
+}


More information about the arch-commits mailing list