about summary refs log tree commit diff
path: root/doc/hooks/autopatchelf.section.md
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2022-10-13 15:36:04 +0200
committerRobert Hensing <robert@roberthensing.nl>2022-10-13 15:40:27 +0200
commit2db8de920eebf9ef488c4725d579a2c3862d9a04 (patch)
tree11273414bf1ed05cc3ef1745f397a96702a45a1b /doc/hooks/autopatchelf.section.md
parent5b055190e37d220b787b304e400391299bba022c (diff)
doc: Move non-stdenv hooks out of stdenv chapter
Diffstat (limited to 'doc/hooks/autopatchelf.section.md')
-rw-r--r--doc/hooks/autopatchelf.section.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/hooks/autopatchelf.section.md b/doc/hooks/autopatchelf.section.md
new file mode 100644
index 0000000000000..9c2852ccf2794
--- /dev/null
+++ b/doc/hooks/autopatchelf.section.md
@@ -0,0 +1,12 @@
+
+### autoPatchelfHook {#setup-hook-autopatchelfhook}
+
+This is a special setup hook which helps in packaging proprietary software in that it automatically tries to find missing shared library dependencies of ELF files based on the given `buildInputs` and `nativeBuildInputs`.
+
+You can also specify a `runtimeDependencies` variable which lists dependencies to be unconditionally added to rpath of all executables. This is useful for programs that use dlopen 3 to load libraries at runtime.
+
+In certain situations you may want to run the main command (`autoPatchelf`) of the setup hook on a file or a set of directories instead of unconditionally patching all outputs. This can be done by setting the `dontAutoPatchelf` environment variable to a non-empty value.
+
+By default `autoPatchelf` will fail as soon as any ELF file requires a dependency which cannot be resolved via the given build inputs. In some situations you might prefer to just leave missing dependencies unpatched and continue to patch the rest. This can be achieved by setting the `autoPatchelfIgnoreMissingDeps` environment variable to a non-empty value. `autoPatchelfIgnoreMissingDeps` can be set to a list like `autoPatchelfIgnoreMissingDeps = [ "libcuda.so.1" "libcudart.so.1" ];` or to simply `[ "*" ]` to ignore all missing dependencies.
+
+The `autoPatchelf` command also recognizes a `--no-recurse` command line flag, which prevents it from recursing into subdirectories.