Fwd: Re: [PATCH 12/13] gnu: Add python2-pygtk.
Forwarded Message Subject: Re: [PATCH 12/13] gnu: Add python2-pygtk. Date: Wed, 26 Nov 2014 21:42:08 +0100 From: Andreas Enge To: Cyril Roelandt On Wed, Nov 26, 2014 at 05:50:49PM +0100, Cyril Roelandt wrote: > > I noticed that pygtk depends on pycairo and the home page of the > > latter provides two sources: one for python3 and one for python2. > > Maybe that's the package causing some troubles. > > http://cairographics.org/pycairo/ > Are the Python bindings currently built by the "cairo" package? If so, > which version is used? Andreas, do you know this? As I have not followed the discussion, my reply may be unhelpful... >From what I understand from the page http://www.cairographics.org/bindings/ the bindings are separate packages, which then also holds for pycairo. Nix has a separate pycairo package, and we would need to add one. The cairo package itself does not contain any bindings. Python is used as a native input; maybe for tests? So I would expect both python 2 and python 3 bindings to work with our cairo package. Andreas
Re: [PATCH 12/13] gnu: Add python2-pygtk.
On 11/26/2014 09:30 AM, Federico Beffa wrote: > On Wed, Nov 26, 2014 at 4:46 AM, Eric Bavier wrote: >> >> >> On Sat, Nov 22, 2014 at 10:18 AM, Eric Bavier wrote: >>> >>> >>> On Sat, Nov 22, 2014 at 9:40 AM, Federico Beffa wrote: > Eric Bavier skribis: > >> * gnu/packages/gtk.scm (python2-pygtk): New variable. > I notice that most python packages are defined for python 3 and then a python2 package is generated with the procedure 'package-with-python2'. Is pygtk problematic with python 3? >>> >>> >>> It has been a while since I did the packaging work for this python2-pygtk, >>> and I seem to recall that there was some sort of difficulty with python3. >> >> >> It looks possible, but from what I can tell, it might require more work on >> the packages that pygtk depends on, some of which aren't compatible with >> python3 or would requires updates to work with python3. >> > > I noticed that pygtk depends on pycairo and the home page of the > latter provides two sources: one for python3 and one for python2. > Maybe that's the package causing some troubles. > > http://cairographics.org/pycairo/ > Are the Python bindings currently built by the "cairo" package? If so, which version is used? Andreas, do you know this? Cyril.
Re: [PATCH 12/13] gnu: Add python2-pygtk.
On Wed, Nov 26, 2014 at 4:46 AM, Eric Bavier wrote: > > > On Sat, Nov 22, 2014 at 10:18 AM, Eric Bavier wrote: >> >> >> On Sat, Nov 22, 2014 at 9:40 AM, Federico Beffa wrote: >>> >>> > Eric Bavier skribis: >>> > >>> >> * gnu/packages/gtk.scm (python2-pygtk): New variable. >>> > >>> >>> I notice that most python packages are defined for python 3 and then a >>> python2 package is generated with the procedure 'package-with-python2'. >>> Is pygtk problematic with python 3? >> >> >> It has been a while since I did the packaging work for this python2-pygtk, >> and I seem to recall that there was some sort of difficulty with python3. > > > It looks possible, but from what I can tell, it might require more work on > the packages that pygtk depends on, some of which aren't compatible with > python3 or would requires updates to work with python3. > I noticed that pygtk depends on pycairo and the home page of the latter provides two sources: one for python3 and one for python2. Maybe that's the package causing some troubles. http://cairographics.org/pycairo/ Thanks for looking into this! Fede
Re: [PATCH 12/13] gnu: Add python2-pygtk.
On Sat, Nov 22, 2014 at 10:18 AM, Eric Bavier wrote: > > On Sat, Nov 22, 2014 at 9:40 AM, Federico Beffa wrote: > >> > Eric Bavier skribis: >> > >> >> * gnu/packages/gtk.scm (python2-pygtk): New variable. >> > >> >> I notice that most python packages are defined for python 3 and then a >> python2 package is generated with the procedure 'package-with-python2'. >> Is pygtk problematic with python 3? >> > > It has been a while since I did the packaging work for this python2-pygtk, > and I seem to recall that there was some sort of difficulty with python3. > It looks possible, but from what I can tell, it might require more work on the packages that pygtk depends on, some of which aren't compatible with python3 or would requires updates to work with python3. `~Eric -- Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html
Re: [PATCH 12/13] gnu: Add python2-pygtk.
On Sat, Nov 22, 2014 at 9:40 AM, Federico Beffa wrote: > > Eric Bavier skribis: > > > >> * gnu/packages/gtk.scm (python2-pygtk): New variable. > > > > I notice that most python packages are defined for python 3 and then a > python2 package is generated with the procedure 'package-with-python2'. > Is pygtk problematic with python 3? > It has been a while since I did the packaging work for this python2-pygtk, and I seem to recall that there was some sort of difficulty with python3. > I would be interested in using it > with a package for matplotlib that I'm preparing. > I will take another look at it, being that it would be useful to you. Thanks for asking, `~Eric -- Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html
[PATCH 12/13] gnu: Add python2-pygtk.
> Eric Bavier skribis: > >> * gnu/packages/gtk.scm (python2-pygtk): New variable. > I notice that most python packages are defined for python 3 and then a python2 package is generated with the procedure 'package-with-python2'. Is pygtk problematic with python 3? I would be interested in using it with a package for matplotlib that I'm preparing. Regards, Fede
Re: [PATCH 12/13] gnu: Add python2-pygtk.
Eric Bavier skribis: > * gnu/packages/gtk.scm (python2-pygtk): New variable. [...] > + #:phases (alist-cons-after > + 'install 'install-pth > + (lambda* (#:key inputs outputs #:allow-other-keys) > + (let* ((out(assoc-ref outputs "out")) > + (site (string-append out "/lib/python" > + ,(version-major+minor > + (package-version > python-2)) > + "/site-packages"))) > + (call-with-output-file (string-append site "/pygtk.pth") > + (lambda (port) > + (format port "gtk-2.0~%") Please add a comment below ‘lambda*’ explaining what’s being done here. > +(synopsis "Python bindings for GTK") “GTK+” > +(description > + "PyGTK allows you to write full featured GTK programs in Python. It is > +targetted at GTK 2.x, and can be used in conjunction with gnome-python to > +write Gnome applications.") Should be “GTK+” and “GNOME”. OK to push with these changes! Ludo’.
[PATCH 12/13] gnu: Add python2-pygtk.
* gnu/packages/gtk.scm (python2-pygtk): New variable. --- gnu/packages/gtk.scm | 49 - 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm index d8c8a29..a4b336b 100644 --- a/gnu/packages/gtk.scm +++ b/gnu/packages/gtk.scm @@ -25,6 +25,7 @@ #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system gnu) + #:use-module (guix build-system python) #:use-module (gnu packages compression) #:use-module (gnu packages fontutils) #:use-module (gnu packages ghostscript) @@ -38,7 +39,8 @@ #:use-module (gnu packages python) #:use-module (gnu packages guile) #:use-module (gnu packages xml) - #:use-module (gnu packages xorg)) + #:use-module (gnu packages xorg) + #:use-module ((srfi srfi-1) #:select (take))) (define-public atk (package @@ -630,3 +632,48 @@ extensive documentation, including API reference and a tutorial.") ("atkmm" ,atkmm) ("gtk+" ,gtk+-2) ("glibmm" ,glibmm) + +(define-public python2-pygtk + (package +(name "python2-pygtk") +(version "2.24.0") +(source + (origin + (method url-fetch) + (uri (string-append "http://ftp.gnome.org/pub/GNOME/sources"; + "/pygtk/" (version-major+minor version) + "/pygtk-" version ".tar.bz2")) + (sha256 + (base32 +"04k942gn8vl95kwf0qskkv6npclfm31d78ljkrkgyqxxcni1w76d" +(build-system gnu-build-system) +(native-inputs + `(("pkg-config" ,pkg-config))) +(inputs + `(("python" ,python-2) + ("glib" ,glib))) +(propagated-inputs + `(("python-pycairo" ,python2-py2cairo);loaded at runtime + ("python-pygobject" ,python2-pygobject-2) ;referenced in pc file + ("gtk+" ,gtk+-2))) +(arguments + `(#:tests? #f + #:phases (alist-cons-after + 'install 'install-pth + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out(assoc-ref outputs "out")) + (site (string-append out "/lib/python" + ,(version-major+minor + (package-version python-2)) + "/site-packages"))) + (call-with-output-file (string-append site "/pygtk.pth") + (lambda (port) + (format port "gtk-2.0~%") + %standard-phases))) +(home-page "http://www.pygtk.org/";) +(synopsis "Python bindings for GTK") +(description + "PyGTK allows you to write full featured GTK programs in Python. It is +targetted at GTK 2.x, and can be used in conjunction with gnome-python to +write Gnome applications.") +(license license:lgpl2.1+))) -- 1.7.9.5