2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
2022-07-18 16:21:45 +00:00
|
|
|
, stdenv
|
2021-05-20 23:08:51 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, llvmPackages
|
|
|
|
, libxml2
|
|
|
|
, zlib
|
2023-08-10 07:59:29 +00:00
|
|
|
, coreutils
|
|
|
|
, callPackage
|
|
|
|
}@args:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
import ./generic.nix args {
|
2022-02-20 05:27:41 +00:00
|
|
|
version = "0.9.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
hash = "sha256-x2c4c9RSrNWGqEngio4ArW7dJjW0gg+8nqBwPcR721k=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
patches = [
|
|
|
|
# Fix index out of bounds reading RPATH (cherry-picked from 0.10-dev)
|
|
|
|
./rpath.patch
|
|
|
|
# Fix build on macOS 13 (cherry-picked from 0.10-dev)
|
|
|
|
./ventura.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
# TODO: remove on next upgrade
|
2023-08-10 07:59:29 +00:00
|
|
|
prePatch =
|
|
|
|
let
|
|
|
|
zig_0_10_0 = fetchFromGitHub {
|
|
|
|
owner = "ziglang";
|
|
|
|
repo = "zig";
|
|
|
|
rev = "0.10.0";
|
|
|
|
hash = "sha256-DNs937N7PLQimuM2anya4npYXcj6cyH+dRS7AiOX7tw=";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
''
|
|
|
|
cp -R ${zig_0_10_0}/lib/libc/include/any-macos.13-any lib/libc/include/any-macos.13-any
|
|
|
|
cp -R ${zig_0_10_0}/lib/libc/include/aarch64-macos.13-none lib/libc/include/aarch64-macos.13-gnu
|
|
|
|
cp -R ${zig_0_10_0}/lib/libc/include/x86_64-macos.13-none lib/libc/include/x86_64-macos.13-gnu
|
|
|
|
cp ${zig_0_10_0}/lib/libc/darwin/libSystem.13.tbd lib/libc/darwin/
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
# file RPATH_CHANGE could not write new RPATH
|
|
|
|
"-DCMAKE_SKIP_BUILD_RPATH=ON"
|
2023-02-22 10:55:15 +00:00
|
|
|
|
|
|
|
# ensure determinism in the compiler build
|
|
|
|
"-DZIG_TARGET_MCPU=baseline"
|
2022-08-12 12:06:08 +00:00
|
|
|
];
|
2023-08-10 07:59:29 +00:00
|
|
|
}
|