2019-06-25 14:13:08 +00:00
|
|
|
{ lib, stdenv, pkgs
|
2018-09-15 16:16:13 +00:00
|
|
|
, haskell, nodejs
|
2019-06-09 14:25:00 +00:00
|
|
|
, fetchurl, fetchpatch, makeWrapper, writeScriptBin }:
|
2015-08-13 11:50:59 +00:00
|
|
|
let
|
2018-11-18 20:07:31 +00:00
|
|
|
fetchElmDeps = import ./fetchElmDeps.nix { inherit stdenv lib fetchurl; };
|
2019-06-09 14:25:00 +00:00
|
|
|
|
2019-10-21 14:31:02 +00:00
|
|
|
hsPkgs = haskell.packages.ghc881.override {
|
2018-08-25 10:52:48 +00:00
|
|
|
overrides = self: super: with haskell.lib;
|
2019-06-09 14:25:00 +00:00
|
|
|
let elmPkgs = rec {
|
2018-08-25 11:01:52 +00:00
|
|
|
elm = overrideCabal (self.callPackage ./packages/elm.nix { }) (drv: {
|
2018-08-25 10:52:48 +00: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 14:31:02 +00:00
|
|
|
elmVersion = drv.version;
|
|
|
|
registryDat = ./registry.dat;
|
2018-11-18 20:07:31 +00:00
|
|
|
};
|
2018-08-25 11:01:52 +00:00
|
|
|
buildTools = drv.buildTools or [] ++ [ makeWrapper ];
|
2019-01-04 13:03:24 +00:00
|
|
|
jailbreak = true;
|
2018-08-25 11:01:52 +00:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/elm \
|
|
|
|
--prefix PATH ':' ${lib.makeBinPath [ nodejs ]}
|
|
|
|
'';
|
2018-08-25 10:52:48 +00:00
|
|
|
});
|
|
|
|
|
2016-05-29 21:34:23 +00:00
|
|
|
/*
|
2018-10-03 18:41:58 +00:00
|
|
|
The elm-format expression is updated via a script in the https://github.com/avh4/elm-format repo:
|
2019-06-09 14:25:00 +00:00
|
|
|
`package/nix/build.sh`
|
2016-05-29 21:34:23 +00:00
|
|
|
*/
|
2019-10-21 20:41:29 +00:00
|
|
|
elm-format = justStaticExecutables (overrideCabal (self.callPackage ./packages/elm-format.nix {}) (drv: {
|
|
|
|
# GHC 8.8.1 support
|
|
|
|
# https://github.com/avh4/elm-format/pull/640
|
|
|
|
patches = [(
|
|
|
|
fetchpatch {
|
|
|
|
url = "https://github.com/turboMaCk/elm-format/commit/4f4abdc7117ed6ce3335f6cf39b6495b48067b7c.patch";
|
|
|
|
sha256 = "1zqk6q6w0ph12mnwffgwzf4h1hcgqg0v09ws9q2g5bg2riq4rvd9";
|
|
|
|
}
|
|
|
|
)];
|
|
|
|
# Tests are failing after upgrade to ghc881.
|
|
|
|
# Cause is probably just a minor change in stdout output
|
|
|
|
# see https://github.com/avh4/elm-format/pull/640
|
|
|
|
doCheck = false;
|
|
|
|
jailbreak = true;
|
|
|
|
}));
|
2020-03-16 19:10:34 +00:00
|
|
|
|
2019-10-21 14:31:02 +00:00
|
|
|
elmi-to-json = justStaticExecutables (overrideCabal (self.callPackage ./packages/elmi-to-json.nix {}) (drv: {
|
2019-10-21 20:41:29 +00:00
|
|
|
prePatch = ''
|
2019-10-21 14:31:02 +00:00
|
|
|
substituteInPlace package.yaml --replace "- -Werror" ""
|
|
|
|
hpack
|
|
|
|
'';
|
|
|
|
jailbreak = true;
|
|
|
|
}));
|
2019-06-09 14:25:00 +00:00
|
|
|
|
2020-03-16 19:10:34 +00:00
|
|
|
elm-instrument = justStaticExecutables (overrideCabal (self.callPackage ./packages/elm-instrument.nix {}) (drv: {
|
|
|
|
patches = [(
|
|
|
|
# GHC 8.8.1 and Cabal >= 1.25.0 support
|
|
|
|
# https://github.com/zwilias/elm-instrument/pull/3
|
|
|
|
fetchpatch {
|
|
|
|
url = "https://github.com/turboMaCk/elm-instrument/commit/4272db2aea742c8b54509e536fa4f35d04f95da5.patch";
|
|
|
|
sha256 = "1d1lc43lp3x5jfhlyb1b7na7nj1g1i1vc1np26pcisg9c2s7gjz6";
|
|
|
|
}
|
|
|
|
)];
|
|
|
|
prePatch = ''
|
|
|
|
sed "s/desc <-.*/let desc = \"${drv.version}\"/g" Setup.hs --in-place
|
|
|
|
'';
|
|
|
|
jailbreak = true;
|
|
|
|
# Tests are failing because of missing instances for Eq and Show type classes
|
|
|
|
doCheck = false;
|
|
|
|
}));
|
|
|
|
|
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 11:50:59 +00:00
|
|
|
};
|
|
|
|
in elmPkgs // {
|
|
|
|
inherit elmPkgs;
|
2018-08-25 10:52:48 +00:00
|
|
|
|
|
|
|
# Needed for elm-format
|
|
|
|
indents = self.callPackage ./packages/indents.nix {};
|
2015-08-13 11:50:59 +00:00
|
|
|
};
|
|
|
|
};
|
2019-09-29 10:57:55 +00: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";
|
|
|
|
|
2019-10-22 17:03:58 +00:00
|
|
|
inherit (nodePkgs) elm-doc-preview elm-live elm-upgrade elm-xref elm-analyse;
|
2019-09-29 10:57:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patchBinwrap = import ./packages/patch-binwrap.nix { inherit lib writeScriptBin stdenv; };
|
|
|
|
|
|
|
|
in hsPkgs.elmPkgs // elmNodePackages // {
|
|
|
|
lib = { inherit patchBinwrap; };
|
|
|
|
}
|