-
-
Notifications
You must be signed in to change notification settings - Fork 14k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python: propagate makeWrapper arguments
Python libraries that have runtime dependencies, like Qt and GTK libraries, are currently not working. These are not included in the interpreter wrapper and no mechanism exist to do so automatically. This commit adds a `nix-support/make-wrapper-args` file that stores the makeWrapper arguments of a python derivation (created with buildPythonPackage). The arguments are loaded from python.buildEnv when creating the Python environment and passed to the makeWrapper invocation.
- Loading branch information
Showing
6 changed files
with
60 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
pkgs/development/interpreters/python/hooks/propagate-wrapper-args.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Hook that propagates wrapper arguments up to the | ||
# python interpreter buildEnv environment. | ||
echo "Sourcing propagate-wrapper-args.sh" | ||
|
||
storeWrapperArgsHook() { | ||
# Store the arguments for use by other derivations | ||
# and the python interpreter derivation. | ||
echo "Executing propagateWrapperArgsHook" | ||
|
||
mkdir -p "$out/nix-support" | ||
if [ ${#qtWrapperArgs[@]} -ne 0 ]; then | ||
printf '%s\n' "${qtWrapperArgs[@]}" >> "$out/nix-support/make-wrapper-args" | ||
fi | ||
if [ ${#gappsWrapperArgs[@]} -ne 0 ]; then | ||
printf '%s\n' "${gappsWrapperArgs[@]}" >> "$out/nix-support/make-wrapper-args" | ||
fi | ||
if [ ${#makeWrapperArgs[@]} -ne 0 ]; then | ||
printf '%s\n' "${makeWrapperArgs[@]}" >> "$out/nix-support/make-wrapper-args" | ||
fi | ||
} | ||
|
||
loadWrapperArgsHook() { | ||
# Load the arguments from all the dependencies. | ||
# Note: this hook *must* run after storeWrapperArgsHook to | ||
# avoid an exponential duplication of the wrapper arguments. | ||
for path in $propagatedBuildInputs "$@"; do | ||
if [ -f "$path/nix-support/make-wrapper-args" ]; then | ||
makeWrapperArgs+=$(cat "$path/nix-support/make-wrapper-args") | ||
fi | ||
done | ||
} | ||
|
||
postFixupHooks+=(storeWrapperArgsHook loadWrapperArgsHook) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters