fetchbower: handle packages with slashes in their name

Packages from github repos have slashes in their name. Nix store names
shouldn't have slashes.

Fixes rvl/bower2nix#13
This commit is contained in:
Rodney Lorrimar 2017-07-27 21:14:31 +01:00
parent a7c8f5e419
commit efaec90f60
1 changed files with 3 additions and 1 deletions

View File

@ -7,8 +7,10 @@ let
ver = if builtins.length components == 1 then version else hash; ver = if builtins.length components == 1 then version else hash;
in ver; in ver;
bowerName = name: lib.replaceStrings ["/"] ["-"] name;
fetchbower = name: version: target: outputHash: stdenv.mkDerivation { fetchbower = name: version: target: outputHash: stdenv.mkDerivation {
name = "${name}-${bowerVersion version}"; name = "${bowerName name}-${bowerVersion version}";
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt"; SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
buildCommand = '' buildCommand = ''
fetch-bower --quiet --out=$PWD/out "${name}" "${target}" "${version}" fetch-bower --quiet --out=$PWD/out "${name}" "${target}" "${version}"