Files
nixpkgs/pkgs/by-name/gr/gren/package.nix
2026-06-27 02:28:52 +00:00

61 lines
1.4 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
makeBinaryWrapper,
nodejs,
git,
haskellPackages,
versionCheckHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "gren";
version = "0.6.6";
src = fetchFromGitHub {
owner = "gren-lang";
repo = "compiler";
tag = finalAttrs.version;
hash = "sha256-GLqDBTNu7jTy+WTbPrK7d/AIjHKWTidsf19AP4WwEQo=";
};
buildInputs = [ nodejs ];
nativeBuildInputs = [ makeBinaryWrapper ];
installPhase = ''
runHook preInstall
# install the precompiled frontend into the proper location
install -Dm755 bin/compiler $out/bin/gren
wrapProgram $out/bin/gren \
--set-default GREN_BIN ${lib.getExe finalAttrs.passthru.backend} \
--suffix PATH : ${lib.makeBinPath [ git ]}
runHook postInstall
'';
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgram = "${placeholder "out"}/bin/gren";
passthru = {
backend = haskellPackages.callPackage ./generated-backend-package.nix { };
updateScript = ./update.sh;
};
meta = {
description = "Programming language for simple and correct applications";
homepage = "https://gren-lang.org";
license = lib.licenses.bsd3;
platforms = lib.intersectLists haskellPackages.ghc.meta.platforms nodejs.meta.platforms;
mainProgram = "gren";
maintainers = with lib.maintainers; [
robinheghan
tomasajt
];
};
})