summary refs log tree commit diff
path: root/pkgs/development/python-modules/setuptools/default.nix
diff options
context:
space:
mode:
authorBasile Henry <bjm.henry@gmail.com>2020-11-18 15:41:27 +0100
committerGitHub <noreply@github.com>2020-11-18 15:41:27 +0100
commit548db366fdfe49c4418967c7582130313241dc03 (patch)
tree816cfe63510986943fe462f6bec7be1baaf570ee /pkgs/development/python-modules/setuptools/default.nix
parentabbe6217245a13e78ee341082a4adf5abcadf107 (diff)
downloadnixpkgs-548db366fdfe49c4418967c7582130313241dc03.tar
nixpkgs-548db366fdfe49c4418967c7582130313241dc03.tar.gz
nixpkgs-548db366fdfe49c4418967c7582130313241dc03.tar.bz2
nixpkgs-548db366fdfe49c4418967c7582130313241dc03.tar.lz
nixpkgs-548db366fdfe49c4418967c7582130313241dc03.tar.xz
nixpkgs-548db366fdfe49c4418967c7582130313241dc03.tar.zst
nixpkgs-548db366fdfe49c4418967c7582130313241dc03.zip
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>
Diffstat (limited to 'pkgs/development/python-modules/setuptools/default.nix')
-rw-r--r--pkgs/development/python-modules/setuptools/default.nix11
1 files changed, 10 insertions, 1 deletions
diff --git a/pkgs/development/python-modules/setuptools/default.nix b/pkgs/development/python-modules/setuptools/default.nix
index b618ec6f634..54eacea892e 100644
--- a/pkgs/development/python-modules/setuptools/default.nix
+++ b/pkgs/development/python-modules/setuptools/default.nix
@@ -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 {