2023-02-02 18:25:31 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, llvmPackages
|
|
|
|
, libxml2
|
|
|
|
, zlib
|
2023-08-10 07:59:29 +00:00
|
|
|
, coreutils
|
|
|
|
, callPackage
|
|
|
|
}@args:
|
2023-02-02 18:25:31 +00:00
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
import ./generic.nix args {
|
2023-02-02 18:25:31 +00:00
|
|
|
version = "0.10.1";
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
hash = "sha256-69QIkkKzApOGfrBdgtmxFMDytRkSh+0YiaJQPbXsBeo=";
|
2023-02-02 18:25:31 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
outputs = [ "out" "doc" ];
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
patches = [
|
|
|
|
# Backport alignment related panics from zig-master to 0.10.
|
|
|
|
# Upstream issue: https://github.com/ziglang/zig/issues/14559
|
|
|
|
./zig_14559.patch
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
# file RPATH_CHANGE could not write new RPATH
|
|
|
|
"-DCMAKE_SKIP_BUILD_RPATH=ON"
|
2023-02-22 10:55:15 +00:00
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
# always link against static build of LLVM
|
|
|
|
"-DZIG_STATIC_LLVM=ON"
|
|
|
|
|
2023-02-22 10:55:15 +00:00
|
|
|
# ensure determinism in the compiler build
|
2023-02-16 17:41:37 +00:00
|
|
|
"-DZIG_TARGET_MCPU=baseline"
|
2023-02-02 18:25:31 +00:00
|
|
|
];
|
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
postBuild = ''
|
2023-08-10 07:59:29 +00:00
|
|
|
./zig2 run ../doc/docgen.zig -- ./zig2 ../doc/langref.html.in langref.html
|
2023-03-08 16:32:21 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2023-08-10 07:59:29 +00:00
|
|
|
install -Dm644 -t $doc/share/doc/zig-$version/html ./langref.html
|
2023-03-08 16:32:21 +00:00
|
|
|
'';
|
2023-08-10 07:59:29 +00:00
|
|
|
}
|