From e8444b26ab43b413cfe1c7d11d70030613d83bb6 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Tue, 14 Apr 2015 08:53:03 +0200 Subject: gnu: Add python-pyxdg. * gnu/packages/freedesktop.scm (python-pyxdg, python2-pyxdg): New variables. --- gnu/packages/freedesktop.scm | 51 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'gnu/packages') diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm index 891bd3114f..c5b55f30a2 100644 --- a/gnu/packages/freedesktop.scm +++ b/gnu/packages/freedesktop.scm @@ -26,6 +26,9 @@ (define-module (gnu packages freedesktop) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix build-system gnu) + #:use-module (guix build-system python) + #:use-module (gnu packages gnome) + #:use-module (gnu packages python) #:use-module (gnu packages linux) #:use-module (gnu packages pkg-config) #:use-module (gnu packages autotools) @@ -146,3 +149,51 @@ (define-public elogind the org.freedesktop.login1 interface over the system bus, allowing other parts of a the system to know what users are logged in, and where.") (license license:lgpl2.1+)))) + +(define-public python-pyxdg + (package + (name "python-pyxdg") + (version "0.25") + (source + (origin + (method url-fetch) + (uri (string-append + "https://pypi.python.org/packages/source/p/pyxdg/pyxdg-" + version ".tar.gz")) + (sha256 + (base32 + "179767h8m634ydlm4v8lnz01ba42gckfp684id764zaip7h87s41")))) + (build-system python-build-system) + (arguments + '(#:phases + (alist-replace + 'check + (lambda* (#:key inputs #:allow-other-keys) + (setenv "XDG_DATA_DIRS" + (string-append (assoc-ref inputs "shared-mime-info") + "/share/")) + (substitute* "test/test-icon.py" + (("/usr/share/icons/hicolor/index.theme") + (string-append (assoc-ref inputs "hicolor-icon-theme") + "/share/icons/hicolor/index.theme"))) + + ;; One test fails with: + ;; AssertionError: 'x-apple-ios-png' != 'png' + (substitute* "test/test-mime.py" + (("self.check_mimetype\\(imgpng, 'image', 'png'\\)") "#")) + (zero? (system* "nosetests" "-v"))) + %standard-phases))) + (native-inputs + `(("shared-mime-info" ,shared-mime-info) ;for tests + ("hicolor-icon-theme" ,hicolor-icon-theme) ;for tests + ("python-nose" ,python-nose) + ("python-setuptools" ,python-setuptools))) + (home-page "http://freedesktop.org/wiki/Software/pyxdg") + (synopsis "Implementations of freedesktop.org standards in Python") + (description + "PyXDG is a collection of implementations of freedesktop.org standards in +Python") + (license license:lgpl2.0))) + +(define-public python2-pyxdg + (package-with-python2 python-pyxdg)) -- cgit v1.2.3