File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed
Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change 3636 ] ;
3737 } ;
3838
39- fetch-bower = import ./.. { inherit pkgs ; } ;
39+ bower2nix = import ./.. { inherit pkgs ; } ;
4040
4141 # fetch-bower-3.0.0 has different command line args from fetch-bower-2.0.0
4242 # nixpkgs will need a pull request for this change.
4343 # Also the quoting of fetch-bower arguments was fixed
4444 fetchbower = name : version : target : outputHash : pkgs . stdenv . mkDerivation {
45- name = "${ name } -${ version } " ;
46- buildCommand = "fetch-bower --out=$out '${ name } ' '${ target } ' '${ version } '" ;
45+ name = "${ name } -${ bowerVersion version } " ;
46+ buildCommand = "fetch-bower --quiet -- out=$out '${ name } ' '${ target } ' '${ version } '" ;
4747 outputHashMode = "recursive" ;
4848 outputHashAlgo = "sha256" ;
4949 inherit outputHash ;
50- buildInputs = [ pkgs . git fetch-bower ] ;
50+ buildInputs = [ bower2nix ] ;
51+ } ;
52+
53+ bowerVersion = version :
54+ let
55+ components = pkgs . lib . splitString "#" version ;
56+ hash = pkgs . lib . last components ;
57+ ver = if builtins . length components == 1 then version else hash ;
58+ in ver ;
59+
60+
61+ # running bower2nix from nix can't really work properly.
62+ bowerGeneratedNix = pkgs . stdenv . mkDerivation {
63+ name = "bower-generated.nix" ;
64+ src = test ;
65+ buildInputs = [ bower2nix ] ;
66+ buildPhase = "bower2nix bower.json $out" ;
67+ installPhase = "true" ;
68+ preferLocalBuild = true ;
5169 } ;
5270
5371in bowerComponents
You can’t perform that action at this time.
0 commit comments