1cba74dfc1
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 |
||
---|---|---|
.. | ||
aliases.nix | ||
all-packages.nix | ||
beam-packages.nix | ||
coq-packages.nix | ||
darwin-packages.nix | ||
default.nix | ||
dotnet-packages.nix | ||
emacs-packages.nix | ||
emscripten-packages.nix | ||
haskell-packages.nix | ||
haxe-packages.nix | ||
impure.nix | ||
java-packages.nix | ||
lua-packages.nix | ||
make-tarball.nix | ||
metrics.nix | ||
ocaml-packages.nix | ||
perl-packages.nix | ||
php-packages.nix | ||
pure-packages.nix | ||
python-packages.nix | ||
release-cross.nix | ||
release-lib.nix | ||
release-python.nix | ||
release-small.nix | ||
release.nix | ||
splice.nix | ||
stage.nix |