From d9c13cf44ec1b6de95cb1ba83c296611d19a71ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=83=D1=85=D0=B0=D1=80=D0=B8=D0=BA?= <65870+suhr@users.noreply.github.com> Date: Tue, 21 Dec 2021 10:29:18 +0300 Subject: [PATCH] zig: 0.8.1 -> 0.9.0 --- pkgs/development/compilers/zig/0.8.1.nix | 57 ++++++++++++++++++++++ pkgs/development/compilers/zig/default.nix | 5 +- pkgs/top-level/all-packages.nix | 11 ++++- 3 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 pkgs/development/compilers/zig/0.8.1.nix diff --git a/pkgs/development/compilers/zig/0.8.1.nix b/pkgs/development/compilers/zig/0.8.1.nix new file mode 100644 index 0000000000000..385b68a79291b --- /dev/null +++ b/pkgs/development/compilers/zig/0.8.1.nix @@ -0,0 +1,57 @@ +{ lib +, fetchFromGitHub +, cmake +, llvmPackages +, libxml2 +, zlib +}: + +let + inherit (llvmPackages) stdenv; +in +stdenv.mkDerivation rec { + pname = "zig"; + version = "0.8.1"; + + src = fetchFromGitHub { + owner = "ziglang"; + repo = pname; + rev = version; + hash = "sha256-zMSOH8ZWcvzHRwOgGIbLO9Q6jf1P5QL5KCMD+frp+JA="; + }; + + nativeBuildInputs = [ + cmake + llvmPackages.llvm.dev + ]; + buildInputs = [ + libxml2 + zlib + ] ++ (with llvmPackages; [ + libclang + lld + llvm + ]); + + preBuild = '' + export HOME=$TMPDIR; + ''; + + doCheck = true; + checkPhase = '' + runHook preCheck + ./zig test --cache-dir "$TMPDIR" -I $src/test $src/test/behavior.zig + runHook postCheck + ''; + + meta = with lib; { + homepage = "https://ziglang.org/"; + description = + "General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software"; + license = licenses.mit; + maintainers = with maintainers; [ andrewrk AndersonTorres ]; + platforms = platforms.unix; + broken = stdenv.isDarwin; # See https://github.com/NixOS/nixpkgs/issues/86299 + }; +} + diff --git a/pkgs/development/compilers/zig/default.nix b/pkgs/development/compilers/zig/default.nix index 385b68a79291b..d4eb57815a80c 100644 --- a/pkgs/development/compilers/zig/default.nix +++ b/pkgs/development/compilers/zig/default.nix @@ -11,13 +11,13 @@ let in stdenv.mkDerivation rec { pname = "zig"; - version = "0.8.1"; + version = "0.9.0"; src = fetchFromGitHub { owner = "ziglang"; repo = pname; rev = version; - hash = "sha256-zMSOH8ZWcvzHRwOgGIbLO9Q6jf1P5QL5KCMD+frp+JA="; + hash = "sha256-Hfl1KKtGcopMrn+U9r0/qr/wReWJIgb8+IgwMoguv/0="; }; nativeBuildInputs = [ @@ -54,4 +54,3 @@ stdenv.mkDerivation rec { broken = stdenv.isDarwin; # See https://github.com/NixOS/nixpkgs/issues/86299 }; } - diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8fbd4d3b725b1..f4d2b345f58af 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3596,7 +3596,9 @@ with pkgs; reg = callPackage ../tools/virtualization/reg { }; - river = callPackage ../applications/window-managers/river { }; + river = callPackage ../applications/window-managers/river { + zig = zig_0_8_1; + }; rmapi = callPackage ../applications/misc/remarkable/rmapi { }; @@ -15665,7 +15667,9 @@ with pkgs; ytt = callPackage ../development/tools/ytt {}; - zls = callPackage ../development/tools/zls { }; + zls = callPackage ../development/tools/zls { + zig = zig_0_8_1; + }; zydis = callPackage ../development/libraries/zydis { }; @@ -20442,6 +20446,9 @@ with pkgs; libzra = callPackage ../development/libraries/libzra { }; zig = callPackage ../development/compilers/zig { + llvmPackages = llvmPackages_13; + }; + zig_0_8_1 = callPackage ../development/compilers/zig/0.8.1.nix { llvmPackages = llvmPackages_12; };