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

35 lines
820 B
Nix
Raw Normal View History

2024-05-16 20:47:23 +00:00
{ stdenv, qbe, 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";
src = builtins.fetchGit {
2024-05-15 11:19:42 +00:00
url = "https://github.com/badboy/harelang-harec";
2024-05-14 19:02:43 +00:00
ref = "master";
2024-05-15 11:19:42 +00:00
rev = "873311b721dca691706909964cc108139ebee0de";
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
'';
})