From 882f2958c2e3c99d6d5d15f038f0261402bea492 Mon Sep 17 00:00:00 2001 From: ng0 Date: Mon, 16 Oct 2017 15:31:04 +0000 Subject: [PATCH 2/3] gnu: Add python-pycanberra. * gnu/packages/libcanberra.scm (python-pycanberra): New variable. --- gnu/packages/libcanberra.scm | 51 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/gnu/packages/libcanberra.scm b/gnu/packages/libcanberra.scm index 941d3dcc4..81f20ba6d 100644 --- a/gnu/packages/libcanberra.scm +++ b/gnu/packages/libcanberra.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2013 Andreas Enge ;;; Copyright © 2014, 2015 Ludovic Courtès ;;; Copyright © 2016 Fabian Harfert +;;; Copyright © 2017 ng0 ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,8 +25,11 @@ #:use-module (gnu packages) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix git-download) #:use-module (guix build-system gnu) + #:use-module (guix build-system python) #:use-module (guix build utils) + #:use-module (guix utils) #:use-module (gnu packages autotools) #:use-module (gnu packages gstreamer) #:use-module (gnu packages gtk) @@ -33,6 +37,7 @@ #:use-module (gnu packages linux) #:use-module (gnu packages pulseaudio) #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) #:use-module (gnu packages xiph)) (define-public libcanberra @@ -126,3 +131,49 @@ sounds for various system events.") (license (list cc-by-sa4.0 cc-by3.0 gpl2 gpl2+)) (home-page "http://www.freedesktop.org/wiki/Specifications/sound-theme-spec/"))) + +(define-public python-pycanberra + (let ((commit "88c53cd44a626ede3b07dab0b548f8bcfda42867")) + (package + (name "python-pycanberra") + (version (string-append "0.0." (string-take commit 7))) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/totdb/pycanberra") + (commit commit))) + (file-name (string-append name "-" version "-checkout")) + (sha256 + (base32 + "04xv5g599s5bvr1pd273hbb5kq1n194sjwhgj39jgh1l3g5w9k3y")))) + (build-system gnu-build-system) + (arguments + `(#:imported-modules (,@%gnu-build-system-modules + (guix build python-build-system)) + #:tests? #f ;No tests included. + #:phases + (modify-phases %standard-phases + (delete 'configure) + (delete 'build) + (replace 'install + (lambda* (#:key outputs inputs #:allow-other-keys) + (let* ((python (assoc-ref inputs "python")) + (python-version ((@@ (guix build python-build-system) + get-python-version) + python)) + (out (assoc-ref outputs "out")) + (python-sitedir (string-append out "/lib/python" + python-version + "/site-packages"))) + (install-file "pycanberra.py" python-sitedir)) + #t))))) + (propagated-inputs + `(("libcanberra" ,libcanberra))) + (native-inputs + `(("python" ,python))) + (synopsis "Ctypes wrapper for the libcanberra API") + (description + "Pycanberra is a basic Python wrapper for libcanberra.") + (home-page "https://github.com/totdb/pycanberra") + (license lgpl2.1+)))) -- 2.14.2