bower2nix: 2.1.0 -> 3.0.1

1. Update bower2nix version and add new/updated dependencies into
   node-packages-generated.nix. This was done manually, with npm2nix
   generating the initial set of derivations. In future, it would be
   nice to have an automatic process (see #10358, #9332).

2. Add an override to nodePackages.bower2nix wrapping the commands so
   that git is on the PATH.

3. Update fetchbower to support new command-line options of bower2nix,
   and to allow github URL tag versions.
This commit is contained in:
Rodney Lorrimar 2016-03-26 14:27:24 +00:00
parent 156b05ae48
commit 457eddd18f
5 changed files with 3963 additions and 61 deletions

View file

@ -1,11 +1,26 @@
{ stdenv, fetch-bower, git }: name: version: target: outputHash: stdenv.mkDerivation {
name = "${name}-${version}";
buildCommand = ''
out=$PWD/out fetch-bower "${name}" "${version}" "${target}"
cp -R out $out
'';
outputHashMode = "recursive";
outputHashAlgo = "sha256";
inherit outputHash;
buildInputs = [git fetch-bower];
}
{ stdenv, lib, bower2nix }:
let
bowerVersion = version:
let
components = lib.splitString "#" version;
hash = lib.last components;
ver = if builtins.length components == 1 then version else hash;
in ver;
fetchbower = name: version: target: outputHash: stdenv.mkDerivation {
name = "${name}-${bowerVersion version}";
buildCommand = ''
fetch-bower --quiet --out=$PWD/out "${name}" "${target}" "${version}"
# In some cases, the result of fetchBower is different depending
# on the output directory (e.g. if the bower package contains
# symlinks). So use a local output directory before copying to
# $out.
cp -R out $out
'';
outputHashMode = "recursive";
outputHashAlgo = "sha256";
inherit outputHash;
buildInputs = [ bower2nix ];
};
in fetchbower

View file

@ -171,7 +171,7 @@ in
};
fetchbower = callPackage ../build-support/fetchbower {
inherit (nodePackages) fetch-bower;
inherit (nodePackages) bower2nix;
};
fetchbzr = callPackage ../build-support/fetchbzr { };

File diff suppressed because it is too large Load diff

View file

@ -122,7 +122,6 @@
, "git-run"
, "bower"
, "bower2nix"
, "fetch-bower"
, "npm-check-updates"
, "node-stringprep"
, "ltx"

View file

@ -63,6 +63,12 @@ in rec {
sha1 = "26220f7e43ee3c0d714860db61c4d0ecc9bb3d89";
}} ../webdrvr/chromedriver_linux64.zip
'';
bower2nix.buildInputs = [ pkgs.makeWrapper ];
bower2nix.postInstall = ''
for prog in bower2nix fetch-bower; do
wrapProgram "$out/bin/$prog" --prefix PATH : "${pkgs.git}/bin"
done
'';
} // args.overrides or {};
# Apply overrides and back compatiblity transformations