3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/doc
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
..
languages-frameworks Merge pull request #33306 from bgamari/patch-2 2018-02-06 21:34:10 +00:00
old
coding-conventions.xml Merge pull request #31668 from rycee/doc/naming 2017-12-23 17:12:29 +03:00
configuration.xml nixpkgs manual: unfree packages are untested 2017-11-01 22:34:56 +01:00
contributing.xml
cross-compilation.xml doc: Cross chapter: Add note on why use example platforms 2018-01-26 12:38:34 -05:00
default.nix mkShell: add builder (#30975) 2017-12-20 23:42:07 +00:00
functions.xml dockerTools: document image spec v1.2 compatibility 2017-08-03 11:52:03 +02:00
introduction.md nixpkgs manual: remove reference to now defunct nixpkgs monitor 2017-10-17 16:04:29 +01:00
manual.xml docs: add section on common darwin issues 2017-11-01 18:08:19 +01:00
meta.xml nixpkgs manual : clearer meta.platforms description 2017-11-04 16:08:14 +01:00
multiple-output.xml stdenv: Move devhelp books to outputDevdoc 2017-11-24 02:09:44 +01:00
overlays.xml Overlays: allow overlays to be specified in a file 2017-08-17 22:13:39 +00:00
package-notes.xml Merge pull request #31312 from binarin/emacs-package-set-overrides 2018-02-06 21:22:23 +00:00
platform-notes.xml docs: add section on common darwin issues 2017-11-01 18:08:19 +01:00
quick-start.xml Point to the new mailing list by replacing the old link 2017-07-18 13:44:10 +02:00
release-notes.xml
reviewing-contributions.xml doc: system.environmentPackages -> environment.systemPackages 2017-12-20 02:19:43 +00:00
shell.md doc: fix typo 2017-12-24 00:40:01 +00:00
stdenv.xml setup-hooks: Add autoPatchelfHook 2018-02-10 00:27:24 +05:30
style.css
submitting-changes.xml doc/submitting-changes.xml: suggest "nixos/<module>" prefix for NixOS changes 2017-09-13 14:10:25 +02:00