diff mbox

gnu: Add python-cheetah.

Message ID d42c42dd-9d19-3b35-6487-6c4d9c7d125e@gmail.com
State New
Headers show

Commit Message

Manolis Ragkousis Aug. 16, 2016, 11:15 a.m. UTC
This patch adds python2-cheetah.

Manolis

Comments

Leo Famulari Aug. 18, 2016, 8:51 p.m. UTC | #1
On Tue, Aug 16, 2016 at 02:15:25PM +0300, Manolis Ragkousis wrote:
> This patch adds python2-cheetah.

Does this python2-cheetah work as expected? Needing to make changes to
the Python 2 version of a package is the reason we introduced the
python2-variant system.

> +(define-public python2-cheetah
> +  (let ((base (package-with-python2 python-cheetah)))
> +    (package
> +      (inherit base)
> +      (name "python2-cheetah")
> +      (native-inputs
> +       `(("python2-setuptools" ,python2-setuptools)
> +         ("python2-markdown" ,python2-markdown)
> +         ,@(package-native-inputs base))))))
> -- 
> 2.9.2
>
Manolis Ragkousis Aug. 21, 2016, 2:31 p.m. UTC | #2
Hello Leo,

> Does this python2-cheetah work as expected? Needing to make changes to
> the Python 2 version of a package is the reason we introduced the
> python2-variant system.

This package only works with python 2. Actually if you try to build
python-cheetah, you will get:

phase `patch-source-shebangs' succeeded after 0.0 seconds
starting phase `patch-generated-file-shebangs'
phase `patch-generated-file-shebangs' succeeded after 0.0 seconds
starting phase `build'
running "python setup.py" with command "build" and parameters ()
Traceback (most recent call last):
  File "setup.py", line 10, in <module>
    import SetupTools
  File
"/tmp/guix-build-python-cheetah-2.4.4.drv-0/Cheetah-2.4.4/SetupTools.py",
line 50
    except DistutilsPlatformError, x:
                                 ^
SyntaxError: invalid syntax

I followed the other recipes as an example to write this one. Only
python2-cheetah works as expected.

Thank you,
Manolis
Leo Famulari Aug. 21, 2016, 6:24 p.m. UTC | #3
On Sun, Aug 21, 2016 at 05:31:50PM +0300, Manolis Ragkousis wrote:
> Hello Leo,
> 
> > Does this python2-cheetah work as expected? Needing to make changes to
> > the Python 2 version of a package is the reason we introduced the
> > python2-variant system.
> 
> This package only works with python 2. Actually if you try to build
> python-cheetah, you will get:

Okay, I think we should only package the python-2 version of cheetah.
diff mbox

Patch

From 7899fa820ea826b71375d805185a99cf8de0fc8f Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis <manolis837@gmail.com>
Date: Tue, 16 Aug 2016 14:06:03 +0300
Subject: [PATCH] gnu: Add python-cheetah.

* gnu/packages/python.scm (python-cheetah, python2-cheetah): New variables.
---
 gnu/packages/python.scm | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 5cc54d0..a450a0c 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -24,6 +24,7 @@ 
 ;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
 ;;; Copyright © 2016 Troy Sankey <sankeytms@gmail.com>
 ;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
+;;; Copyright © 2016 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -9886,3 +9887,40 @@  relays publish about themselves.")
 
 (define-public python2-stem
   (package-with-python2 python-stem))
+
+(define-public python-cheetah
+  (package
+    (name "python-cheetah")
+    (version "2.4.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://pypi.python.org/packages/"
+             "cd/b0/c2d700252fc251e91c08639ff41a8a5203b627f4e0a2ae18a6b662ab32ea/"
+             "Cheetah-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0l5mm4lnysjkzpjr95q5ydm9xc8bv43fxmr79ypybrf1y0lq4c5y"))))
+    (build-system python-build-system)
+    (home-page "http://www.cheetahtemplate.org")
+    (synopsis
+     "Python-powered template engine and code generator")
+    (description
+     "Cheetah is an open source template engine and code generation tool.
+It can be used standalone or combined with other tools and frameworks. Web
+development is its principle use, but Cheetah is very flexible and is also
+being used to generate C++ game code, Java, sql, form emails and even Python
+ code.")
+    (license (non-copyleft "file://LICENSE"
+                                   "See COPYING in the distribution."))))
+
+(define-public python2-cheetah
+  (let ((base (package-with-python2 python-cheetah)))
+    (package
+      (inherit base)
+      (name "python2-cheetah")
+      (native-inputs
+       `(("python2-setuptools" ,python2-setuptools)
+         ("python2-markdown" ,python2-markdown)
+         ,@(package-native-inputs base))))))
-- 
2.9.2