unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 12/13] gnu: Add python2-pygtk.
  2014-11-21  5:40 [PATCH 00/13] Add gourmet (and dependent python packages) Eric Bavier
@ 2014-11-21  5:41 ` Eric Bavier
  2014-11-21 22:10   ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Bavier @ 2014-11-21  5:41 UTC (permalink / raw)
  To: guix-devel; +Cc: Eric Bavier

* 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

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

* Re: [PATCH 12/13] gnu: Add python2-pygtk.
  2014-11-21  5:41 ` [PATCH 12/13] gnu: Add python2-pygtk Eric Bavier
@ 2014-11-21 22:10   ` Ludovic Courtès
  0 siblings, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2014-11-21 22:10 UTC (permalink / raw)
  To: Eric Bavier; +Cc: guix-devel, Eric Bavier

Eric Bavier <ericbavier@gmail.com> 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’.

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

* [PATCH 12/13] gnu: Add python2-pygtk.
@ 2014-11-22 15:40 Federico Beffa
  2014-11-22 16:18 ` Eric Bavier
  0 siblings, 1 reply; 7+ messages in thread
From: Federico Beffa @ 2014-11-22 15:40 UTC (permalink / raw)
  To: ericbavier, Guix-devel, Ludovic Courtès

> Eric Bavier <ericbavier@gmail.com> 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

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

* Re: [PATCH 12/13] gnu: Add python2-pygtk.
  2014-11-22 15:40 [PATCH 12/13] gnu: Add python2-pygtk Federico Beffa
@ 2014-11-22 16:18 ` Eric Bavier
  2014-11-26  3:46   ` Eric Bavier
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Bavier @ 2014-11-22 16:18 UTC (permalink / raw)
  To: Federico Beffa; +Cc: Guix-devel

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

On Sat, Nov 22, 2014 at 9:40 AM, Federico Beffa <beffa@ieee.org> wrote:

> > Eric Bavier <ericbavier@gmail.com> 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

[-- Attachment #2: Type: text/html, Size: 1566 bytes --]

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

* Re: [PATCH 12/13] gnu: Add python2-pygtk.
  2014-11-22 16:18 ` Eric Bavier
@ 2014-11-26  3:46   ` Eric Bavier
  2014-11-26  8:30     ` Federico Beffa
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Bavier @ 2014-11-26  3:46 UTC (permalink / raw)
  To: Federico Beffa; +Cc: Guix-devel

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

On Sat, Nov 22, 2014 at 10:18 AM, Eric Bavier <ericbavier@gmail.com> wrote:

>
> On Sat, Nov 22, 2014 at 9:40 AM, Federico Beffa <beffa@ieee.org> wrote:
>
>> > Eric Bavier <ericbavier@gmail.com> 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

[-- Attachment #2: Type: text/html, Size: 1841 bytes --]

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

* Re: [PATCH 12/13] gnu: Add python2-pygtk.
  2014-11-26  3:46   ` Eric Bavier
@ 2014-11-26  8:30     ` Federico Beffa
  2014-11-26 16:50       ` Cyril Roelandt
  0 siblings, 1 reply; 7+ messages in thread
From: Federico Beffa @ 2014-11-26  8:30 UTC (permalink / raw)
  To: Eric Bavier; +Cc: Guix-devel

On Wed, Nov 26, 2014 at 4:46 AM, Eric Bavier <ericbavier@gmail.com> wrote:
>
>
> On Sat, Nov 22, 2014 at 10:18 AM, Eric Bavier <ericbavier@gmail.com> wrote:
>>
>>
>> On Sat, Nov 22, 2014 at 9:40 AM, Federico Beffa <beffa@ieee.org> wrote:
>>>
>>> > Eric Bavier <ericbavier@gmail.com> 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

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

* Re: [PATCH 12/13] gnu: Add python2-pygtk.
  2014-11-26  8:30     ` Federico Beffa
@ 2014-11-26 16:50       ` Cyril Roelandt
  0 siblings, 0 replies; 7+ messages in thread
From: Cyril Roelandt @ 2014-11-26 16:50 UTC (permalink / raw)
  To: guix-devel

On 11/26/2014 09:30 AM, Federico Beffa wrote:
> On Wed, Nov 26, 2014 at 4:46 AM, Eric Bavier <ericbavier@gmail.com> wrote:
>>
>>
>> On Sat, Nov 22, 2014 at 10:18 AM, Eric Bavier <ericbavier@gmail.com> wrote:
>>>
>>>
>>> On Sat, Nov 22, 2014 at 9:40 AM, Federico Beffa <beffa@ieee.org> wrote:
>>>>
>>>>> Eric Bavier <ericbavier@gmail.com> 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.

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

end of thread, other threads:[~2014-11-26 16:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-22 15:40 [PATCH 12/13] gnu: Add python2-pygtk Federico Beffa
2014-11-22 16:18 ` Eric Bavier
2014-11-26  3:46   ` Eric Bavier
2014-11-26  8:30     ` Federico Beffa
2014-11-26 16:50       ` Cyril Roelandt
  -- strict thread matches above, loose matches on Subject: below --
2014-11-21  5:40 [PATCH 00/13] Add gourmet (and dependent python packages) Eric Bavier
2014-11-21  5:41 ` [PATCH 12/13] gnu: Add python2-pygtk Eric Bavier
2014-11-21 22:10   ` Ludovic Courtès

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