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:
@@ -27,14 +27,23 @@ let
|
||||
name = "${pname}-${version}-source";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./tag-date.patch
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
${python.pythonForBuild.interpreter} bootstrap.py
|
||||
${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 = ''
|
||||
echo "Moving sdist..."
|
||||
mv dist/*.tar.gz $out
|
||||
mv dist/${name} $out
|
||||
'';
|
||||
};
|
||||
in buildPythonPackage rec {
|
||||
|
||||
Reference in New Issue
Block a user