unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add python2-shedskin.
@ 2016-03-29 22:27 Danny Milosavljevic
  2016-03-29 22:49 ` Danny Milosavljevic
  0 siblings, 1 reply; 9+ messages in thread
From: Danny Milosavljevic @ 2016-03-29 22:27 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/python.scm (python2-shedskin): New variable.
---
 b/gnu/packages/python.scm |   25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 88aef9d..64000c5 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -37,7 +37,7 @@
 (define-module (gnu packages python)
   #:use-module ((guix licenses)
                 #:select (asl2.0 bsd-4 bsd-3 bsd-2 non-copyleft cc0 x11 x11-style
-                          gpl2 gpl2+ gpl3+ lgpl2.0+ lgpl2.1 lgpl2.1+ lgpl3+ agpl3+
+                          gpl2 gpl2+ gpl3 gpl3+ lgpl2.0+ lgpl2.1 lgpl2.1+ lgpl3+ agpl3+
                           isc mpl2.0 psfl public-domain repoze unlicense x11-style
                           zpl2.1))
   #:use-module ((guix licenses) #:select (expat zlib) #:prefix license:)
@@ -76,6 +76,8 @@
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages zip)
   #:use-module (gnu packages tcl)
+  #:use-module (gnu packages bdw-gc)
+  #:use-module (gnu packages pcre)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix git-download)
@@ -8490,3 +8492,24 @@ is made as zipfile like as possible.")
 
 (define-public python2-rarfile
   (package-with-python2 python-rarfile))
+
+(define-public python2-shedskin
+ (package
+  (name "python2-shedskin")
+  (version "0.9.4")
+  (source
+    (origin
+      (method url-fetch)
+      (uri (string-append "https://github.com/shedskin/shedskin/releases/download/v" version "/shedskin-0.9.4.tgz"))
+      (sha256
+        (base32
+          "0nzwrzgw1ga8rw6f0ryq7zr9kkiavd1cqz5hzxkcbicl1dk7kz41"))))
+  (build-system python-build-system)
+  (arguments `(#:python ,python-2))
+  (inputs `(("libgc" ,libgc)))
+  (native-inputs `(("python2-setuptools" ,python2-setuptools)))
+  (propagated-inputs `(("pcre" ,pcre)))
+  (home-page "https://shedskin.github.io/")
+  (synopsis "Python Native Compiler")
+  (description "This is a native compiler for a subset of Python.  It generates C++ code and a Makefile.")
+  (license (list gpl3 bsd-3 expat))))

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

* Re: [PATCH] gnu: Add python2-shedskin.
  2016-03-29 22:27 [PATCH] gnu: Add python2-shedskin Danny Milosavljevic
@ 2016-03-29 22:49 ` Danny Milosavljevic
  2016-03-30  5:26   ` [PATCH v2] " Danny Milosavljevic
  0 siblings, 1 reply; 9+ messages in thread
From: Danny Milosavljevic @ 2016-03-29 22:49 UTC (permalink / raw)
  To: guix-devel

A question about this:

Shedskin results always #includes pcre.h and -lgc . Does this mean we should propagate both or is it expected that the user knows about those or should we patch the Shedskin Makefile generator so that it references specific inputs?

If the latter, see shedskin/makefile.py which uses (distutils) sysconfig.get_config_var('LIBS') and sysconfig.get_config_var('SYSLIBS') and others.

Those are probably Python's compilation flags. Should we extend those or rather patch shedskin/makefile.py to also get them from somewhere else?

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

* [PATCH v2] gnu: Add python2-shedskin.
  2016-03-29 22:49 ` Danny Milosavljevic
@ 2016-03-30  5:26   ` Danny Milosavljevic
  2016-04-06 22:19     ` Leo Famulari
  0 siblings, 1 reply; 9+ messages in thread
From: Danny Milosavljevic @ 2016-03-30  5:26 UTC (permalink / raw)
  To: guix-devel

Patch that does the latter. Is that OK?

* gnu/packages/python.scm (python2-shedskin): New variable.
---
 b/gnu/packages/python.scm |   36 +++++++++++++++++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 88aef9d..203aefc 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -37,7 +37,7 @@
 (define-module (gnu packages python)
   #:use-module ((guix licenses)
                 #:select (asl2.0 bsd-4 bsd-3 bsd-2 non-copyleft cc0 x11 x11-style
-                          gpl2 gpl2+ gpl3+ lgpl2.0+ lgpl2.1 lgpl2.1+ lgpl3+ agpl3+
+                          gpl2 gpl2+ gpl3 gpl3+ lgpl2.0+ lgpl2.1 lgpl2.1+ lgpl3+ agpl3+
                           isc mpl2.0 psfl public-domain repoze unlicense x11-style
                           zpl2.1))
   #:use-module ((guix licenses) #:select (expat zlib) #:prefix license:)
@@ -76,6 +76,8 @@
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages zip)
   #:use-module (gnu packages tcl)
+  #:use-module (gnu packages bdw-gc)
+  #:use-module (gnu packages pcre)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix git-download)
@@ -8490,3 +8492,35 @@ is made as zipfile like as possible.")
 
 (define-public python2-rarfile
   (package-with-python2 python-rarfile))
+
+(define-public python2-shedskin
+ (package
+  (name "python2-shedskin")
+  (version "0.9.4")
+  (source
+    (origin
+      (method url-fetch)
+      (uri (string-append "https://github.com/shedskin/shedskin/releases/download/v" version "/shedskin-0.9.4.tgz"))
+      (sha256
+        (base32
+          "0nzwrzgw1ga8rw6f0ryq7zr9kkiavd1cqz5hzxkcbicl1dk7kz41"))))
+  (build-system python-build-system)
+  (arguments `(#:python ,python-2
+               #:phases (modify-phases %standard-phases
+         (add-after 'unpack 'fix-resulting-include-libs
+          (lambda* (#:key inputs #:allow-other-keys)
+            (let ((libgc (assoc-ref inputs "libgc"))
+                  (pcre (assoc-ref inputs "pcre")))
+              (substitute* "shedskin/makefile.py"
+                (("variable == 'CCFLAGS':")
+                 (string-append "variable == 'CCFLAGS':\n            line += ' -I " pcre "/include -I " libgc "/include'"))
+                (("variable == 'LFLAGS':")
+                 (string-append "variable == 'LFLAGS':\n            line += ' -L" pcre "/lib -L " libgc "/lib'")))
+              #t))))))
+  (native-inputs `(("python2-setuptools" ,python2-setuptools)))
+  (inputs `(("pcre" ,pcre)
+            ("libgc" ,libgc)))
+  (home-page "https://shedskin.github.io/")
+  (synopsis "Python Native Compiler")
+  (description "This is a native compiler for a subset of Python.  It generates C++ code and a Makefile.")
+  (license (list gpl3 bsd-3 expat))))

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

* Re: [PATCH v2] gnu: Add python2-shedskin.
  2016-03-30  5:26   ` [PATCH v2] " Danny Milosavljevic
@ 2016-04-06 22:19     ` Leo Famulari
  2016-04-07 12:13       ` [PATCH v3] " Danny Milosavljevic
  0 siblings, 1 reply; 9+ messages in thread
From: Leo Famulari @ 2016-04-06 22:19 UTC (permalink / raw)
  To: Danny Milosavljevic; +Cc: guix-devel

On Wed, Mar 30, 2016 at 07:26:59AM +0200, Danny Milosavljevic wrote:
> Patch that does the latter. Is that OK?

If it works, then I think it's better than propagating pcre and libgc.

> * gnu/packages/python.scm (python2-shedskin): New variable.

> +      (uri (string-append "https://github.com/shedskin/shedskin/releases/download/v" version "/shedskin-0.9.4.tgz"))

Please use 'version' in place of 0.9.4 in the URL.

> +  (arguments `(#:python ,python-2

The home page says that it works with python 2.4 – 2.6. Is that a
problem? We don't package any versions within that range.

> +               #:phases (modify-phases %standard-phases
> +         (add-after 'unpack 'fix-resulting-include-libs
> +          (lambda* (#:key inputs #:allow-other-keys)
> +            (let ((libgc (assoc-ref inputs "libgc"))
> +                  (pcre (assoc-ref inputs "pcre")))
> +              (substitute* "shedskin/makefile.py"
> +                (("variable == 'CCFLAGS':")
> +                 (string-append "variable == 'CCFLAGS':\n            line += ' -I " pcre "/include -I " libgc "/include'"))
> +                (("variable == 'LFLAGS':")
> +                 (string-append "variable == 'LFLAGS':\n            line += ' -L" pcre "/lib -L " libgc "/lib'")))
> +              #t))))))

Overall, the indentation of 'arguments' is inconsistent. Can you try to
clean it up? If not, I can do it when committing your revised patch.

> +  (native-inputs `(("python2-setuptools" ,python2-setuptools)))
> +  (inputs `(("pcre" ,pcre)
> +            ("libgc" ,libgc)))
> +  (home-page "https://shedskin.github.io/")
> +  (synopsis "Python Native Compiler")

The word 'native' doesn't appear on the home-page or in any relevant
part of the code base. How about "Experimental Python-2 to C++
compiler". You know more about this program than me, but that seems
reasonable based on the software's documentation and web site.

> +  (description "This is a native compiler for a subset of Python.  It generates C++ code and a Makefile.")

As with the synopsis...

> +  (license (list gpl3 bsd-3 expat))))

Is the 'examples' directory included in the package when installed?
If so, those files have some more licenses that should be listed.

Can you send a revised patch, making sure to satisfy `./pre-inst-env guix
lint shedskin` before sending?

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

* [PATCH v3] gnu: Add python2-shedskin.
  2016-04-06 22:19     ` Leo Famulari
@ 2016-04-07 12:13       ` Danny Milosavljevic
  2016-04-07 12:28         ` [PATCH v4] " Danny Milosavljevic
  2016-04-07 15:16         ` [PATCH v3] " Leo Famulari
  0 siblings, 2 replies; 9+ messages in thread
From: Danny Milosavljevic @ 2016-04-07 12:13 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

On Wed, 6 Apr 2016 18:19:09 -0400
Leo Famulari <leo@famulari.name> wrote:

> On Wed, Mar 30, 2016 at 07:26:59AM +0200, Danny Milosavljevic wrote:
> > Patch that does the latter. Is that OK?  
> 
> If it works, then I think it's better than propagating pcre and libgc.

It does work. 

However, shedskin creates C++ source files and a Makefile. The user then has to manually compile them via "make".
So you have to have make and g++ installed in your profile in order to be able to actually have a native executable.
Now it refers to the libgc and pcre that shedskin used while it was installed, so you don't have to install those.
Not sure whether that's better than having the profile contain pcre and libgc, though.

> The home page says that it works with python 2.4 – 2.6. Is that a
> problem? We don't package any versions within that range.

I tested it with Python 2.7.10, it works fine. With Python 3 it doesn't work.

To try it, create empty directory, write a python program "blahblah.py" inside, then

$ shedskin blahblah.py
$ make

You'll end up with an executable "blahblah".

> Is the 'examples' directory included in the package when installed?

No. Should it?

> If so, those files have some more licenses that should be listed.

> Can you send a revised patch, making sure to satisfy `./pre-inst-env guix
> lint shedskin` before sending?

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 25bed2a..bdb164f 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -37,7 +37,7 @@
 (define-module (gnu packages python)
   #:use-module ((guix licenses)
                 #:select (asl2.0 bsd-4 bsd-3 bsd-2 non-copyleft cc0 x11 x11-style
-                          gpl2 gpl2+ gpl3+ lgpl2.0+ lgpl2.1 lgpl2.1+ lgpl3+ agpl3+
+                          gpl2 gpl2+ gpl3 gpl3+ lgpl2.0+ lgpl2.1 lgpl2.1+ lgpl3+ agpl3+
                           isc mpl2.0 psfl public-domain repoze unlicense x11-style
                           zpl2.1))
   #:use-module ((guix licenses) #:select (expat zlib) #:prefix license:)
@@ -8660,3 +8660,41 @@ LDFLAGS and parse the output to build extensions with setup.py.")
 (define-public python2-pkgconfig
   (package-with-python2 python-pkgconfig))
 
+(define-public python2-shedskin
+ (package
+  (name "python2-shedskin")
+  (version "0.9.4")
+  (source
+    (origin
+      (method url-fetch)
+      (uri (string-append "https://github.com/shedskin/shedskin/"
+                          "releases/download/v" version
+                          "/shedskin-" version ".tgz"))
+      (sha256
+        (base32
+          "0nzwrzgw1ga8rw6f0ryq7zr9kkiavd1cqz5hzxkcbicl1dk7kz41"))))
+  (build-system python-build-system)
+  (arguments `(#:python ,python-2
+               #:phases (modify-phases %standard-phases
+                         (add-after 'unpack 'fix-resulting-include-libs
+                          (lambda* (#:key inputs #:allow-other-keys)
+                           (let ((libgc (assoc-ref inputs "libgc"))
+                                 (pcre (assoc-ref inputs "pcre")))
+                            (substitute* "shedskin/makefile.py"
+                             (("variable == 'CCFLAGS':[ ]*")
+                              (string-append "variable == 'CCFLAGS':\n"
+                                             "            line += ' -I " pcre "/include"
+                                             " -I " libgc "/include'"))
+                             (("variable == 'LFLAGS':[ ]*")
+                              (string-append "variable == 'LFLAGS':\n"
+                                             "            line += ' -L" pcre "/lib"
+                                             " -L " libgc "/lib'")))
+                            #t))))))
+  (native-inputs `(("python2-setuptools" ,python2-setuptools)))
+  (inputs `(("pcre" ,pcre)
+            ("libgc" ,libgc)))
+  (home-page "https://shedskin.github.io/")
+  (synopsis "Experimental Python-2 to C++ Compiler")
+  (description (string-append "This is an experimental compiler for a subset of Python."
+                              "  It generates C++ code and a Makefile."))
+  (license (list license:gpl3 license:bsd-3 license:expat))))

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

* [PATCH v4] gnu: Add python2-shedskin.
  2016-04-07 12:13       ` [PATCH v3] " Danny Milosavljevic
@ 2016-04-07 12:28         ` Danny Milosavljevic
  2016-04-07 15:16         ` [PATCH v3] " Leo Famulari
  1 sibling, 0 replies; 9+ messages in thread
From: Danny Milosavljevic @ 2016-04-07 12:28 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 25bed2a..cd67083 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -37,7 +37,7 @@
 (define-module (gnu packages python)
   #:use-module ((guix licenses)
                 #:select (asl2.0 bsd-4 bsd-3 bsd-2 non-copyleft cc0 x11 x11-style
-                          gpl2 gpl2+ gpl3+ lgpl2.0+ lgpl2.1 lgpl2.1+ lgpl3+ agpl3+
+                          gpl2 gpl2+ gpl3 gpl3+ lgpl2.0+ lgpl2.1 lgpl2.1+ lgpl3+ agpl3+
                           isc mpl2.0 psfl public-domain repoze unlicense x11-style
                           zpl2.1))
   #:use-module ((guix licenses) #:select (expat zlib) #:prefix license:)
@@ -77,6 +77,8 @@
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages zip)
   #:use-module (gnu packages tcl)
+  #:use-module (gnu packages bdw-gc)
+  #:use-module (gnu packages pcre)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix git-download)
@@ -8660,3 +8662,41 @@ LDFLAGS and parse the output to build extensions with setup.py.")
 (define-public python2-pkgconfig
   (package-with-python2 python-pkgconfig))
 
+(define-public python2-shedskin
+ (package
+  (name "python2-shedskin")
+  (version "0.9.4")
+  (source
+    (origin
+      (method url-fetch)
+      (uri (string-append "https://github.com/shedskin/shedskin/"
+                          "releases/download/v" version
+                          "/shedskin-" version ".tgz"))
+      (sha256
+        (base32
+          "0nzwrzgw1ga8rw6f0ryq7zr9kkiavd1cqz5hzxkcbicl1dk7kz41"))))
+  (build-system python-build-system)
+  (arguments `(#:python ,python-2
+               #:phases (modify-phases %standard-phases
+                         (add-after 'unpack 'fix-resulting-include-libs
+                          (lambda* (#:key inputs #:allow-other-keys)
+                           (let ((libgc (assoc-ref inputs "libgc"))
+                                 (pcre (assoc-ref inputs "pcre")))
+                            (substitute* "shedskin/makefile.py"
+                             (("variable == 'CCFLAGS':[ ]*")
+                              (string-append "variable == 'CCFLAGS':\n"
+                                             "            line += ' -I " pcre "/include"
+                                             " -I " libgc "/include'"))
+                             (("variable == 'LFLAGS':[ ]*")
+                              (string-append "variable == 'LFLAGS':\n"
+                                             "            line += ' -L" pcre "/lib"
+                                             " -L " libgc "/lib'")))
+                            #t))))))
+  (native-inputs `(("python2-setuptools" ,python2-setuptools)))
+  (inputs `(("pcre" ,pcre)
+            ("libgc" ,libgc)))
+  (home-page "https://shedskin.github.io/")
+  (synopsis "Experimental Python-2 to C++ Compiler")
+  (description (string-append "This is an experimental compiler for a subset of Python."
+                              "  It generates C++ code and a Makefile."))
+  (license (list gpl3 bsd-3 license:expat))))

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

* Re: [PATCH v3] gnu: Add python2-shedskin.
  2016-04-07 12:13       ` [PATCH v3] " Danny Milosavljevic
  2016-04-07 12:28         ` [PATCH v4] " Danny Milosavljevic
@ 2016-04-07 15:16         ` Leo Famulari
  2016-04-25  2:04           ` Danny Milosavljevic
  1 sibling, 1 reply; 9+ messages in thread
From: Leo Famulari @ 2016-04-07 15:16 UTC (permalink / raw)
  To: Danny Milosavljevic; +Cc: guix-devel

On Thu, Apr 07, 2016 at 02:13:24PM +0200, Danny Milosavljevic wrote:
> On Wed, 6 Apr 2016 18:19:09 -0400
> Leo Famulari <leo@famulari.name> wrote:
> > If it works, then I think it's better than propagating pcre and libgc.
> 
> It does work. 
> 
> However, shedskin creates C++ source files and a Makefile. The user then has to manually compile them via "make".
> So you have to have make and g++ installed in your profile in order to be able to actually have a native executable.
> Now it refers to the libgc and pcre that shedskin used while it was installed, so you don't have to install those.
> Not sure whether that's better than having the profile contain pcre and libgc, though.

My instinct is that we should make it refer directly to the libraries
(pcre and libgc) but that user-facing executables like make and g++
should be installed by the user.

For example, our git package requires the user to install an ssh client
if they want to work with remote repositories. And our rsync package
also requires the user to install an ssh client for typical usage.

The examples may not be 100% relevant; is shedskin totally useless
without make and g++?

I'm not sure if there's an explicit policy on this subject. 

> > Is the 'examples' directory included in the package when installed?
> 
> No. Should it?

You know better than me :)

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

* Re: [PATCH v3] gnu: Add python2-shedskin.
  2016-04-07 15:16         ` [PATCH v3] " Leo Famulari
@ 2016-04-25  2:04           ` Danny Milosavljevic
  2016-05-01 17:52             ` Leo Famulari
  0 siblings, 1 reply; 9+ messages in thread
From: Danny Milosavljevic @ 2016-04-25  2:04 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

> My instinct is that we should make it refer directly to the libraries
> (pcre and libgc) but that user-facing executables like make and g++
> should be installed by the user.

Yeah, I did it like that in the existing patch.

> The examples may not be 100% relevant; is shedskin totally useless
> without make and g++?

Yes. Think of shedskin like cfront back in the day (the C++ -> C translator which was how C++ got to be).

> > > Is the 'examples' directory included in the package when installed?  
> > 
> > No. Should it?  

shedskin-examples is an extra downloadable package on https://shedskin.github.io/ so probably not.

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

* Re: [PATCH v3] gnu: Add python2-shedskin.
  2016-04-25  2:04           ` Danny Milosavljevic
@ 2016-05-01 17:52             ` Leo Famulari
  0 siblings, 0 replies; 9+ messages in thread
From: Leo Famulari @ 2016-05-01 17:52 UTC (permalink / raw)
  To: Danny Milosavljevic; +Cc: guix-devel

On Mon, Apr 25, 2016 at 04:04:59AM +0200, Danny Milosavljevic wrote:
> > My instinct is that we should make it refer directly to the libraries
> > (pcre and libgc) but that user-facing executables like make and g++
> > should be installed by the user.
> 
> Yeah, I did it like that in the existing patch.

Sorry I took soooo long to read v4 of your patch! :/

I've shifted the indentation of arguments down one line and to the left,
to keep the lines shorter than 80 characters. Same for the description.

Applied as 63bcec7140.

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

end of thread, other threads:[~2016-05-01 17:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-29 22:27 [PATCH] gnu: Add python2-shedskin Danny Milosavljevic
2016-03-29 22:49 ` Danny Milosavljevic
2016-03-30  5:26   ` [PATCH v2] " Danny Milosavljevic
2016-04-06 22:19     ` Leo Famulari
2016-04-07 12:13       ` [PATCH v3] " Danny Milosavljevic
2016-04-07 12:28         ` [PATCH v4] " Danny Milosavljevic
2016-04-07 15:16         ` [PATCH v3] " Leo Famulari
2016-04-25  2:04           ` Danny Milosavljevic
2016-05-01 17:52             ` Leo Famulari

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).