nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 makeBinaryWrapper,
6 nodejs,
7 git,
8 haskellPackages,
9 versionCheckHook,
10}:
11
12stdenv.mkDerivation (finalAttrs: {
13 pname = "gren";
14 version = "0.6.3";
15
16 src = fetchFromGitHub {
17 owner = "gren-lang";
18 repo = "compiler";
19 tag = finalAttrs.version;
20 hash = "sha256-P8Y6JOgxGAVWT9DfbNLHVJnsPBcrUkHEumkU56riI10=";
21 };
22
23 buildInputs = [ nodejs ];
24
25 nativeBuildInputs = [ makeBinaryWrapper ];
26
27 installPhase = ''
28 runHook preInstall
29
30 # install the precompiled frontend into the proper location
31 install -Dm755 bin/compiler $out/bin/gren
32
33 wrapProgram $out/bin/gren \
34 --set-default GREN_BIN ${lib.getExe finalAttrs.passthru.backend} \
35 --suffix PATH : ${lib.makeBinPath [ git ]}
36
37 runHook postInstall
38 '';
39
40 doInstallCheck = true;
41 nativeInstallCheckInputs = [ versionCheckHook ];
42 versionCheckProgram = "${placeholder "out"}/bin/gren";
43
44 passthru = {
45 backend = haskellPackages.callPackage ./generated-backend-package.nix { };
46 updateScript = ./update.sh;
47 };
48
49 meta = {
50 description = "Programming language for simple and correct applications";
51 homepage = "https://gren-lang.org";
52 license = lib.licenses.bsd3;
53 platforms = lib.intersectLists haskellPackages.ghc.meta.platforms nodejs.meta.platforms;
54 mainProgram = "gren";
55 maintainers = with lib.maintainers; [
56 robinheghan
57 tomasajt
58 ];
59 };
60})