mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-30 01:23:03 +00:00
acd32a4caf
The Python interpreters are patched so they can build .pyc bytecode free of certain indeterminism. When building Python packages we currently set ``` compiling python files. in nix store. DETERMINISTIC_BUILD=1; PYTHONHASHSEED = 0; ``` Instead if setting these environment variables in the function that builds the package, this commit sets the variables instead in the Python setup hook. That way, whenever Python is included in a derivation, these variables are set. See also the issue https://github.com/NixOS/nixpkgs/issues/25707.
14 lines
203 B
Nix
14 lines
203 B
Nix
{ runCommand }:
|
|
|
|
sitePackages:
|
|
|
|
let
|
|
hook = ./setup-hook.sh;
|
|
in runCommand "python-setup-hook.sh" {
|
|
inherit sitePackages;
|
|
} ''
|
|
cp ${hook} hook.sh
|
|
substituteAllInPlace hook.sh
|
|
mv hook.sh $out
|
|
''
|