2019-06-25 15:13:08 +01:00
|
|
|
{ lib, stdenv, pkgs
|
2018-09-15 17:16:13 +01:00
|
|
|
, haskell, nodejs
|
2019-06-09 15:25:00 +01:00
|
|
|
, fetchurl, fetchpatch, makeWrapper, writeScriptBin }:
|
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-06-09 15:25:00 +01:00
|
|
|
|
2019-10-21 15:31:02 +01:00
|
|
|
hsPkgs = haskell.packages.ghc881.override {
|
2018-08-25 11:52:48 +01:00
|
|
|
overrides = self: super: with haskell.lib;
|
2019-06-09 15:25:00 +01:00
|
|
|
let elmPkgs = rec {
|
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);
|
2019-10-21 15:31:02 +01:00
|
|
|
elmVersion = drv.version;
|
|
|
|
registryDat = ./registry.dat;
|
2018-11-18 20:07:31 +00:00
|
|
|
};
|
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:
|
2019-06-09 15:25:00 +01:00
|
|
|
`package/nix/build.sh`
|
2016-05-29 22:34:23 +01:00
|
|
|
*/
|
2019-10-21 15:31:02 +01:00
|
|
|
#elm-format = justStaticExecutables (doJailbreak (self.callPackage ./packages/elm-format.nix {}));
|
|
|
|
elmi-to-json = justStaticExecutables (overrideCabal (self.callPackage ./packages/elmi-to-json.nix {}) (drv: {
|
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace package.yaml --replace "- -Werror" ""
|
|
|
|
hpack
|
|
|
|
'';
|
|
|
|
jailbreak = true;
|
|
|
|
}));
|
2019-06-09 15:25:00 +01: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
|
|
|
};
|
|
|
|
};
|
2019-09-29 11:57:55 +01: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`.
|
|
|
|
*/
|
|
|
|
elmNodePackages =
|
|
|
|
let
|
|
|
|
nodePkgs = import ./packages/node-composition.nix {
|
|
|
|
inherit nodejs pkgs;
|
|
|
|
inherit (stdenv.hostPlatform) system;
|
|
|
|
};
|
|
|
|
in with hsPkgs.elmPkgs; {
|
|
|
|
elm-test = patchBinwrap [elmi-to-json] nodePkgs.elm-test;
|
|
|
|
elm-verify-examples = patchBinwrap [elmi-to-json] nodePkgs.elm-verify-examples;
|
|
|
|
elm-language-server = nodePkgs."@elm-tooling/elm-language-server";
|
|
|
|
|
|
|
|
# elm-analyse@0.16.4 build is not working
|
|
|
|
elm-analyse = nodePkgs."elm-analyse-0.16.3";
|
|
|
|
inherit (nodePkgs) elm-doc-preview elm-live elm-upgrade elm-xref;
|
|
|
|
};
|
|
|
|
|
|
|
|
patchBinwrap = import ./packages/patch-binwrap.nix { inherit lib writeScriptBin stdenv; };
|
|
|
|
|
|
|
|
in hsPkgs.elmPkgs // elmNodePackages // {
|
|
|
|
lib = { inherit patchBinwrap; };
|
|
|
|
}
|