mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
deterministic-uname: add setup hook
Several packages were adding deterministic-uname to `nativeBuildInputs`, but that is insufficient for its use. Add a setup hook to make its use more obvious
This commit is contained in:
parent
720365f01c
commit
36559eb1b9
2 changed files with 11 additions and 0 deletions
|
|
@ -46,6 +46,9 @@ replaceVarsWith {
|
|||
modDirVersion = if modDirVersion != "" then modDirVersion else "unknown";
|
||||
};
|
||||
|
||||
# coreutils uname is in initialPath, so ordinarily appears in PATH before packages in nativeBuildInputs.
|
||||
setupHook = ./setup-hook.sh;
|
||||
|
||||
meta = {
|
||||
description = "Print certain system information (hardcoded with lib/system values)";
|
||||
mainProgram = "uname";
|
||||
|
|
|
|||
8
pkgs/by-name/de/deterministic-uname/setup-hook.sh
Normal file
8
pkgs/by-name/de/deterministic-uname/setup-hook.sh
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
# PATH is overwritten after package setup hooks are run,
|
||||
# so the variable change needs to be delayed until a phase.
|
||||
# An entry in prePhases is the earliest possible, useful
|
||||
# in case an unpack or patch hook attempts to run uname.
|
||||
unamePreHook() {
|
||||
export PATH="@out@/bin:$PATH"
|
||||
}
|
||||
appendToVar prePhases unamePreHook
|
||||
Loading…
Add table
Add a link
Reference in a new issue