Package Details: zig-git 0.9.0.r3880.ge2bb92b2e-1

Git Clone URL: https://aur.archlinux.org/zig-git.git (read-only, click to copy)
Package Base: zig-git
Description: a programming language prioritizing robustness, optimality, and clarity
Upstream URL: https://ziglang.org
Licenses: MIT
Conflicts: zig
Provides: zig
Submitter: PedroHLC
Maintainer: leopoldek
Last Packager: leopoldek
Votes: 10
Popularity: 0.31
First Submitted: 2016-08-09 17:43 (UTC)
Last Updated: 2022-09-23 02:26 (UTC)

Required by (51)

Sources (1)

Pinned Comments

edtoml commented on 2022-09-23 20:24 (UTC)

The package build has been updated to build the last version of zig that builds with llvm 14. If you want to build master, in addition to changes I posted below, you now need to remove the #commit=e2bb92b2e27dc54852a0227345e294ae383358fd from the source.

source=("git+https://github.com/ziglang/zig.git#commit=e2bb92b2e27dc54852a0227345e294ae383358fd")

Latest Comments

1 2 3 4 5 Next › Last »

edtoml commented on 2022-10-23 00:37 (UTC)

The Zig devs fixed a problem where stage3 was being built twice... This means that we need to add 'cmake --install build' after 'cmake --build build'.

edtoml commented on 2022-10-18 18:11 (UTC) (edited on 2022-10-18 18:16 (UTC) by edtoml)

With llvm 15.0.3 "-DLLVM_USE_STATIC_ZSTD=ON" is no longer required when building llvm. When building zig, the PKGBUILD needs to be updated, removing the "#commit=e2...fd" and adding "-DCMAKE_PREFIX_PATH=$HOME/local/llvm15 \" to the cmake command.

edtoml commented on 2022-10-13 16:29 (UTC) (edited on 2022-10-13 16:30 (UTC) by edtoml)

An update as to what to do to build with a local copy of llvm15.
- As of zig 0.10.0-dev.4333+f5f28e0d2 the patch from 12888 is no longer required.
- The commit still needs to be removed from the PKGBUILD.
- With llvm 15.0.2 you need to add -DLLVM_USE_STATIC_ZSTD=ON to the llvm make command shown below.

edtoml commented on 2022-09-23 20:24 (UTC)

The package build has been updated to build the last version of zig that builds with llvm 14. If you want to build master, in addition to changes I posted below, you now need to remove the #commit=e2bb92b2e27dc54852a0227345e294ae383358fd from the source.

source=("git+https://github.com/ziglang/zig.git#commit=e2bb92b2e27dc54852a0227345e294ae383358fd")

edtoml commented on 2022-09-18 12:30 (UTC) (edited on 2022-09-18 12:30 (UTC) by edtoml)

Zig updated to llvm15. Looks like Arch is taking time to integrate llvm15. I my opinion creating a local copy of llvm is the way to go. This is what I use:

cd ~/llvm
git clone --depth 1 --branch release/15.x https://github.com/llvm/llvm-project llvm-project-15
cd llvm-project-15
git checkout release/15.x
mkdir build
cd build
make ../llvm -DCMAKE_INSTALL_PREFIX=$HOME/local/llvm15 -DCMAKE_PREFIX_PATH=$HOME/local/llvm15 -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="lld;clang" -DLLVM_ENABLE_LIBXML2=OFF -DLLVM_ENABLE_TERMINFO=OFF  -DLL
VM_ENABLE_LIBEDIT=OFF  -DLLVM_ENABLE_ASSERTIONS=ON  -G Ninja  -DLLVM_PARALLEL_LINK_JOBS=1 -DLLVM_ENABLE_BINDINGS=OFF
ninja install

Read zig issue 12888: https://github.com/ziglang/zig/issues/12888 and manually update the PKGBUILD as per the issue. I use:

PATH=$HOME/local/llvm15:$PATH yay -S --editmenu zig-git

misilelaboratory commented on 2022-09-15 08:54 (UTC) (edited on 2022-09-15 08:54 (UTC) by misilelaboratory)

I can't build it, because zig need llvm 15 (not 14)

leopoldek commented on 2022-09-02 22:39 (UTC) (edited on 2022-09-02 23:14 (UTC) by leopoldek)

@edtoml Updated. It should work now.

edtoml commented on 2022-09-01 21:05 (UTC) (edited on 2022-09-02 01:13 (UTC) by edtoml)

With the latest changes to the Zig build process the PKGBUILD no longer works. Problem is that the "cmake --build build" attempts to write directly to /usr/lib. The last part of the build uses zig (stage2) and wants to use -DCMAKE_INSTALL_PREFIX=/usr as written when building stage3. This is the second version of this PKGBUILD.

https://zigbin.io/bdc712

build() {
    cmake -B build -S zig \
        -DCMAKE_BUILD_TYPE=None \
        -DCMAKE_INSTALL_PREFIX=../stage3 \
        -DZIG_PREFER_CLANG_CPP_DYLIB=ON \
        -DZIG_STATIC_ZLIB=on
    cmake --build build
}

check() {
    # omit full compiler test since it takes ages
    ../stage3/bin/zig version
}

package() {
    mv ../stage3 "$pkgdir/usr"
    install -Dm644 zig/LICENSE "$pkgdir/usr/share/licenses/$provides/LICENSE"
}

Your mileage may vary

krismolendyke commented on 2022-07-12 21:03 (UTC)

This builds w/ LLVM 14 for me now but I had to add -DZIG_STATIC_ZLIB=on as mentioned here https://github.com/ziglang/zig/issues/12069#issuecomment-1179757906

tiehuis commented on 2022-07-07 01:22 (UTC) (edited on 2022-07-07 01:23 (UTC) by tiehuis)

Diff for the below from kuon. I do not have push permissions here anymore so cannot update.

diff --git a/.SRCINFO b/.SRCINFO
index c38f9af..f3a7998 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,16 +1,16 @@
 pkgbase = zig-git
    pkgdesc = a programming language prioritizing robustness, optimality, and clarity
    pkgver = 0.9.0
-   pkgrel = 1
+   pkgrel = 2
    url = https://ziglang.org
    arch = i686
    arch = x86_64
    license = MIT
    makedepends = cmake
    makedepends = git
-   depends = clang
-   depends = llvm>=13
-   depends = lld
+   depends = clang13
+   depends = llvm13
+   depends = lld13
    provides = zig
    conflicts = zig
    source = git+https://github.com/ziglang/zig.git
diff --git a/PKGBUILD b/PKGBUILD
index 2d6a016..8f40a5a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,12 +2,12 @@

 pkgname=zig-git
 pkgver=0.9.0
-pkgrel=1
+pkgrel=2
 pkgdesc="a programming language prioritizing robustness, optimality, and clarity"
 arch=('i686' 'x86_64')
 url='https://ziglang.org'
 license=('MIT')
-depends=('clang' 'llvm>=13' 'lld')
+depends=('clang13' 'llvm13' 'lld13')
 makedepends=('cmake' 'git')
 provides=(zig)
 conflicts=(zig)
@@ -22,7 +22,11 @@ build() {
     cmake -B build -S zig \
     -DCMAKE_BUILD_TYPE=None \
     -DCMAKE_INSTALL_PREFIX=/usr \
-        -DZIG_PREFER_CLANG_CPP_DYLIB=ON
+        -DZIG_PREFER_CLANG_CPP_DYLIB=ON \
+        -DLLVM_CONFIG_EXE=/usr/lib/llvm13/bin/llvm-config \
+        -DCMAKE_C_FLAGS="-I/usr/lib/llvm13/include/" \
+        -DCMAKE_CXX_FLAGS="-I/usr/lib/llvm13/include/" \
+        -DCMAKE_EXE_LINKER_FLAGS="-L/usr/lib/llvm13/lib/"
     cmake --build build
 }