Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
base: 8e5814bea974
Choose a base ref
...
head repository: NixOS/nixpkgs
compare: c5f141ff7a64
Choose a head ref
  • 1 commit
  • 3 files changed
  • 1 contributor

Commits on Mar 13, 2018

  1. 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
    (cherry picked from commit 1cba74d)
    aszlig authored and bjornfor committed Mar 13, 2018
    Copy the full SHA
    c5f141f View commit details
    Browse the repository at this point in the history