* Use patchelf to remove unnecessary directories automatically (in the
installation phase) from the rpaths of ELF executables and libraries. This results in smaller closures. svn path=/nixpkgs/trunk/; revision=1534
This commit is contained in:
parent
8cb8bdd418
commit
b6001eed67
@ -1,10 +1,10 @@
|
|||||||
{stdenv, fetchurl}:
|
{stdenv, fetchurl}:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "patchelf-0.1pre1514";
|
name = "patchelf-0.1pre1513";
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = http://catamaran.labs.cs.uu.nl/dist/nix/patchelf-0.1pre1514/patchelf-0.1pre1514.tar.gz;
|
url = http://losser.st-lab.cs.uu.nl/~eelco/dist/patchelf-0.1pre1513.tar.gz;
|
||||||
md5 = "b3d82ce1dc68304770fe5411ed718e3a";
|
md5 = "874928f46117828c1d8019986aa2eaac";
|
||||||
};
|
};
|
||||||
# src = /home/eelco/Dev/patchelf/patchelf-0.1.tar.gz;
|
# src = /home/eelco/Dev/patchelf/patchelf-0.1.tar.gz;
|
||||||
}
|
}
|
||||||
|
@ -527,6 +527,16 @@ checkPhase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
patchELF() {
|
||||||
|
# Patch all ELF executables and shared libraries.
|
||||||
|
header "patching ELF executables and libraries"
|
||||||
|
find "$prefix" \( -name "*.so*" -o \
|
||||||
|
\( -type f -a -perm +0100 \) \
|
||||||
|
\) -exec patchelf --shrink-rpath {} \;
|
||||||
|
stopNest
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
installW() {
|
installW() {
|
||||||
if test -n "$installPhase"; then
|
if test -n "$installPhase"; then
|
||||||
$installPhase
|
$installPhase
|
||||||
@ -549,6 +559,10 @@ installW() {
|
|||||||
-exec strip -S {} \; || fail
|
-exec strip -S {} \; || fail
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test "$havePatchELF" = 1 -a -z "$dontPatchELF"; then
|
||||||
|
patchELF "$prefix"
|
||||||
|
fi
|
||||||
|
|
||||||
if test -n "$propagatedBuildInputs"; then
|
if test -n "$propagatedBuildInputs"; then
|
||||||
ensureDir "$out/nix-support"
|
ensureDir "$out/nix-support"
|
||||||
echo "$propagatedBuildInputs" > "$out/nix-support/propagated-build-inputs"
|
echo "$propagatedBuildInputs" > "$out/nix-support/propagated-build-inputs"
|
||||||
|
@ -3,7 +3,10 @@
|
|||||||
genericStdenv {
|
genericStdenv {
|
||||||
name = "stdenv-nix-linux";
|
name = "stdenv-nix-linux";
|
||||||
preHook = ./prehook.sh;
|
preHook = ./prehook.sh;
|
||||||
initialPath = (import ../nix/path.nix) {pkgs = pkgs;};
|
initialPath = [
|
||||||
|
((import ../nix/path.nix) {pkgs = pkgs;})
|
||||||
|
pkgs.patchelf
|
||||||
|
];
|
||||||
|
|
||||||
inherit stdenv;
|
inherit stdenv;
|
||||||
|
|
||||||
|
@ -1 +1,2 @@
|
|||||||
export NIX_ENFORCE_PURITY=1
|
export NIX_ENFORCE_PURITY=1
|
||||||
|
havePatchELF=1
|
Loading…
x
Reference in New Issue
Block a user