all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add Cython
@ 2014-10-20 18:43 Federico Beffa
  2014-10-20 21:15 ` Eric Bavier
  2014-10-23  6:25 ` Andreas Enge
  0 siblings, 2 replies; 13+ messages in thread
From: Federico Beffa @ 2014-10-20 18:43 UTC (permalink / raw)
  To: Guix-devel

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

In preparing this package I've found that the python-build-system (not
sure about the others) defines the environment variable HOME as
"/homeless-shelter". However, that directory does not exist in the
build chroot. This is a problem for cython, because it wants to access
$HOME/.cython. Wouldn't it be better to point HOME to an existing
directory (created in the chroot) with suitable permissions?

I'm a little bit unsure about the name of the package. I've not
prefixed it with "python[2]-" as the program extends the Python
language and can work with both (2 and 3) Python version series.
However, the package installs files in
".../lib/python${version}/site-packages/...". The naming is in-line
with Debian naming.


Regards,
Fede

[-- Attachment #2: 0001-gnu-Add-Cython.patch --]
[-- Type: text/x-patch, Size: 2529 bytes --]

From b9e7cdb367518547be3d8bc535828a0d1f1ac96e Mon Sep 17 00:00:00 2001
From: Federico Beffa <beffa@fbengineering.ch>
Date: Mon, 20 Oct 2014 19:52:45 +0200
Subject: [PATCH] gnu: Add Cython

* gnu/packages/python.scm(cython,cython2): New variables
---
 gnu/packages/python.scm | 50 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 897e248..f8503c3 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -37,6 +37,7 @@
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages zip)
+  #:use-module (gnu packages gcc)
   #:use-module (gnu packages multiprecision)
   #:use-module (guix packages)
   #:use-module (guix download)
@@ -1832,3 +1833,52 @@ sources.")
 
 (define-public python2-sphinx
   (package-with-python2 python-sphinx))
+
+(define-public cython
+  (package
+    (name "cython")
+    (version "0.21.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "http://cython.org/release/Cython-"
+             version ".tar.gz"))
+       (sha256
+        (base32
+         "0ddz2l2dvcy5hdkxx4xlfiwpccvwia7ixgcy4h0pdv46a4i4vxj3"))))
+    (build-system python-build-system)
+    (inputs
+     `(("python" ,python))) ; otherwise ld doesn't find libpython3.3m.so
+    (arguments
+     `(#:phases
+       (alist-replace
+        'build
+        (lambda* (#:key outputs inputs 
+                  #:allow-other-keys #:rest args)
+          (let ((build (assoc-ref %standard-phases 'build)))
+            (setenv "HOME" "/tmp") ; some tests require access to "$HOME/.cython"
+            (apply build args)))
+        (alist-replace
+         'check
+         (lambda _ (zero? 
+                    (system* "python" 
+                             "runtests.py" 
+                             "-vv")))
+         %standard-phases))))
+    (home-page "http://cython.org/")
+    (synopsis "C extensions for Python")
+    (description "Cython is an optimising static compiler for both the Python
+programming language and the extended Cython programming language.  It makes
+writing C extensions for Python as easy as Python itself.")
+    (license asl2.0)))
+
+(define-public cython2
+  (package 
+    (inherit cython)
+    (name "cython2")
+    (build-system python-build-system)
+    (inputs
+     `(("python-2" ,python-2)))
+    (arguments
+     `(#:python ,python-2 ,@(package-arguments cython)))))
-- 
1.8.4


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

end of thread, other threads:[~2014-11-03 21:15 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-20 18:43 [PATCH] gnu: Add Cython Federico Beffa
2014-10-20 21:15 ` Eric Bavier
2014-10-21 16:16   ` Federico Beffa
2014-10-23  6:25 ` Andreas Enge
2014-10-24 15:51   ` Federico Beffa
2014-10-24 19:50     ` Andreas Enge
2014-10-25  7:18       ` Federico Beffa
2014-11-03 16:57     ` Ludovic Courtès
2014-11-03 17:00       ` Andreas Enge
2014-11-03 19:42         ` Ludovic Courtès
2014-11-03 19:50           ` Andreas Enge
2014-11-03 20:12             ` Federico Beffa
2014-11-03 21:15               ` Federico Beffa

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.