summary refs log tree commit diff
path: root/gnu/packages
diff options
context:
space:
mode:
authorFederico Beffa <beffa@fbengineering.ch>2014-12-09 15:58:24 +0100
committerFederico Beffa <beffa@fbengineering.ch>2014-12-10 14:27:44 +0100
commit57c3f71632692d1e2e12e5d2db5c2cc4c6e075c9 (patch)
tree53e9c211ccddefe739a4cd6d77e5946375ffd818 /gnu/packages
parent6c2cf86edb04adb3a74bf4099fd9a8ad4f8c5ae1 (diff)
downloadguix-57c3f71632692d1e2e12e5d2db5c2cc4c6e075c9.tar.gz
gnu: Add cffi.
* gnu/packages/python.scm (python-cffi, python2-cffi): New variables.
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/python.scm45
1 files changed, 45 insertions, 0 deletions
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index c30cffa68c..67effe77d6 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -2496,3 +2496,48 @@ 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 "0.8.6")
+    (source
+     (origin
+      (method url-fetch)
+      (uri (string-append "https://pypi.python.org/packages/source/c/"
+                          "cffi/cffi-" version ".tar.gz"))
+      (sha256 
+       (base32 "0406j3sgndmx88idv5zxkkrwfqxmjl18pj8gf47nsg4ymzixjci5"))))
+    (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-setuptools" ,python-setuptools)))
+    (arguments
+     `(#:tests? #f ; FIXME: requires pytest
+       #:phases 
+       (alist-cons-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"))))
+        %standard-phases)))
+    (home-page "http://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))