python: Pull ensureNewerSourcesHook call to all-packages.nix
Documents the reason why it's needed and also prevents the ensureNewerSourcesHook call being evaluated again and again for every single Python package.
This commit is contained in:
parent
d6023f0456
commit
68052b5619
@ -6,7 +6,7 @@
|
|||||||
, wrapPython
|
, wrapPython
|
||||||
, setuptools
|
, setuptools
|
||||||
, unzip
|
, unzip
|
||||||
, ensureNewerSourcesHook
|
, ensureNewerSourcesForZipFilesHook
|
||||||
, toPythonModule
|
, toPythonModule
|
||||||
, namePrefix
|
, namePrefix
|
||||||
, bootstrapped-pip
|
, bootstrapped-pip
|
||||||
@ -19,7 +19,7 @@ let
|
|||||||
wheel-specific = import ./build-python-package-wheel.nix { };
|
wheel-specific = import ./build-python-package-wheel.nix { };
|
||||||
common = import ./build-python-package-common.nix { inherit python bootstrapped-pip; };
|
common = import ./build-python-package-common.nix { inherit python bootstrapped-pip; };
|
||||||
mkPythonDerivation = import ./mk-python-derivation.nix {
|
mkPythonDerivation = import ./mk-python-derivation.nix {
|
||||||
inherit lib python wrapPython setuptools unzip ensureNewerSourcesHook toPythonModule namePrefix;
|
inherit lib python wrapPython setuptools unzip ensureNewerSourcesForZipFilesHook toPythonModule namePrefix;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
, wrapPython
|
, wrapPython
|
||||||
, setuptools
|
, setuptools
|
||||||
, unzip
|
, unzip
|
||||||
, ensureNewerSourcesHook
|
, ensureNewerSourcesForZipFilesHook
|
||||||
# Whether the derivation provides a Python module or not.
|
# Whether the derivation provides a Python module or not.
|
||||||
, toPythonModule
|
, toPythonModule
|
||||||
, namePrefix
|
, namePrefix
|
||||||
@ -69,7 +69,7 @@ toPythonModule (python.stdenv.mkDerivation (builtins.removeAttrs attrs [
|
|||||||
|
|
||||||
name = namePrefix + name;
|
name = namePrefix + name;
|
||||||
|
|
||||||
nativeBuildInputs = [ (ensureNewerSourcesHook { year = "1980"; }) ]
|
nativeBuildInputs = [ ensureNewerSourcesForZipFilesHook ]
|
||||||
++ nativeBuildInputs;
|
++ nativeBuildInputs;
|
||||||
|
|
||||||
buildInputs = [ wrapPython ]
|
buildInputs = [ wrapPython ]
|
||||||
|
@ -92,6 +92,10 @@ with pkgs;
|
|||||||
}
|
}
|
||||||
'');
|
'');
|
||||||
|
|
||||||
|
# Zip file format only allows times after year 1980, which makes e.g. Python wheel building fail with:
|
||||||
|
# ValueError: ZIP does not support timestamps before 1980
|
||||||
|
ensureNewerSourcesForZipFilesHook = ensureNewerSourcesHook { year = "1980"; };
|
||||||
|
|
||||||
updateAutotoolsGnuConfigScriptsHook = makeSetupHook
|
updateAutotoolsGnuConfigScriptsHook = makeSetupHook
|
||||||
{ substitutions = { gnu_config = gnu-config;}; }
|
{ substitutions = { gnu_config = gnu-config;}; }
|
||||||
../build-support/setup-hooks/update-autotools-gnu-config-scripts.sh;
|
../build-support/setup-hooks/update-autotools-gnu-config-scripts.sh;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user