1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-03 11:02:05 +00:00
nixpkgs/pkgs/top-level
aszlig 1cba74dfc1
setup-hooks: Add autoPatchelfHook
I originally wrote this for packaging proprietary games in Vuizvui[1]
but I thought it would be generally useful as we have a fair amount of
proprietary software lurking around in nixpkgs, which are a bit tedious
to maintain, especially when the library dependencies change after an
update.

So this setup hook searches for all ELF executables and libraries in the
resulting output paths after install phase and uses patchelf to set the
RPATH and interpreter according to what dependencies are available
inside the builder.

For example consider something like this:

stdenv.mkDerivation {
  ...
  nativeBuildInputs = [ autoPatchelfHook ];
  buildInputs = [ mesa zlib ];
  ...
}

Whenever for example an executable requires mesa or zlib, the RPATH will
automatically be set to the lib dir of the corresponding dependency.

If the library dependency is required at runtime, an attribute called
runtimeDependencies can be used to list dependencies that are added to
all executables that are discovered unconditionally.

Beside this, it also makes initial packaging of proprietary software
easier, because one no longer has to manually figure out the
dependencies in the first place.

[1]: https://github.com/openlab-aux/vuizvui

Signed-off-by: aszlig <aszlig@nix.build>
Closes: #34506
2018-02-10 00:27:24 +05:30
..
aliases.nix Merge remote-tracking branch 'upstream/master' into staging 2018-02-03 02:50:21 +02:00
all-packages.nix setup-hooks: Add autoPatchelfHook 2018-02-10 00:27:24 +05:30
beam-packages.nix Elixir: 1.6-rc -> 1.6 2018-01-17 14:22:48 -05:00
coq-packages.nix coq: default to 8.7 2018-02-07 19:28:38 +00:00
darwin-packages.nix Update darwin-packages.nix 2018-02-06 00:41:35 +08:00
default.nix Add setFunctionArgs lib function. 2018-01-31 14:02:19 -05:00
dotnet-packages.nix treewide: homepage+src updates (found by repology, #33263) 2018-01-05 20:42:46 +01:00
emacs-packages.nix Merge pull request #31312 from binarin/emacs-package-set-overrides 2018-02-06 21:22:23 +00:00
emscripten-packages.nix
haskell-packages.nix Drop broken Haskell compilers. 2018-01-26 13:01:11 +01:00
haxe-packages.nix
impure.nix
java-packages.nix
lua-packages.nix lgi: Fix cairo bindings search path 2018-02-04 11:23:35 +01:00
make-tarball.nix
metrics.nix
ocaml-packages.nix ocamlPackages.uri: 1.9.2 -> 1.9.5 2018-01-14 05:28:49 +00:00
perl-packages.nix perl-Encode: 2.93 -> 2.95 2018-02-08 21:01:12 +01:00
php-packages.nix Merge pull request #34496 from etu/php722 2018-02-03 22:32:42 +08:00
pure-packages.nix
python-packages.nix pythonnet: Init at 2.3.0 2018-02-08 21:29:36 -05:00
release-cross.nix release-cross: Try building on Windows too 2018-01-22 11:29:15 -05:00
release-lib.nix nixos/release.nix: Move forAllSystems to release-lib 2018-01-16 18:56:41 +02:00
release-python.nix
release-small.nix release-small: Don't attempt to access "dbus.libs", etc., don't exist 2018-01-12 18:06:53 -06:00
release.nix linux bootstrap tools: Use same derivation whether cross compiling or not 2018-01-02 13:52:41 -05:00
splice.nix top-level: Splice in more package sets for new types of deps 2017-12-30 22:04:20 -05:00
stage.nix top-level: Duplicate overlaying unless stdenvOverrides comes last 2018-01-31 00:16:27 -05:00