From c80feaf542d437d0bc6d4461ba49643dd9eac1ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Fri, 10 Jan 2014 22:04:05 +0100 Subject: [PATCH] document setuptools monkeypatching and DETERMINISTIC_BUILD=1 --- pkgs/development/python-modules/generic/default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/generic/default.nix b/pkgs/development/python-modules/generic/default.nix index fc91fcd3d8a8..c2a389a78be1 100644 --- a/pkgs/development/python-modules/generic/default.nix +++ b/pkgs/development/python-modules/generic/default.nix @@ -54,14 +54,17 @@ python.stdenv.mkDerivation (attrs // { configurePhase = attrs.configurePhase or '' runHook preConfigure - # TODO: document + # patch python interpreter to write null timestamps when compiling python files + # with following var we tell python to activate the patch so that python doesn't + # try to update them when we freeze timestamps in nix store export DETERMINISTIC_BUILD=1 - # we need to prepend following line to monkeypatch distutils commands + # prepend following line to import setuptools before distutils + # this way we make sure setuptools monkeypatches distutils commands + # this way setuptools provides extra helpers such as "python setup.py test" sed -i '0,/import distutils/s//import setuptools;import distutils/' setup.py sed -i '0,/from distutils/s//import setuptools;from distutils/' setup.py - runHook postConfigure '';