From b812a723f50890e6c6a9653fa36fe2eb56acfbbb Mon Sep 17 00:00:00 2001 From: Marek Fajkus Date: Wed, 18 Mar 2020 20:36:36 +0100 Subject: [PATCH] elmPackages: minor cleanups * Make sure generate script uses node2nix version from the nixpkgs * regenerate code generated by node2nix --- pkgs/development/compilers/elm/default.nix | 4 +-- .../elm/packages/generate-node-packages.sh | 8 +++-- .../elm/packages/node-composition.nix | 2 +- .../compilers/elm/packages/node-packages.nix | 36 +++++-------------- .../compilers/elm/packages/patch-binwrap.nix | 2 +- 5 files changed, 18 insertions(+), 34 deletions(-) diff --git a/pkgs/development/compilers/elm/default.nix b/pkgs/development/compilers/elm/default.nix index ea84edd5e1db..fa9f72ebd044 100644 --- a/pkgs/development/compilers/elm/default.nix +++ b/pkgs/development/compilers/elm/default.nix @@ -91,11 +91,11 @@ let inherit nodejs pkgs; inherit (stdenv.hostPlatform) system; }; - in with hsPkgs.elmPkgs; rec { + 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-coverage = - let patched = patchBinwrap [elm elmi-to-json] nodePkgs.elm-coverage; + let patched = patchBinwrap [elmi-to-json] nodePkgs.elm-coverage; in patched.override { preRebuild = '' sed 's/\"install\".*/\"install\":\"echo no-op\"/g' --in-place package.json diff --git a/pkgs/development/compilers/elm/packages/generate-node-packages.sh b/pkgs/development/compilers/elm/packages/generate-node-packages.sh index 1d24df549ea6..343721208b89 100755 --- a/pkgs/development/compilers/elm/packages/generate-node-packages.sh +++ b/pkgs/development/compilers/elm/packages/generate-node-packages.sh @@ -1,10 +1,12 @@ -#!/usr/bin/env nix-shell -#! nix-shell -i bash -p nodePackages.node2nix +#!/usr/bin/env bash + +ROOT="$(realpath "$(dirname -- "$(readlink -f -- "${BASH_SOURCE[0]}")")"/../../../../..)" set -eu -o pipefail rm -f node-env.nix -node2nix --nodejs-10 \ +$(nix-build $ROOT -A nodePackages.node2nix --no-out-link)/bin/node2nix \ + --nodejs-10 \ -i node-packages.json \ -o node-packages.nix \ -c node-composition.nix \ diff --git a/pkgs/development/compilers/elm/packages/node-composition.nix b/pkgs/development/compilers/elm/packages/node-composition.nix index 1ffd758ac82e..4add754b5999 100644 --- a/pkgs/development/compilers/elm/packages/node-composition.nix +++ b/pkgs/development/compilers/elm/packages/node-composition.nix @@ -1,4 +1,4 @@ -# This file has been generated by node2nix 1.7.0. Do not edit! +# This file has been generated by node2nix 1.8.0. Do not edit! {pkgs ? import { inherit system; diff --git a/pkgs/development/compilers/elm/packages/node-packages.nix b/pkgs/development/compilers/elm/packages/node-packages.nix index 46920bf62b74..1c8956f4beac 100644 --- a/pkgs/development/compilers/elm/packages/node-packages.nix +++ b/pkgs/development/compilers/elm/packages/node-packages.nix @@ -1,4 +1,4 @@ -# This file has been generated by node2nix 1.7.0. Do not edit! +# This file has been generated by node2nix 1.8.0. Do not edit! {nodeEnv, fetchurl, fetchgit, globalBuildInputs ? []}: @@ -2894,15 +2894,6 @@ let sha512 = "yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA=="; }; }; - "minimist-0.0.8" = { - name = "minimist"; - packageName = "minimist"; - version = "0.0.8"; - src = fetchurl { - url = "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz"; - sha1 = "857fcabfc3397d2625b8228262e86aa7a011b05d"; - }; - }; "minimist-1.2.0" = { name = "minimist"; packageName = "minimist"; @@ -2948,13 +2939,13 @@ let sha512 = "WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA=="; }; }; - "mkdirp-0.5.1" = { + "mkdirp-0.5.3" = { name = "mkdirp"; packageName = "mkdirp"; - version = "0.5.1"; + version = "0.5.3"; src = fetchurl { - url = "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz"; - sha1 = "30057438eac6cf7f8c4767f38648d6697d75c903"; + url = "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz"; + sha512 = "P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg=="; }; }; "moment-2.24.0" = { @@ -5455,7 +5446,6 @@ in ]; }) sources."fs-extra-8.1.0" - sources."minimist-1.2.5" sources."which-2.0.1" ]; }) @@ -5518,10 +5508,10 @@ in sources."mime-db-1.43.0" sources."mime-types-2.1.26" sources."minimatch-3.0.4" - sources."minimist-0.0.8" + sources."minimist-1.2.5" sources."minipass-2.9.0" sources."minizlib-1.3.3" - sources."mkdirp-0.5.1" + sources."mkdirp-0.5.3" sources."moment-2.24.0" sources."murmur-hash-js-1.0.0" sources."mustache-3.2.1" @@ -6504,11 +6494,7 @@ in sources."minimist-1.2.5" sources."minipass-2.9.0" sources."minizlib-1.3.3" - (sources."mkdirp-0.5.1" // { - dependencies = [ - sources."minimist-0.0.8" - ]; - }) + sources."mkdirp-0.5.3" sources."murmur-hash-js-1.0.0" sources."mustache-3.2.1" sources."nice-try-1.0.5" @@ -6762,11 +6748,7 @@ in sources."minimist-1.2.5" sources."minipass-2.9.0" sources."minizlib-1.3.3" - (sources."mkdirp-0.5.1" // { - dependencies = [ - sources."minimist-0.0.8" - ]; - }) + sources."mkdirp-0.5.3" sources."murmur-hash-js-1.0.0" sources."mustache-3.2.1" sources."nice-try-1.0.5" diff --git a/pkgs/development/compilers/elm/packages/patch-binwrap.nix b/pkgs/development/compilers/elm/packages/patch-binwrap.nix index 3a67954b78c9..30f54e6f5ac5 100644 --- a/pkgs/development/compilers/elm/packages/patch-binwrap.nix +++ b/pkgs/development/compilers/elm/packages/patch-binwrap.nix @@ -14,7 +14,7 @@ in targets: pkg: pkg.override { - buildInputs = [ binwrap binwrap-install ]; + nativeBuildInputs = pkg.nativeBuildInputs ++ [ binwrap binwrap-install ]; # Manually install targets # by symlinking binaries into `node_modules`