Subject: bug#30752: closed (Re: [bug#30752] [PATCH 1/1] gnu: Add Python 3.7.0b2.)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 29 Aug 2018 21:15:03 +0000

Your bug report

#30752: [PATCH 1/1] gnu: Add Python 3.7.0b2.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
30752: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=30752
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#30752] [PATCH 1/1] gnu: Add Python 3.7.0b2.
From: Leo Famulari <[email-masked]>
To: Hartmut Goebel <[email-masked]>
Cc: [email-masked]
Date: Wed, 29 Aug 2018 17:14:08 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

On Thu, Mar 08, 2018 at 06:02:00PM +0100, Hartmut Goebel wrote:
> Please note this is adding BETA 2. For the release the version and the
> source uri need to be adopted.
> 
> I need 3.7 for some other project, thus developed this patch. To avoid
> duplicate work by others, I decided to publish these even if Python 3.7
> currently is only beta.

Thanks!

Core-updates currently has 3.7.0, so I'm closing this bug.

Subject: [PATCH 1/1] gnu: Add Python 3.7.0b2.
From: Hartmut Goebel <[email-masked]>
To: [email-masked]
Date: Thu, 8 Mar 2018 17:48:50 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

* gnu/packages/python.scm (python-3.7): New variable.
* gnu/packages/patches/python-3.7-search-paths.patch: New file
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                                       |  1 +
 gnu/packages/patches/python-3.7-search-paths.patch | 16 ++++++++
 gnu/packages/python.scm                            | 44 ++++++++++++++++++++++
 3 files changed, 61 insertions(+)
 create mode 100644 gnu/packages/patches/python-3.7-search-paths.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 47eb1d988..fb69097bd 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1021,6 +1021,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-2.7-search-paths.patch		\
   %D%/packages/patches/python-2.7-site-prefixes.patch		\
   %D%/packages/patches/python-2.7-source-date-epoch.patch	\
+  %D%/packages/patches/python-3.7-search-paths.patch		\
   %D%/packages/patches/python-3-deterministic-build-info.patch	\
   %D%/packages/patches/python-3-search-paths.patch		\
   %D%/packages/patches/python-3-fix-tests.patch			\
diff --git a/gnu/packages/patches/python-3.7-search-paths.patch b/gnu/packages/patches/python-3.7-search-paths.patch
new file mode 100644
index 000000000..2960185fd
--- /dev/null
+++ b/gnu/packages/patches/python-3.7-search-paths.patch
@@ -0,0 +1,16 @@
+Make sure the build system honors C_INCLUDE_PATH and LIBRARY_PATH when
+looking for headers and libraries.
+
+--- setup.py	2018-03-08 09:57:52.993780176 +0100
++++ setup.py	2018-03-08 09:58:28.448240983 +0100
+@@ -594,8 +594,8 @@
+             add_dir_to_list(self.compiler.include_dirs,
+                             sysconfig.get_config_var("INCLUDEDIR"))
+ 
+-        system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib']
+-        system_include_dirs = ['/usr/include']
++        system_lib_dirs = os.getenv('LIBRARY_PATH', '').split(os.pathsep)
++        system_include_dirs = os.getenv('C_INCLUDE_PATH', '').split(os.pathsep)
+         # lib_dirs and inc_dirs are used to search for files;
+         # if a file is found in one of those directories, it can
+         # be assumed that no additional -I,-L directives are needed.
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 064d79002..50bb1e398 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -368,6 +368,50 @@ data types.")
                                         (version-major+minor version)
                                         "/site-packages"))))))))
 
+(define-public python-3.7
+  (package (inherit python-3.6)
+    (version "3.7.0b2")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://www.python.org/ftp/python/"
+                                  "3.7.0" "/Python-" version ".tar.xz"))
+              (patches (search-patches
+                        "python-fix-tests.patch"
+                        "python-3-fix-tests.patch"
+                        "python-3-deterministic-build-info.patch"
+                        "python-3.7-search-paths.patch"))
+              (patch-flags '("-p0"))
+              (sha256
+               (base32 "10n87x65gsw8lc7iqry2yfpaf4szncr8z40vm5hspkgxzbkjs24j"))
+              (snippet
+               '(begin
+                  (for-each
+                   delete-file
+                   '("Lib/ctypes/test/test_structures.py" ; fails on aarch64
+                     "Lib/ctypes/test/test_win32.py" ; fails on aarch64
+                     "Lib/test/test_fcntl.py")) ; fails on aarch64
+                  #t))))
+    (arguments
+     (substitute-keyword-arguments
+         (package-arguments python)
+       ((#:tests? _) #f)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           ;; Unset SOURCE_DATE_EPOCH while running the test-suite and set it
+           ;; again afterwards.
+           (add-before 'check 'unset-SOURCE_DATE_EPOCH
+             (lambda _
+               (unsetenv "SOURCE_DATE_EPOCH")))
+           (add-after 'check 'reset-SOURCE_DATE_EPOCH
+             (lambda _
+               (setenv "SOURCE_DATE_EPOCH" "1")))))))
+    (native-search-paths
+     (list (search-path-specification
+            (variable "PYTHONPATH")
+            (files (list (string-append "lib/python"
+                                        (version-major+minor version)
+                                        "/site-packages"))))))))
+
 ;; Current 3.x version.
 (define-public python-3 python-3.6)
 
-- 
2.13.6