1
Fork 0
hare-nix/pkgs/darwin/harec.nix

31 lines
689 B
Nix
Raw Normal View History

2024-06-01 22:06:43 +00:00
{ stdenv, qbe, harec-src, hare-as, hare-cc, hare-ld }:
2024-05-14 19:02:43 +00:00
let
arch = stdenv.hostPlatform.uname.processor;
qbePlatform = {
2024-05-14 19:06:04 +00:00
x86_64 = "amd64_apple";
aarch64 = "arm64_apple";
2024-05-14 19:02:43 +00:00
}.${arch};
in
stdenv.mkDerivation (finalAttrs: {
pname = "harec";
version = "0.24";
2024-06-01 22:06:43 +00:00
src = harec-src;
2024-05-14 19:02:43 +00:00
buildInputs = [ qbe ];
nativeBuildInputs = [ qbe ];
doCheck = true;
2024-05-14 19:02:43 +00:00
makeFlags = [
"PREFIX=${builtins.placeholder "out"}"
"ARCH=${arch}"
"VERSION=${finalAttrs.version}-nixpkgs"
"QBEFLAGS=-t${qbePlatform}"
2024-05-16 20:47:23 +00:00
"CC=${hare-cc}/bin/hare-cc"
"AS=${hare-as}/bin/hare-as"
"LD=${hare-ld}/bin/hare-ld"
2024-05-14 19:02:43 +00:00
];
postConfigure = ''
ln -s configs/darwin.mk config.mk
'';
})