2021-06-28 23:13:55 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
|
|
|
, bison
|
|
|
|
, binutils
|
|
|
|
, makeWrapper
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "myrddin";
|
|
|
|
version = "0.3.1";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = "mc";
|
|
|
|
owner = "oridb";
|
|
|
|
rev = "r${version}";
|
|
|
|
sha256 = "7ImjiG/rIKGPHq3Vh/mftY7pqw/vfOxD3LJeT87HmCk=";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
bison
|
|
|
|
pkg-config
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace mk/c.mk \
|
2022-10-21 18:38:19 +00:00
|
|
|
--replace "-Werror" ""
|
2021-06-28 23:13:55 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
2022-10-21 18:38:19 +00:00
|
|
|
make bootstrap -j$NIX_BUILD_CORES
|
|
|
|
make -j$NIX_BUILD_CORES
|
2021-06-28 23:13:55 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
for b in $out/bin/*; do
|
2022-10-21 18:38:19 +00:00
|
|
|
wrapProgram $b --prefix PATH : $out/bin:${lib.makeBinPath [ binutils ]}
|
2021-06-28 23:13:55 +00:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
make check
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Systems language that is both powerful and fun to use";
|
|
|
|
homepage = "https://myrlang.org/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ luc65r ];
|
|
|
|
platforms = platforms.all;
|
2022-10-21 18:38:19 +00:00
|
|
|
# darwin: never built on Hydra https://hydra.nixos.org/job/nixpkgs/trunk/myrddin.x86_64-darwin
|
|
|
|
broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin;
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
}
|