From 609607768fd1792d72bddfa0860892097a9e6595 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 3 Nov 2006 13:33:24 +0000 Subject: [PATCH] * Turn the nukeRefs() function into a separate program. svn path=/nixpkgs/trunk/; revision=6941 --- pkgs/build-support/nuke-references/builder.sh | 12 ++++++++++++ pkgs/build-support/nuke-references/default.nix | 11 +++++++++++ pkgs/top-level/all-packages.nix | 4 ++++ 3 files changed, 27 insertions(+) create mode 100644 pkgs/build-support/nuke-references/builder.sh create mode 100644 pkgs/build-support/nuke-references/default.nix diff --git a/pkgs/build-support/nuke-references/builder.sh b/pkgs/build-support/nuke-references/builder.sh new file mode 100644 index 000000000000..867262c516b6 --- /dev/null +++ b/pkgs/build-support/nuke-references/builder.sh @@ -0,0 +1,12 @@ +source $stdenv/setup + +ensureDir $out/bin +cat > $out/bin/nuke-refs < \$i.tmp + if test -x \$i; then chmod +x \$i.tmp; fi + mv \$i.tmp \$i +done +EOF +chmod +x $out/bin/nuke-refs diff --git a/pkgs/build-support/nuke-references/default.nix b/pkgs/build-support/nuke-references/default.nix new file mode 100644 index 000000000000..d672184553f6 --- /dev/null +++ b/pkgs/build-support/nuke-references/default.nix @@ -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; +} \ No newline at end of file diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 51a07641b11b..d8e5023207d0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -192,6 +192,10 @@ rec { inherit stdenv; }; + nukeReferences = import ../build-support/nuke-references/default.nix { + inherit stdenv; + }; + ### TOOLS