Merge pull request #12993 from zimbatm/bundix-cleanup

bundix: cleaner substitution
This commit is contained in:
Arseniy Seroka 2016-02-15 15:20:11 +03:00
commit 1807999106

View File

@ -1,4 +1,4 @@
{ buildRubyGem, lib, bundler, ruby, nix, nix-prefetch-scripts }: { buildRubyGem, lib, bundler, ruby, nix, nix-prefetch-git }:
buildRubyGem rec { buildRubyGem rec {
inherit ruby; inherit ruby;
@ -12,19 +12,19 @@ buildRubyGem rec {
buildInputs = [bundler]; buildInputs = [bundler];
postInstall = '' postInstall = ''
gem_root=$GEM_HOME/gems/${gemName}-${version} substituteInPlace $GEM_HOME/gems/${gemName}-${version}/lib/bundix.rb \
sed \ --replace \
-e 's|NIX_INSTANTIATE =.*|NIX_INSTANTIATE = "${nix}/bin/nix-instantiate"|' \ "'nix-instantiate'" \
-i $gem_root/lib/bundix.rb "'${nix}/bin/nix-instantiate'" \
sed \ --replace \
-e 's|NIX_HASH =.*|NIX_HASH = "${nix}/bin/nix-hash"|' \ "'nix-hash'" \
-i $gem_root/lib/bundix.rb "'${nix}/bin/nix-hash'" \
sed \ --replace \
-e 's|NIX_PREFETCH_URL =.*|NIX_PREFETCH_URL = "${nix}/bin/nix-prefetch-url"|' \ "'nix-prefetch-url'" \
-i $gem_root/lib/bundix.rb "'${nix}/bin/nix-prefetch-url'" \
sed \ --replace \
-e 's|NIX_PREFETCH_GIT =.*|NIX_PREFETCH_GIT = "${nix-prefetch-scripts}/bin/nix-prefetch-git"|' \ "'nix-prefetch-git'" \
-i $gem_root/lib/bundix.rb "'${nix-prefetch-git}/bin/nix-prefetch-git'"
''; '';
meta = { meta = {