mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 22:08:16 -05:00
gnu: python: Make 'sys.version' deterministic.
* gnu/packages/patches/python-2-deterministic-build-info.patch, gnu/packages/patches/python-3-deterministic-build-info.patch: New files. * gnu/packages/python.scm (python-2, python): Use them. * gnu-system.am (dist_patch_DATA): Add them.
This commit is contained in:
parent
a665996f58
commit
9820a6d4a0
4 changed files with 38 additions and 0 deletions
|
@ -669,8 +669,10 @@ dist_patch_DATA = \
|
|||
gnu/packages/patches/pybugz-encode-error.patch \
|
||||
gnu/packages/patches/pybugz-stty.patch \
|
||||
gnu/packages/patches/pyqt-configure.patch \
|
||||
gnu/packages/patches/python-2-deterministic-build-info.patch \
|
||||
gnu/packages/patches/python-2.7-search-paths.patch \
|
||||
gnu/packages/patches/python-2.7-source-date-epoch.patch \
|
||||
gnu/packages/patches/python-3-deterministic-build-info.patch \
|
||||
gnu/packages/patches/python-3-search-paths.patch \
|
||||
gnu/packages/patches/python-disable-ssl-test.patch \
|
||||
gnu/packages/patches/python-fix-tests.patch \
|
||||
|
|
17
gnu/packages/patches/python-2-deterministic-build-info.patch
Normal file
17
gnu/packages/patches/python-2-deterministic-build-info.patch
Normal file
|
@ -0,0 +1,17 @@
|
|||
Always provide the same date and time in 'Py_GetBuildInfo'.
|
||||
This is the information shown at the REPL and in 'sys.version'.
|
||||
We cannot pass it in CPPFLAGS due to whitespace in the DATE string.
|
||||
|
||||
--- a/Modules/getbuildinfo.c
|
||||
+++ b/Modules/getbuildinfo.c
|
||||
@@ -4,6 +4,10 @@
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
+/* Deterministic date and time. */
|
||||
+#define DATE "Jan 1 1970"
|
||||
+#define TIME "00:00:01"
|
||||
+
|
||||
#ifndef DATE
|
||||
#ifdef __DATE__
|
||||
#define DATE __DATE__
|
17
gnu/packages/patches/python-3-deterministic-build-info.patch
Normal file
17
gnu/packages/patches/python-3-deterministic-build-info.patch
Normal file
|
@ -0,0 +1,17 @@
|
|||
Always provide the same date and time in 'Py_GetBuildInfo'.
|
||||
This is the information shown at the REPL and in 'sys.version'.
|
||||
We cannot pass it in CPPFLAGS due to whitespace in the DATE string.
|
||||
|
||||
--- Modules/getbuildinfo.c
|
||||
+++ Modules/getbuildinfo.c
|
||||
@@ -4,6 +4,10 @@
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
+/* Deterministic date and time. */
|
||||
+#define DATE "Jan 1 1970"
|
||||
+#define TIME "00:00:01"
|
||||
+
|
||||
#ifndef DATE
|
||||
#ifdef __DATE__
|
||||
#define DATE __DATE__
|
|
@ -94,6 +94,7 @@ (define-public python-2
|
|||
"1h7zbrf9pkj29hlm18b10548ch9757f75m64l47sy75rh43p7lqw"))
|
||||
(patches (map search-patch
|
||||
'("python-2.7-search-paths.patch"
|
||||
"python-2-deterministic-build-info.patch"
|
||||
"python-2.7-source-date-epoch.patch")))))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
|
@ -223,6 +224,7 @@ (define-public python
|
|||
'("python-fix-tests.patch"
|
||||
;; XXX Try removing this patch for python > 3.4.3
|
||||
"python-disable-ssl-test.patch"
|
||||
"python-3-deterministic-build-info.patch"
|
||||
"python-3-search-paths.patch")))
|
||||
(patch-flags '("-p0"))
|
||||
(sha256
|
||||
|
|
Loading…
Reference in a new issue