From 48e57cfd5721f554a94ae3e789fa8e90978a014d Mon Sep 17 00:00:00 2001 From: Marek Fajkus Date: Sun, 29 Sep 2019 12:57:55 +0200 Subject: [PATCH] elm.elmPackages: Cleanup code --- pkgs/development/compilers/elm/default.nix | 53 ++++++++++--------- .../node-packages/node-packages-v10.json | 3 +- 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/pkgs/development/compilers/elm/default.nix b/pkgs/development/compilers/elm/default.nix index 676fa19d9e85..6949f6e3b2ad 100644 --- a/pkgs/development/compilers/elm/default.nix +++ b/pkgs/development/compilers/elm/default.nix @@ -4,20 +4,11 @@ let fetchElmDeps = import ./fetchElmDeps.nix { inherit stdenv lib fetchurl; }; - patchBinwrap = import ./packages/patch-binwrap.nix { inherit lib writeScriptBin stdenv; }; - - elmNodePackages = - import ./packages/node-composition.nix { - inherit nodejs pkgs; - inherit (stdenv.hostPlatform) system; - }; - hsPkgs = haskell.packages.ghc865.override { overrides = self: super: with haskell.lib; let elmPkgs = rec { elm = overrideCabal (self.callPackage ./packages/elm.nix { }) (drv: { # sadly with parallelism most of the time breaks compilation - # also compilation is slower with increasing number of cores anyway (Tested on Ryzen 7 and i7) enableParallelBuilding = false; preConfigure = self.fetchElmDeps { elmPackages = (import ./packages/elm-srcs.nix); @@ -42,25 +33,10 @@ let `package/nix/build.sh` */ elm-format = justStaticExecutables (doJailbreak (self.callPackage ./packages/elm-format.nix {})); - elmi-to-json = justStaticExecutables (self.callPackage ./packages/elmi-to-json.nix {}); inherit fetchElmDeps; elmVersion = elmPkgs.elm.version; - - /* - 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-language-server = elmNodePackages."@elm-tooling/elm-language-server"; - - # elm-analyse@0.16.4 build is not working - elm-analyse = elmNodePackages."elm-analyse-0.16.3"; - inherit (elmNodePackages) elm-doc-preview elm-live elm-upgrade elm-xref; }; in elmPkgs // { inherit elmPkgs; @@ -69,4 +45,31 @@ let indents = self.callPackage ./packages/indents.nix {}; }; }; -in hsPkgs.elmPkgs + + /* + 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; }; +} diff --git a/pkgs/development/node-packages/node-packages-v10.json b/pkgs/development/node-packages/node-packages-v10.json index defeb3e1682e..521df45b1c4c 100644 --- a/pkgs/development/node-packages/node-packages-v10.json +++ b/pkgs/development/node-packages/node-packages-v10.json @@ -1,7 +1,7 @@ [ "@angular/cli" , "@antora/cli" -, "@antora/site-generator-default" +, "@antora/site-generator-default" , "@vue/cli" , "@webassemblyjs/cli" , "@webassemblyjs/repl" @@ -32,7 +32,6 @@ , "dnschain" , "dockerfile-language-server-nodejs" , "elasticdump" -, "elm-live" , "elm-oracle" , "emoj" , "emojione"