about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/elm/packages/node/elm-pages/default.nix
blob: 5502e26b415ddb8a158063c805858245b36f8fd7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{ nodePkgs, pkgs, lib, makeWrapper }:

nodePkgs."elm-pages".overrideAttrs (
  old: {
    nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ makeWrapper old.nodejs.pkgs.node-gyp-build ];

    # can't use `patches = [ <patch_file> ]` with a nodePkgs derivation;
    # need to patch in one of the build phases instead.
    # see upstream issue https://github.com/dillonkearns/elm-pages/issues/305 for dealing with the read-only problem
    preFixup = ''
      patch $out/lib/node_modules/elm-pages/generator/src/codegen.js ${./fix-read-only.patch}
      patch $out/lib/node_modules/elm-pages/generator/src/init.js ${./fix-init-read-only.patch}
    '';

    postFixup = ''
      wrapProgram $out/bin/elm-pages --prefix PATH : ${
        with pkgs.elmPackages; lib.makeBinPath [ elm elm-review elm-optimize-level-2 ]
      }
    '';

    meta = with lib; nodePkgs."elm-pages".meta // {
      description = "A statically typed site generator for Elm.";
      homepage = "https://github.com/dillonkearns/elm-pages";
      license = licenses.bsd3;
      maintainers = [ maintainers.turbomack maintainers.jali-clarke ];
    };
  }
)