* Turn the nukeRefs() function into a separate program.
svn path=/nixpkgs/trunk/; revision=6941
This commit is contained in:
parent
d0a18cf8fa
commit
609607768f
12
pkgs/build-support/nuke-references/builder.sh
Normal file
12
pkgs/build-support/nuke-references/builder.sh
Normal file
@ -0,0 +1,12 @@
|
||||
source $stdenv/setup
|
||||
|
||||
ensureDir $out/bin
|
||||
cat > $out/bin/nuke-refs <<EOF
|
||||
#! $SHELL -e
|
||||
for i in \$*; do
|
||||
cat \$i | sed "s|/nix/store/[a-z0-9]*-|/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-|g" > \$i.tmp
|
||||
if test -x \$i; then chmod +x \$i.tmp; fi
|
||||
mv \$i.tmp \$i
|
||||
done
|
||||
EOF
|
||||
chmod +x $out/bin/nuke-refs
|
11
pkgs/build-support/nuke-references/default.nix
Normal file
11
pkgs/build-support/nuke-references/default.nix
Normal file
@ -0,0 +1,11 @@
|
||||
# The program `nuke-refs' created by this derivation replaces all
|
||||
# references to the Nix store in the specified files by a non-existant
|
||||
# path (/nix/store/eeee...). This is useful for getting rid of
|
||||
# dependencies that you know are not actually needed at runtime.
|
||||
|
||||
{stdenv}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "nuke-references";
|
||||
builder = ./builder.sh;
|
||||
}
|
@ -192,6 +192,10 @@ rec {
|
||||
inherit stdenv;
|
||||
};
|
||||
|
||||
nukeReferences = import ../build-support/nuke-references/default.nix {
|
||||
inherit stdenv;
|
||||
};
|
||||
|
||||
|
||||
### TOOLS
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user