unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#30302] [[PATCH core-updates]] gnu: python-gevent: Update to 1.2.2.
@ 2018-01-31 12:06 Marius Bakke
  2018-02-01 10:12 ` bug#30302: " Marius Bakke
  0 siblings, 1 reply; 2+ messages in thread
From: Marius Bakke @ 2018-01-31 12:06 UTC (permalink / raw)
  To: 30302

* gnu/packages/python.scm (python-gevent): Update to 1.2.2.
[source](snippet): Adjust to moved software bundles.  Remove greentest substitution.
[arguments]: Add #:modules.  Add phases 'unpack-libev', 'patch-hard-coded-paths'
and 'do-not-use-bundled-sources' and replace check phase with a custom command.
[native-inputs]: Add LIBEV source.
---
 gnu/packages/python.scm | 65 +++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 55 insertions(+), 10 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 9d9870032..edc6ea4e4 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -26,7 +26,7 @@
 ;;; Copyright © 2016, 2017 ng0 <ng0@infotropique.org>
 ;;; Copyright © 2016 Dylan Jeffers <sapientech@sapientech@openmailbox.org>
 ;;; Copyright © 2016 David Craven <david@craven.ch>
-;;; Copyright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2016, 2017, 2018 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2016, 2017 Stefan Reichör <stefan@xsteve.at>
 ;;; Copyright © 2016 Dylan Jeffers <sapientech@sapientech@openmailbox.org>
 ;;; Copyright © 2016, 2017 Alex Vong <alexvong1995@gmail.com>
@@ -8561,28 +8561,73 @@ are synchronized with data exchanges on \"channels\".")
 (define-public python-gevent
   (package
     (name "python-gevent")
-    (version "1.1.1")
+    (version "1.2.2")
     (source (origin
               (method url-fetch)
               (uri (pypi-uri "gevent" version))
               (sha256
                (base32
-                "1smf3kvidpdiyi2c81alal74p2zm0clrm6xbyy6y1k9a3f2vkrbf"))
+                "0bbbjvi423y9k9xagrcsimnayaqymg6f2dj76m9z3mjpkjpci4a7"))
               (modules '((guix build utils)))
               (snippet
                '(begin
                   ;; unbunding libev and c-ares
-                  (for-each delete-file-recursively '("libev" "c-ares"))
-                  ;; fixing testsuite
-                  (call-with-output-file "greentest/__init__.py" noop)
-                  (substitute* "greentest/testrunner.py"
-                    (("import util") "from . import util")
-                    (("from util import log") "from .util import log"))))))
+                  (delete-file-recursively "deps")
+                  #t))))
     (build-system python-build-system)
+    (arguments
+     `(#:modules ((ice-9 ftw)
+                  (srfi srfi-26)
+                  (guix build utils)
+                  (guix build python-build-system))
+       #:phases (modify-phases %standard-phases
+                  (add-after 'unpack 'unpack-libev
+                    (lambda* (#:key inputs #:allow-other-keys)
+                      (mkdir-p "deps/libev")
+                      ;; FIXME: gevent requires building libev, even though
+                      ;; it only links against the proper one.
+                      (invoke "tar" "-xf" (assoc-ref inputs "libev-source")
+                              "--strip-components=1" "-C" "deps/libev")))
+                  (add-before 'patch-source-shebangs 'patch-hard-coded-paths
+                    (lambda _
+                      (substitute* "src/gevent/subprocess.py"
+                        (("/bin/sh") (which "sh")))
+                      (for-each (lambda (file)
+                                  (substitute* file
+                                    (("/bin/sh") (which "sh"))
+                                    (("/bin/true") (which "true"))))
+                                (find-files "src/greentest" "\\.py$"))
+                      #t))
+                  (add-before 'build 'do-not-use-bundled-sources
+                    (lambda _
+                      (setenv "CONFIG_SHELL" (which "bash"))
+                      (setenv "LIBEV_EMBED" "false")
+                      (setenv "CARES_EMBED" "false")
+                      (setenv "EMBED" "false")
+                      #t))
+                  (replace 'check
+                    (lambda _
+                      ;; Make sure the build directory is on PYTHONPATH.
+                      (setenv "PYTHONPATH"
+                              (string-append
+                               (getenv "PYTHONPATH") ":"
+                               (getcwd) "/build/"
+                               (car (scandir "build" (cut string-prefix? "lib." <>)))))
+                      (with-directory-excursion "src/greentest"
+                        ;; XXX: Many tests require network access.  Instead we only
+                        ;; run known-good tests.  Unfortunately we cannot use
+                        ;; recursion here since this directory also contains
+                        ;; Python-version-specific subfolders.
+                        (apply invoke "python" "testrunner.py" "--config"
+                               "known_failures.py"
+                               (scandir "." (cut regexp-exec
+                                                 (make-regexp "test_+(subprocess|core)")
+                                                 <>)))))))))
     (propagated-inputs
      `(("python-greenlet" ,python-greenlet)))
     (native-inputs
-     `(("python-six" ,python-six)))
+     `(("libev-source" ,(package-source libev))
+       ("python-six" ,python-six)))
     (inputs
      `(("c-ares" ,c-ares)
        ("libev" ,libev)))
-- 
2.16.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* bug#30302: [[PATCH core-updates]] gnu: python-gevent: Update to 1.2.2.
  2018-01-31 12:06 [bug#30302] [[PATCH core-updates]] gnu: python-gevent: Update to 1.2.2 Marius Bakke
@ 2018-02-01 10:12 ` Marius Bakke
  0 siblings, 0 replies; 2+ messages in thread
From: Marius Bakke @ 2018-02-01 10:12 UTC (permalink / raw)
  To: 30302-done

[-- Attachment #1: Type: text/plain, Size: 511 bytes --]

Marius Bakke <mbakke@fastmail.com> writes:

> * gnu/packages/python.scm (python-gevent): Update to 1.2.2.
> [source](snippet): Adjust to moved software bundles.  Remove greentest substitution.
> [arguments]: Add #:modules.  Add phases 'unpack-libev', 'patch-hard-coded-paths'
> and 'do-not-use-bundled-sources' and replace check phase with a custom command.
> [native-inputs]: Add LIBEV source.

I pushed this as fcaab9c0e5b339c854a895803dd3b6113e513040 to
core-updates since it fixes a few dependent packages.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-02-01 10:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-31 12:06 [bug#30302] [[PATCH core-updates]] gnu: python-gevent: Update to 1.2.2 Marius Bakke
2018-02-01 10:12 ` bug#30302: " Marius Bakke

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).