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

35 lines
814 B
Nix
Raw Normal View History

{ stdenv, qbe, hareAs, hareCc, hareLd }:
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}"
"CC=${hareCc}/bin/hare-cc"
"AS=${hareAs}/bin/hare-as"
"LD=${hareLd}/bin/hare-ld"
2024-05-14 19:02:43 +00:00
];
postConfigure = ''
ln -s configs/darwin.mk config.mk
'';
})