* [PATCH] Add gtklick.
@ 2016-02-26 7:10 Ricardo Wurmus
2016-02-26 23:38 ` Ludovic Courtès
0 siblings, 1 reply; 4+ messages in thread
From: Ricardo Wurmus @ 2016-02-26 7:10 UTC (permalink / raw)
To: guix-devel
[-- Attachment #1: Type: text/plain, Size: 171 bytes --]
Hi Guix,
this patch set adds a graphical user interface for the metronome
“klick”.
The patch to pygtk is needed to build the Python bindings for glade.
~~ Ricardo
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-pyliblo.patch --]
[-- Type: text/x-patch, Size: 2112 bytes --]
From 76cb9cb91b76f4bb723030d3d5a63238cdf98e20 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <rekado@elephly.net>
Date: Thu, 25 Feb 2016 09:45:05 +0100
Subject: [PATCH 1/3] gnu: Add pyliblo.
* gnu/packages/audio.scm (python-pyliblo, python2-pyliblo): New
variables.
---
gnu/packages/audio.scm | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index 4c4322d..1bc3143 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -30,6 +30,7 @@
#:use-module (guix build-system waf)
#:use-module (guix build-system trivial)
#:use-module (guix build-system cmake)
+ #:use-module (guix build-system python)
#:use-module (gnu packages)
#:use-module (gnu packages algebra)
#:use-module (gnu packages autotools)
@@ -946,6 +947,34 @@ essential distortions.")
implementation of the Open Sound Control (OSC) protocol.")
(license license:lgpl2.1+)))
+(define-public python-pyliblo
+ (package
+ (name "python-pyliblo")
+ (version "0.10.0")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "http://das.nasophon.de/download/pyliblo-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "13vry6xhxm7adnbyj28w1kpwrh0kf7nw83cz1yq74wl21faz2rzw"))))
+ (build-system python-build-system)
+ (arguments `(#:tests? #f)) ;no tests
+ (inputs
+ `(("python-cython" ,python-cython)
+ ("liblo" ,liblo)))
+ (home-page "http://das.nasophon.de/pyliblo/")
+ (synopsis "Python bindings for the liblo OSC library")
+ (description
+ "Pyliblo is a Python wrapper for the liblo OSC library. It supports
+almost the complete functionality of liblo, allowing you to send and receive
+OSC messages using a nice and simple Python API. Also included are the
+command line utilities @code{send_osc} and @code{dump_osc}.")
+ (license license:lgpl2.1+)))
+
+(define-public python2-pyliblo
+ (package-with-python2 python-pyliblo))
+
(define-public lilv
(package
(name "lilv")
--
2.6.3
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-gnu-python2-pygtk-Add-libglade-to-inputs.patch --]
[-- Type: text/x-patch, Size: 817 bytes --]
From 1dc15ad2e3776904ff8b838add00d66d9671b48a Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <rekado@elephly.net>
Date: Fri, 26 Feb 2016 08:05:40 +0100
Subject: [PATCH 2/3] gnu: python2-pygtk: Add libglade to inputs.
* gnu/packages/gtk.scm (python2-pygtk)[inputs]: Add "libglade".
---
gnu/packages/gtk.scm | 1 +
1 file changed, 1 insertion(+)
diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index a234b89..671922b 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -1013,6 +1013,7 @@ extensive documentation, including API reference and a tutorial.")
`(("pkg-config" ,pkg-config)))
(inputs
`(("python" ,python-2)
+ ("libglade" ,libglade)
("glib" ,glib)))
(propagated-inputs
`(("python-pycairo" ,python2-pycairo) ;loaded at runtime
--
2.6.3
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: 0003-gnu-Add-gtklick.patch --]
[-- Type: text/x-patch, Size: 2782 bytes --]
From cfda70fdd6448980df9ba4c22894198366a2846d Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <rekado@elephly.net>
Date: Thu, 25 Feb 2016 09:46:01 +0100
Subject: [PATCH 3/3] gnu: Add gtklick.
* gnu/packages/music.scm (gtklick): New variable.
---
gnu/packages/music.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 48 insertions(+)
diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm
index 29da01b..d789cc3 100644
--- a/gnu/packages/music.scm
+++ b/gnu/packages/music.scm
@@ -225,6 +225,54 @@ enable professional yet simple and intuitive pattern-based drum programming.")
you to define complex tempo maps for entire songs or performances.")
(license license:gpl2+)))
+(define-public gtklick
+ (package
+ (name "gtklick")
+ (version "0.6.4")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "http://das.nasophon.de/download/gtklick-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "0dq1km6njnzsqdqyf6wzir9g733z0mc9vmxfg2383k3c2a2di6bp"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:tests? #f ; no tests
+ #:python ,python-2
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'add-sitedirs
+ ;; .pth files are not automatically interpreted unless the
+ ;; directories containing them are added as "sites". The directories
+ ;; are then added to those in the PYTHONPATH. This is required for
+ ;; the operation of pygtk.
+ (lambda _
+ (substitute* "gtklick/gtklick.py"
+ (("import pygtk")
+ "import pygtk, site, sys
+for path in [path for path in sys.path if 'site-packages' in path]: site.addsitedir(path)"))))
+ (add-after 'unpack 'inject-store-path-to-klick
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "gtklick/klick_backend.py"
+ (("KLICK_PATH = 'klick'")
+ (string-append "KLICK_PATH = '"
+ (assoc-ref inputs "klick")
+ "/bin/klick'")))
+ #t)))))
+ (inputs
+ `(("klick" ,klick)
+ ("python2-pyliblo" ,python2-pyliblo)
+ ("python2-pygtk" ,python2-pygtk)))
+ (native-inputs
+ `(("gettext" ,gnu-gettext)))
+ (home-page "http://das.nasophon.de/gtklick/")
+ (synopsis "Simple metronome with an easy-to-use graphical interface")
+ (description
+ "Gtklick is a simple metronome with an easy-to-use graphical user
+interface. It is implemented as a frontend to @code{klick}.")
+ (license license:gpl2+)))
+
(define-public lilypond
(package
(name "lilypond")
--
2.6.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Add gtklick.
2016-02-26 7:10 [PATCH] Add gtklick Ricardo Wurmus
@ 2016-02-26 23:38 ` Ludovic Courtès
2016-02-27 9:17 ` Ricardo Wurmus
0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2016-02-26 23:38 UTC (permalink / raw)
To: Ricardo Wurmus; +Cc: guix-devel
Ricardo Wurmus <rekado@elephly.net> skribis:
> From 76cb9cb91b76f4bb723030d3d5a63238cdf98e20 Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <rekado@elephly.net>
> Date: Thu, 25 Feb 2016 09:45:05 +0100
> Subject: [PATCH 1/3] gnu: Add pyliblo.
>
> * gnu/packages/audio.scm (python-pyliblo, python2-pyliblo): New
> variables.
[...]
> + (home-page "http://das.nasophon.de/pyliblo/")
> + (synopsis "Python bindings for the liblo OSC library")
Maybe just “Python bindings for liblo”, and…
> + (description
> + "Pyliblo is a Python wrapper for the liblo OSC library. It supports
“… for the liblo Open Sound Control (OSC) library.”
Otherwise LGTM.
> From 1dc15ad2e3776904ff8b838add00d66d9671b48a Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <rekado@elephly.net>
> Date: Fri, 26 Feb 2016 08:05:40 +0100
> Subject: [PATCH 2/3] gnu: python2-pygtk: Add libglade to inputs.
>
> * gnu/packages/gtk.scm (python2-pygtk)[inputs]: Add "libglade".
OK.
> From cfda70fdd6448980df9ba4c22894198366a2846d Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <rekado@elephly.net>
> Date: Thu, 25 Feb 2016 09:46:01 +0100
> Subject: [PATCH 3/3] gnu: Add gtklick.
>
> * gnu/packages/music.scm (gtklick): New variable.
[...]
> + (modify-phases %standard-phases
> + (add-before 'build 'add-sitedirs
> + ;; .pth files are not automatically interpreted unless the
> + ;; directories containing them are added as "sites". The directories
> + ;; are then added to those in the PYTHONPATH. This is required for
> + ;; the operation of pygtk.
Strangely, other users of pygtk don’t do that, no? What’s special here?
> + (lambda _
> + (substitute* "gtklick/gtklick.py"
> + (("import pygtk")
> + "import pygtk, site, sys
> +for path in [path for path in sys.path if 'site-packages' in path]: site.addsitedir(path)"))))
I guess it’s a list comprehension, but I’m a bit confused by the syntax
and the various ‘path’. Oh well. :-)
Thanks!
Ludo’.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Add gtklick.
2016-02-26 23:38 ` Ludovic Courtès
@ 2016-02-27 9:17 ` Ricardo Wurmus
2016-02-28 15:48 ` Ludovic Courtès
0 siblings, 1 reply; 4+ messages in thread
From: Ricardo Wurmus @ 2016-02-27 9:17 UTC (permalink / raw)
To: Ludovic Courtès; +Cc: guix-devel
Ludovic Courtès <ludo@gnu.org> writes:
> Ricardo Wurmus <rekado@elephly.net> skribis:
>
>> From 76cb9cb91b76f4bb723030d3d5a63238cdf98e20 Mon Sep 17 00:00:00 2001
>> From: Ricardo Wurmus <rekado@elephly.net>
>> Date: Thu, 25 Feb 2016 09:45:05 +0100
>> Subject: [PATCH 1/3] gnu: Add pyliblo.
>>
>> * gnu/packages/audio.scm (python-pyliblo, python2-pyliblo): New
>> variables.
>
> [...]
>
>> + (home-page "http://das.nasophon.de/pyliblo/")
>> + (synopsis "Python bindings for the liblo OSC library")
>
> Maybe just “Python bindings for liblo”, and…
>
>> + (description
>> + "Pyliblo is a Python wrapper for the liblo OSC library. It supports
>
> “… for the liblo Open Sound Control (OSC) library.”
Okay.
>> From 1dc15ad2e3776904ff8b838add00d66d9671b48a Mon Sep 17 00:00:00 2001
>> From: Ricardo Wurmus <rekado@elephly.net>
>> Date: Fri, 26 Feb 2016 08:05:40 +0100
>> Subject: [PATCH 2/3] gnu: python2-pygtk: Add libglade to inputs.
>>
>> * gnu/packages/gtk.scm (python2-pygtk)[inputs]: Add "libglade".
>
> OK.
>
>> From cfda70fdd6448980df9ba4c22894198366a2846d Mon Sep 17 00:00:00 2001
>> From: Ricardo Wurmus <rekado@elephly.net>
>> Date: Thu, 25 Feb 2016 09:46:01 +0100
>> Subject: [PATCH 3/3] gnu: Add gtklick.
>>
>> * gnu/packages/music.scm (gtklick): New variable.
>
> [...]
>
>> + (modify-phases %standard-phases
>> + (add-before 'build 'add-sitedirs
>> + ;; .pth files are not automatically interpreted unless the
>> + ;; directories containing them are added as "sites". The directories
>> + ;; are then added to those in the PYTHONPATH. This is required for
>> + ;; the operation of pygtk.
>
> Strangely, other users of pygtk don’t do that, no? What’s special here?
Some do (and I don’t know why). I lifted this phase from “solfege”,
which also won’t run without this.
>> + (lambda _
>> + (substitute* "gtklick/gtklick.py"
>> + (("import pygtk")
>> + "import pygtk, site, sys
>> +for path in [path for path in sys.path if 'site-packages' in path]: site.addsitedir(path)"))))
>
> I guess it’s a list comprehension, but I’m a bit confused by the syntax
> and the various ‘path’. Oh well. :-)
The Scheme equivalent is something like this:
(for-each site.addsitedir
(filter (cut string-contains <> "site-packages")
sys.path))
The bracketed expression in Python is like the ‘(filter ...)’
expression.
I don’t know if this could be expressed any clearer in plain Python
without making this much longer.
~~ Ricardo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Add gtklick.
2016-02-27 9:17 ` Ricardo Wurmus
@ 2016-02-28 15:48 ` Ludovic Courtès
0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2016-02-28 15:48 UTC (permalink / raw)
To: Ricardo Wurmus; +Cc: guix-devel
Ricardo Wurmus <rekado@elephly.net> skribis:
> Ludovic Courtès <ludo@gnu.org> writes:
[...]
>>> From cfda70fdd6448980df9ba4c22894198366a2846d Mon Sep 17 00:00:00 2001
>>> From: Ricardo Wurmus <rekado@elephly.net>
>>> Date: Thu, 25 Feb 2016 09:46:01 +0100
>>> Subject: [PATCH 3/3] gnu: Add gtklick.
>>>
>>> * gnu/packages/music.scm (gtklick): New variable.
>>
>> [...]
>>
>>> + (modify-phases %standard-phases
>>> + (add-before 'build 'add-sitedirs
>>> + ;; .pth files are not automatically interpreted unless the
>>> + ;; directories containing them are added as "sites". The directories
>>> + ;; are then added to those in the PYTHONPATH. This is required for
>>> + ;; the operation of pygtk.
>>
>> Strangely, other users of pygtk don’t do that, no? What’s special here?
>
> Some do (and I don’t know why). I lifted this phase from “solfege”,
> which also won’t run without this.
OK, fair enough.
Eventually we’ll have to see if we can factorize this.
>>> + (lambda _
>>> + (substitute* "gtklick/gtklick.py"
>>> + (("import pygtk")
>>> + "import pygtk, site, sys
>>> +for path in [path for path in sys.path if 'site-packages' in path]: site.addsitedir(path)"))))
>>
>> I guess it’s a list comprehension, but I’m a bit confused by the syntax
>> and the various ‘path’. Oh well. :-)
>
> The Scheme equivalent is something like this:
>
> (for-each site.addsitedir
> (filter (cut string-contains <> "site-packages")
> sys.path))
>
> The bracketed expression in Python is like the ‘(filter ...)’
> expression.
Interesting, thanks for educating me. :-)
So, OK to push!
Ludo’.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-02-28 15:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-26 7:10 [PATCH] Add gtklick Ricardo Wurmus
2016-02-26 23:38 ` Ludovic Courtès
2016-02-27 9:17 ` Ricardo Wurmus
2016-02-28 15:48 ` 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).