2018-09-15 17:16:13 +01:00
|
|
|
{ lib, stdenv, buildEnv
|
|
|
|
, haskell, nodejs
|
|
|
|
, fetchurl, fetchpatch, makeWrapper, git }:
|
2015-08-13 12:50:59 +01:00
|
|
|
|
|
|
|
let
|
2018-11-18 20:07:31 +00:00
|
|
|
fetchElmDeps = import ./fetchElmDeps.nix { inherit stdenv lib fetchurl; };
|
2019-01-04 13:03:24 +00:00
|
|
|
hsPkgs = haskell.packages.ghc863.override {
|
2018-08-25 11:52:48 +01:00
|
|
|
overrides = self: super: with haskell.lib;
|
|
|
|
let elmPkgs = {
|
2018-08-25 12:01:52 +01:00
|
|
|
elm = overrideCabal (self.callPackage ./packages/elm.nix { }) (drv: {
|
2018-08-25 11:52:48 +01:00
|
|
|
# sadly with parallelism most of the time breaks compilation
|
|
|
|
enableParallelBuilding = false;
|
2019-01-03 16:31:00 +00:00
|
|
|
preConfigure = self.fetchElmDeps {
|
|
|
|
elmPackages = (import ./packages/elm-srcs.nix);
|
2018-11-18 20:07:31 +00:00
|
|
|
versionsDat = ./versions.dat;
|
|
|
|
};
|
2019-01-21 00:20:30 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/elm/compiler/pull/1886/commits/39d86a735e28da514be185d4c3256142c37c2a8a.patch";
|
|
|
|
sha256 = "0nni5qx1523rjz1ja42z6z9pijxvi3fgbw1dhq5qi11mh1nb9ay7";
|
|
|
|
})
|
|
|
|
];
|
2018-08-25 12:01:52 +01:00
|
|
|
buildTools = drv.buildTools or [] ++ [ makeWrapper ];
|
2019-01-04 13:03:24 +00:00
|
|
|
jailbreak = true;
|
2018-08-25 12:01:52 +01:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/elm \
|
|
|
|
--prefix PATH ':' ${lib.makeBinPath [ nodejs ]}
|
|
|
|
'';
|
2018-08-25 11:52:48 +01:00
|
|
|
});
|
|
|
|
|
2016-05-29 22:34:23 +01:00
|
|
|
/*
|
2018-10-03 19:41:58 +01:00
|
|
|
The elm-format expression is updated via a script in the https://github.com/avh4/elm-format repo:
|
|
|
|
`pacakge/nix/build.sh`
|
2016-05-29 22:34:23 +01:00
|
|
|
*/
|
2019-01-04 13:55:06 +00:00
|
|
|
elm-format = justStaticExecutables (doJailbreak (self.callPackage ./packages/elm-format.nix {}));
|
2019-01-04 13:03:24 +00:00
|
|
|
|
2018-11-18 20:07:31 +00:00
|
|
|
inherit fetchElmDeps;
|
2019-01-04 13:03:24 +00:00
|
|
|
elmVersion = elmPkgs.elm.version;
|
2015-08-13 12:50:59 +01:00
|
|
|
};
|
|
|
|
in elmPkgs // {
|
|
|
|
inherit elmPkgs;
|
2018-08-25 11:52:48 +01:00
|
|
|
|
|
|
|
# Needed for elm-format
|
|
|
|
indents = self.callPackage ./packages/indents.nix {};
|
2015-08-13 12:50:59 +01:00
|
|
|
};
|
|
|
|
};
|
2018-08-21 22:51:59 +01:00
|
|
|
in hsPkgs.elmPkgs
|