guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/04: gnu: python-cffi: Move to libffi.scm


From: Efraim Flashner
Subject: 03/04: gnu: python-cffi: Move to libffi.scm
Date: Sun, 15 Oct 2017 04:57:29 -0400 (EDT)

efraim pushed a commit to branch master
in repository guix.

commit 0751fddd919d4cd7017500c155e5b24d4023d621
Author: Efraim Flashner <address@hidden>
Date:   Sun Oct 15 10:34:12 2017 +0300

    gnu: python-cffi: Move to libffi.scm
    
    * gnu/packages/python.scm (python-cffi): Move from here ...
    * gnu/packages/libffi.scm: ... to here.
    * gnu/packages/crypto.scm, gnu/packages/password-utils.scm: Adjust
    module imports.
---
 gnu/packages/crypto.scm         |  1 +
 gnu/packages/libffi.scm         | 81 ++++++++++++++++++++++++++++++++++++++++-
 gnu/packages/password-utils.scm |  1 +
 gnu/packages/python.scm         | 73 -------------------------------------
 4 files changed, 81 insertions(+), 75 deletions(-)

diff --git a/gnu/packages/crypto.scm b/gnu/packages/crypto.scm
index 8e3956a..427318d 100644
--- a/gnu/packages/crypto.scm
+++ b/gnu/packages/crypto.scm
@@ -35,6 +35,7 @@
   #:use-module (gnu packages image)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages libbsd)
+  #:use-module (gnu packages libffi)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages nettle)
   #:use-module (gnu packages password-utils)
diff --git a/gnu/packages/libffi.scm b/gnu/packages/libffi.scm
index 16475af..cc7297a 100644
--- a/gnu/packages/libffi.scm
+++ b/gnu/packages/libffi.scm
@@ -1,6 +1,8 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <address@hidden>
-;;; Copyright © 2016 Efraim Flashner <address@hidden>
+;;; Copyright © 2014 Federico Beffa <address@hidden>
+;;; Copyright © 2016, 2017 Efraim Flashner <address@hidden>
+;;; Copyright © 2017 Marius Bakke <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -22,7 +24,10 @@
   #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
-  #:use-module (guix build-system gnu))
+  #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages python)
+  #:use-module (guix build-system gnu)
+  #:use-module (guix build-system python))
 
 (define-public libffi
   (let ((post-install-phase
@@ -66,3 +71,75 @@ conversions for values passed between the two languages.")
     ;; See <https://github.com/atgreen/libffi/blob/master/LICENSE>.
     (license expat))))
 
+(define-public python-cffi
+  (package
+    (name "python-cffi")
+    (version "1.11.2")
+    (source
+     (origin
+      (method url-fetch)
+      (uri (pypi-uri "cffi" version))
+      (sha256
+       (base32 "19h0wwz9cww74gw8cyq0izj8zkhjyzjw2d3ks1c3f1y4q28xv1xb"))))
+    (build-system python-build-system)
+    (outputs '("out" "doc"))
+    (inputs
+     `(("libffi" ,libffi)))
+    (propagated-inputs ; required at run-time
+     `(("python-pycparser" ,python-pycparser)))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("python-sphinx" ,python-sphinx)
+       ("python-pytest" ,python-pytest)))
+    (arguments
+     `(#:modules ((ice-9 ftw)
+                  (srfi srfi-26)
+                  (guix build utils)
+                  (guix build python-build-system))
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'check
+           (lambda _
+             (setenv "PYTHONPATH"
+                     (string-append
+                      (getenv "PYTHONPATH")
+                      ":" (getcwd) "/build/"
+                      (car (scandir "build" (cut string-prefix? "lib." <>)))))
+
+             ;; XXX The "normal" approach of setting CC and friends does
+             ;; not work here.  Is this the correct way of doing things?
+             (substitute* "testing/embedding/test_basic.py"
+               (("c = distutils\\.ccompiler\\.new_compiler\\(\\)")
+                (string-append "c = distutils.ccompiler.new_compiler();"
+                               "c.set_executables(compiler='gcc',"
+                               "compiler_so='gcc',linker_exe='gcc',"
+                               "linker_so='gcc -shared')")))
+             (substitute* "testing/cffi0/test_ownlib.py"
+               (("'cc testownlib") "'gcc testownlib"))
+             (zero? (system* "py.test" "-v" "c/" "testing/"))))
+         (add-before 'check 'disable-failing-test
+           ;; This is assumed to be a libffi issue:
+           ;; 
https://bitbucket.org/cffi/cffi/issues/312/tests-failed-with-armv8
+           (lambda _
+             (substitute* "testing/cffi0/test_ownlib.py"
+               (("ret.left") "ownlib.left"))
+             #t))
+         (add-after 'install 'install-doc
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
+                    (doc (string-append data "/doc/" ,name "-" ,version))
+                    (html (string-append doc "/html")))
+               (with-directory-excursion "doc"
+                 (system* "make" "html")
+                 (mkdir-p html)
+                 (copy-recursively "build/html" html))
+               (copy-file "LICENSE" (string-append doc "/LICENSE"))
+               #t))))))
+    (home-page "https://cffi.readthedocs.org";)
+    (synopsis "Foreign function interface for Python")
+    (description
+     "Foreign Function Interface for Python calling C code.")
+    (license expat)))
+
+(define-public python2-cffi
+  (package-with-python2 python-cffi))
diff --git a/gnu/packages/password-utils.scm b/gnu/packages/password-utils.scm
index 52689a7..df6103f 100644
--- a/gnu/packages/password-utils.scm
+++ b/gnu/packages/password-utils.scm
@@ -46,6 +46,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages kerberos)
+  #:use-module (gnu packages libffi)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages man)
   #:use-module (gnu packages multiprecision)
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 1cfd988..cab910b 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -5134,79 +5134,6 @@ a front-end for C compilers or analysis tools.")
 (define-public python2-pycparser
   (package-with-python2 python-pycparser))
 
-(define-public python-cffi
-  (package
-    (name "python-cffi")
-    (version "1.11.2")
-    (source
-     (origin
-      (method url-fetch)
-      (uri (pypi-uri "cffi" version))
-      (sha256
-       (base32 "19h0wwz9cww74gw8cyq0izj8zkhjyzjw2d3ks1c3f1y4q28xv1xb"))))
-    (build-system python-build-system)
-    (outputs '("out" "doc"))
-    (inputs
-     `(("libffi" ,libffi)))
-    (propagated-inputs ; required at run-time
-     `(("python-pycparser" ,python-pycparser)))
-    (native-inputs
-     `(("pkg-config" ,pkg-config)
-       ("python-sphinx" ,python-sphinx)
-       ("python-pytest" ,python-pytest)))
-    (arguments
-     `(#:modules ((ice-9 ftw)
-                  (srfi srfi-26)
-                  (guix build utils)
-                  (guix build python-build-system))
-       #:phases
-       (modify-phases %standard-phases
-         (replace 'check
-           (lambda _
-             (setenv "PYTHONPATH"
-                     (string-append
-                      (getenv "PYTHONPATH")
-                      ":" (getcwd) "/build/"
-                      (car (scandir "build" (cut string-prefix? "lib." <>)))))
-
-             ;; XXX The "normal" approach of setting CC and friends does
-             ;; not work here.  Is this the correct way of doing things?
-             (substitute* "testing/embedding/test_basic.py"
-               (("c = distutils\\.ccompiler\\.new_compiler\\(\\)")
-                (string-append "c = distutils.ccompiler.new_compiler();"
-                               "c.set_executables(compiler='gcc',"
-                               "compiler_so='gcc',linker_exe='gcc',"
-                               "linker_so='gcc -shared')")))
-             (substitute* "testing/cffi0/test_ownlib.py"
-               (("'cc testownlib") "'gcc testownlib"))
-             (zero? (system* "py.test" "-v" "c/" "testing/"))))
-         (add-before 'check 'disable-failing-test
-           ;; This is assumed to be a libffi issue:
-           ;; 
https://bitbucket.org/cffi/cffi/issues/312/tests-failed-with-armv8
-           (lambda _
-             (substitute* "testing/cffi0/test_ownlib.py"
-               (("ret.left") "ownlib.left"))
-             #t))
-         (add-after 'install 'install-doc
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((data (string-append (assoc-ref outputs "doc") "/share"))
-                    (doc (string-append data "/doc/" ,name "-" ,version))
-                    (html (string-append doc "/html")))
-               (with-directory-excursion "doc"
-                 (system* "make" "html")
-                 (mkdir-p html)
-                 (copy-recursively "build/html" html))
-               (copy-file "LICENSE" (string-append doc "/LICENSE"))
-               #t))))))
-    (home-page "https://cffi.readthedocs.org";)
-    (synopsis "Foreign function interface for Python")
-    (description
-     "Foreign Function Interface for Python calling C code.")
-    (license license:expat)))
-
-(define-public python2-cffi
-  (package-with-python2 python-cffi))
-
 (define-public python-xcffib
   (package
     (name "python-xcffib")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]