pythonPackages.setuptools: reproducible sdist (#104009)
* setuptools: Remove date from release tag * setuptools: Fix timestamps in sdist * setuptools: Move untar/retar to buildPhase * setuptools: Reproducible 44.0 * setuptools: Use $SOURCE_DATE_EPOCH for src Co-authored-by: Pavol Rusnak <pavol@rusnak.io> Co-authored-by: Pavol Rusnak <pavol@rusnak.io>
This commit is contained in:
parent
abbe621724
commit
548db366fd
|
@ -27,14 +27,23 @@ let
|
||||||
name = "${pname}-${version}-source";
|
name = "${pname}-${version}-source";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
./tag-date.patch
|
||||||
|
];
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
${python.pythonForBuild.interpreter} bootstrap.py
|
${python.pythonForBuild.interpreter} bootstrap.py
|
||||||
${python.pythonForBuild.interpreter} setup.py sdist --formats=gztar
|
${python.pythonForBuild.interpreter} setup.py sdist --formats=gztar
|
||||||
|
|
||||||
|
# Here we untar the sdist and retar it in order to control the timestamps
|
||||||
|
# of all the files included
|
||||||
|
tar -xzf dist/${pname}-${version}.post0.tar.gz -C dist/
|
||||||
|
tar -czf dist/${name} -C dist/ --mtime="@$SOURCE_DATE_EPOCH" ${pname}-${version}.post0
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
echo "Moving sdist..."
|
echo "Moving sdist..."
|
||||||
mv dist/*.tar.gz $out
|
mv dist/${name} $out
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in buildPythonPackage rec {
|
in buildPythonPackage rec {
|
||||||
|
|
|
@ -27,14 +27,23 @@ let
|
||||||
name = "${pname}-${version}-source";
|
name = "${pname}-${version}-source";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
./tag-date.patch
|
||||||
|
];
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
${python.pythonForBuild.interpreter} bootstrap.py
|
${python.pythonForBuild.interpreter} bootstrap.py
|
||||||
${python.pythonForBuild.interpreter} setup.py sdist --formats=gztar
|
${python.pythonForBuild.interpreter} setup.py sdist --formats=gztar
|
||||||
|
|
||||||
|
# Here we untar the sdist and retar it in order to control the timestamps
|
||||||
|
# of all the files included
|
||||||
|
tar -xzf dist/${pname}-${version}.post0.tar.gz -C dist/
|
||||||
|
tar -czf dist/${name} -C dist/ --mtime="@$SOURCE_DATE_EPOCH" ${pname}-${version}.post0
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
echo "Moving sdist..."
|
echo "Moving sdist..."
|
||||||
mv dist/*.tar.gz $out
|
mv dist/${name} $out
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
in buildPythonPackage rec {
|
in buildPythonPackage rec {
|
||||||
|
|
12
pkgs/development/python-modules/setuptools/tag-date.patch
Normal file
12
pkgs/development/python-modules/setuptools/tag-date.patch
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
diff --git a/setup.cfg b/setup.cfg
|
||||||
|
index f23714b6..8aaeb330 100644
|
||||||
|
--- a/setup.cfg
|
||||||
|
+++ b/setup.cfg
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
[egg_info]
|
||||||
|
tag_build = .post
|
||||||
|
-tag_date = 1
|
||||||
|
+tag_date = 0
|
||||||
|
|
||||||
|
[aliases]
|
||||||
|
clean_egg_info = egg_info -Db ''
|
Loading…
Reference in a new issue