* [PATCH] gnu: Add python-pyxdg.
@ 2015-04-14 6:56 Ricardo Wurmus
2015-04-14 9:52 ` Ludovic Courtès
0 siblings, 1 reply; 2+ messages in thread
From: Ricardo Wurmus @ 2015-04-14 6:56 UTC (permalink / raw)
To: Guix-devel
[-- Attachment #1: Type: text/plain, Size: 376 bytes --]
Hi Guix,
I placed python-pyxdg in the freedesktop module because it fits there
and because it allows me to avoid a circular dependency.
One of the tests is failing. I do not know why a PNG image is detected
as 'x-apple-ios-png' rather than the expected 'png', but I suspect it's
a problem in "shared-mime-info". I made the check phase return #t to
avoid a build failure.
[-- Attachment #2: 0001-gnu-Add-python-pyxdg.patch --]
[-- Type: text/x-patch, Size: 3364 bytes --]
From e9ba9a6bee8ff6d503e1c3f87b407e872afda193 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <rekado@elephly.net>
Date: Tue, 14 Apr 2015 08:53:03 +0200
Subject: [PATCH] gnu: Add python-pyxdg.
* gnu/packages/freedesktop.scm (python-pyxdg, python2-pyxdg): New variables.
---
gnu/packages/freedesktop.scm | 52 +++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 51 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index f65a5bb..42eb1bf 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
+;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -18,10 +19,13 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages freedesktop)
- #:use-module ((guix licenses) #:select (expat x11))
+ #:use-module ((guix licenses) #:select (expat x11 lgpl2.0))
#:use-module (guix packages)
#:use-module (guix 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 xdisorg)
@@ -75,3 +79,49 @@ freedesktop.org project.")
"Libinput is a library to handle input devices for display servers and
other applications that need to directly deal with input devices.")
(license x11)))
+
+(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")))
+ ;; TODO: one failing test
+ ;; AssertionError: 'x-apple-ios-png' != 'png'
+ (zero? (system* "nosetests" "-v"))
+ #t)
+ %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 lgpl2.0)))
+
+(define-public python2-pyxdg
+ (package-with-python2 python-pyxdg))
--
2.1.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] gnu: Add python-pyxdg.
2015-04-14 6:56 [PATCH] gnu: Add python-pyxdg Ricardo Wurmus
@ 2015-04-14 9:52 ` Ludovic Courtès
0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2015-04-14 9:52 UTC (permalink / raw)
To: Ricardo Wurmus; +Cc: Guix-devel
Ricardo Wurmus <rekado@elephly.net> skribis:
> One of the tests is failing. I do not know why a PNG image is detected
> as 'x-apple-ios-png' rather than the expected 'png', but I suspect it's
> a problem in "shared-mime-info".
Weird. Normally setting XDG_DATA_DIRS as you did is all it takes, AIUI.
> I made the check phase return #t to
> avoid a build failure.
It would be even better to somehow adjust the test files to skip this
one, but if that’s too much burden, I’m fine with this approach.
> From e9ba9a6bee8ff6d503e1c3f87b407e872afda193 Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <rekado@elephly.net>
> Date: Tue, 14 Apr 2015 08:53:03 +0200
> Subject: [PATCH] gnu: Add python-pyxdg.
>
> * gnu/packages/freedesktop.scm (python-pyxdg, python2-pyxdg): New variables.
[...]
> + (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")
Missing period. Also, I would make it:
... standards in Python: Base Directory, Menu, Desktop Entry, Icon
Theme, Recent File, and Shared-MIME-Database.
> + (license lgpl2.0)))
v2.0-only?
Otherwise LGTM.
Thank you!
Ludo’.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-04-14 9:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-14 6:56 [PATCH] gnu: Add python-pyxdg Ricardo Wurmus
2015-04-14 9:52 ` 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).