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