nixpkgs/pkgs/by-name/gr/gren/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

65 lines
1.3 KiB
Nix
Raw Permalink Normal View History

2024-09-26 15:48:23 +02:00
{
lib,
2025-07-25 21:56:20 +02:00
stdenv,
fetchFromGitHub,
makeBinaryWrapper,
nodejs,
git,
2024-09-26 15:48:23 +02:00
haskellPackages,
2025-07-25 21:56:20 +02:00
versionCheckHook,
2024-09-26 15:48:23 +02:00
}:
2025-07-25 21:56:20 +02:00
stdenv.mkDerivation (finalAttrs: {
pname = "gren";
2025-08-04 12:19:58 +02:00
version = "0.6.2";
2024-09-26 15:48:23 +02:00
2025-07-25 21:56:20 +02:00
src = fetchFromGitHub {
owner = "gren-lang";
repo = "compiler";
tag = finalAttrs.version;
2025-08-04 12:19:58 +02:00
hash = "sha256-fTSxQdcOe8VhRb1RhxBJjZ7ZZCMzMDOhEbXag1hjDrA=";
2025-07-25 21:56:20 +02:00
};
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
'';
2025-08-04 12:19:58 +02:00
doInstallCheck = true;
2025-07-25 21:56:20 +02:00
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgram = "${placeholder "out"}/bin/gren";
versionCheckProgramArg = "--version";
passthru = {
backend = haskellPackages.callPackage ./generated-backend-package.nix { };
updateScript = ./update.sh;
};
2024-09-26 15:48:23 +02:00
2025-07-25 21:56:20 +02:00
meta = {
2025-08-04 12:19:58 +02:00
description = "Programming language for simple and correct applications";
2025-07-25 21:56:20 +02:00
homepage = "https://gren-lang.org";
license = lib.licenses.bsd3;
mainProgram = "gren";
maintainers = with lib.maintainers; [
robinheghan
tomasajt
];
2024-09-26 15:48:23 +02:00
};
2025-07-25 21:56:20 +02:00
})