mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-03 02:51:18 +00:00
457eddd18f
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.
27 lines
841 B
Nix
27 lines
841 B
Nix
{ 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
|