2019-06-25 16:13:08 +02:00
|
|
|
{ lib, stdenv, pkgs
|
2018-09-15 18:16:13 +02:00
|
|
|
, haskell, nodejs
|
2019-06-09 16:25:00 +02:00
|
|
|
, fetchurl, fetchpatch, makeWrapper, writeScriptBin }:
|
2015-08-13 13:50:59 +02:00
|
|
|
let
|
2018-11-18 21:07:31 +01:00
|
|
|
fetchElmDeps = import ./fetchElmDeps.nix { inherit stdenv lib fetchurl; };
|
2019-06-09 16:25:00 +02:00
|
|
|
|
|
|
|
patchBinwrap = import ./packages/patch-binwrap.nix { inherit lib writeScriptBin stdenv; };
|
|
|
|
|
|
|
|
elmNodePackages =
|
|
|
|
import ./packages/node-composition.nix {
|
2019-06-25 16:13:08 +02:00
|
|
|
inherit nodejs pkgs;
|
2019-06-09 16:25:00 +02:00
|
|
|
inherit (stdenv.hostPlatform) system;
|
|
|
|
};
|
|
|
|
|
2019-03-16 10:24:20 +01:00
|
|
|
hsPkgs = haskell.packages.ghc864.override {
|
2018-08-25 12:52:48 +02:00
|
|
|
overrides = self: super: with haskell.lib;
|
2019-06-09 16:25:00 +02:00
|
|
|
let elmPkgs = rec {
|
2018-08-25 13:01:52 +02:00
|
|
|
elm = overrideCabal (self.callPackage ./packages/elm.nix { }) (drv: {
|
2018-08-25 12:52:48 +02:00
|
|
|
# sadly with parallelism most of the time breaks compilation
|
2019-06-09 16:25:00 +02:00
|
|
|
# also compilation is slower with increasing number of cores anyway (Tested on Ryzen 7 and i7)
|
2018-08-25 12:52:48 +02:00
|
|
|
enableParallelBuilding = false;
|
2019-01-03 17:31:00 +01:00
|
|
|
preConfigure = self.fetchElmDeps {
|
|
|
|
elmPackages = (import ./packages/elm-srcs.nix);
|
2018-11-18 21:07:31 +01:00
|
|
|
versionsDat = ./versions.dat;
|
|
|
|
};
|
2019-01-21 01:20:30 +01:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/elm/compiler/pull/1886/commits/39d86a735e28da514be185d4c3256142c37c2a8a.patch";
|
|
|
|
sha256 = "0nni5qx1523rjz1ja42z6z9pijxvi3fgbw1dhq5qi11mh1nb9ay7";
|
|
|
|
})
|
|
|
|
];
|
2018-08-25 13:01:52 +02:00
|
|
|
buildTools = drv.buildTools or [] ++ [ makeWrapper ];
|
2019-01-04 14:03:24 +01:00
|
|
|
jailbreak = true;
|
2018-08-25 13:01:52 +02:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/elm \
|
|
|
|
--prefix PATH ':' ${lib.makeBinPath [ nodejs ]}
|
|
|
|
'';
|
2018-08-25 12:52:48 +02:00
|
|
|
});
|
|
|
|
|
2016-05-29 23:34:23 +02:00
|
|
|
/*
|
2018-10-03 20:41:58 +02:00
|
|
|
The elm-format expression is updated via a script in the https://github.com/avh4/elm-format repo:
|
2019-06-09 16:25:00 +02:00
|
|
|
`package/nix/build.sh`
|
2016-05-29 23:34:23 +02:00
|
|
|
*/
|
2019-01-04 14:55:06 +01:00
|
|
|
elm-format = justStaticExecutables (doJailbreak (self.callPackage ./packages/elm-format.nix {}));
|
2019-01-04 14:03:24 +01:00
|
|
|
|
2019-06-09 16:25:00 +02:00
|
|
|
elmi-to-json = justStaticExecutables (self.callPackage ./packages/elmi-to-json.nix {});
|
|
|
|
|
2018-11-18 21:07:31 +01:00
|
|
|
inherit fetchElmDeps;
|
2019-01-04 14:03:24 +01:00
|
|
|
elmVersion = elmPkgs.elm.version;
|
2019-06-09 16:25:00 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
Node/NPM based dependecies can be upgraded using script
|
|
|
|
`packages/generate-node-packages.sh`.
|
|
|
|
Packages which rely on `bin-wrap` will fail by default
|
|
|
|
and can be patched using `patchBinwrap` function defined in `packages/patch-binwrap.nix`.
|
|
|
|
*/
|
|
|
|
elm-test = patchBinwrap [elmi-to-json] elmNodePackages.elm-test;
|
|
|
|
elm-verify-examples = patchBinwrap [elmi-to-json] elmNodePackages.elm-verify-examples;
|
|
|
|
elm-analyse = elmNodePackages."elm-analyse-0.16.3";
|
|
|
|
inherit (elmNodePackages) elm-doc-preview elm-upgrade;
|
2015-08-13 13:50:59 +02:00
|
|
|
};
|
|
|
|
in elmPkgs // {
|
|
|
|
inherit elmPkgs;
|
2018-08-25 12:52:48 +02:00
|
|
|
|
|
|
|
# Needed for elm-format
|
|
|
|
indents = self.callPackage ./packages/indents.nix {};
|
2015-08-13 13:50:59 +02:00
|
|
|
};
|
|
|
|
};
|
2018-08-21 23:51:59 +02:00
|
|
|
in hsPkgs.elmPkgs
|