gnu: All snippets report errors using exceptions, else return #t.
[jackhill/guix/guix.git] / gnu / packages / freedesktop.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
4 ;;; Copyright © 2015, 2017 Andy Wingo <wingo@pobox.com>
5 ;;; Copyright © 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
6 ;;; Copyright © 2015, 2017 Ricardo Wurmus <rekado@elephly.net>
7 ;;; Copyright © 2015 David Hashe <david.hashe@dhashe.com>
8 ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016 Kei Kebreau <kkebreau@posteo.net>
10 ;;; Copyright © 2017 Mark H Weaver <mhw@netris.org>
11 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
12 ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
13 ;;; Copyright © 2017 Brendan Tildesley <brendan.tildesley@openmailbox.org>
14 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
15 ;;;
16 ;;; This file is part of GNU Guix.
17 ;;;
18 ;;; GNU Guix is free software; you can redistribute it and/or modify it
19 ;;; under the terms of the GNU General Public License as published by
20 ;;; the Free Software Foundation; either version 3 of the License, or (at
21 ;;; your option) any later version.
22 ;;;
23 ;;; GNU Guix is distributed in the hope that it will be useful, but
24 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
25 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 ;;; GNU General Public License for more details.
27 ;;;
28 ;;; You should have received a copy of the GNU General Public License
29 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
30
31 (define-module (gnu packages freedesktop)
32 #:use-module ((guix licenses) #:prefix license:)
33 #:use-module (guix packages)
34 #:use-module (guix download)
35 #:use-module (guix git-download)
36 #:use-module (guix build-system gnu)
37 #:use-module (guix build-system perl)
38 #:use-module (guix build-system python)
39 #:use-module (gnu packages acl)
40 #:use-module (gnu packages admin)
41 #:use-module (gnu packages autotools)
42 #:use-module (gnu packages bash)
43 #:use-module (gnu packages boost)
44 #:use-module (gnu packages check)
45 #:use-module (gnu packages compression)
46 #:use-module (gnu packages cryptsetup)
47 #:use-module (gnu packages databases)
48 #:use-module (gnu packages disk)
49 #:use-module (gnu packages docbook)
50 #:use-module (gnu packages documentation)
51 #:use-module (gnu packages gettext)
52 #:use-module (gnu packages gl)
53 #:use-module (gnu packages glib) ;intltool
54 #:use-module (gnu packages gnome)
55 #:use-module (gnu packages gnuzilla)
56 #:use-module (gnu packages gperf)
57 #:use-module (gnu packages graphviz)
58 #:use-module (gnu packages gtk)
59 #:use-module (gnu packages libffi)
60 #:use-module (gnu packages libunwind)
61 #:use-module (gnu packages libusb)
62 #:use-module (gnu packages linux)
63 #:use-module (gnu packages m4)
64 #:use-module (gnu packages perl)
65 #:use-module (gnu packages perl-check)
66 #:use-module (gnu packages polkit)
67 #:use-module (gnu packages pkg-config)
68 #:use-module (gnu packages perl)
69 #:use-module (gnu packages perl-check)
70 #:use-module (gnu packages python)
71 #:use-module (gnu packages w3m)
72 #:use-module (gnu packages web)
73 #:use-module (gnu packages xml)
74 #:use-module (gnu packages xdisorg)
75 #:use-module (gnu packages xorg))
76
77 (define-public xdg-utils
78 (package
79 (name "xdg-utils")
80 (version "1.1.2")
81 (source
82 (origin
83 (method url-fetch)
84 (uri (string-append
85 "https://portland.freedesktop.org/download/xdg-utils-"
86 version ".tar.gz"))
87 (sha256
88 (base32
89 "1k4b4m3aiyqn9k12a0ihcdahzlspl3zhskmm1d7228dvqvi546cm"))))
90 (build-system gnu-build-system)
91 (native-inputs
92 `(("docbook-xsl" ,docbook-xsl)
93 ("docbook-xml" ,docbook-xml-4.1.2)
94 ("libxslt" ,libxslt)
95 ("w3m" ,w3m)
96 ("xmlto" ,xmlto)))
97 (propagated-inputs
98 `(("perl-file-mimeinfo" ,perl-file-mimeinfo) ; for mimeopen fallback
99 ("xprop" ,xprop) ; for Xfce detecting
100 ("xset" ,xset))) ; for xdg-screensaver
101 (arguments
102 `(#:tests? #f ; no check target
103 #:phases
104 (modify-phases %standard-phases
105 (add-after 'unpack 'patch-hardcoded-paths
106 (lambda _
107 (substitute* "scripts/xdg-mime.in"
108 (("/usr/bin/file") (which "file")))
109 (substitute* "scripts/xdg-open.in"
110 (("/usr/bin/printf") (which "printf")))
111 #t))
112 (add-before 'build 'locate-catalog-files
113 (lambda* (#:key inputs #:allow-other-keys)
114 (let ((xmldoc (string-append (assoc-ref inputs "docbook-xml")
115 "/xml/dtd/docbook"))
116 (xsldoc (string-append (assoc-ref inputs "docbook-xsl")
117 "/xml/xsl/docbook-xsl-"
118 ,(package-version docbook-xsl))))
119 (for-each (lambda (file)
120 (substitute* file
121 (("http://.*/docbookx\\.dtd")
122 (string-append xmldoc "/docbookx.dtd"))))
123 (find-files "scripts/desc" "\\.xml$"))
124 (substitute* "scripts/Makefile"
125 ;; Apparently `xmlto' does not bother to looks up the stylesheets
126 ;; specified in the XML, unlike the above substitition. Instead it
127 ;; uses a hard-coded URL. Work around it here, but if this is
128 ;; common perhaps we should hardcode this path in xmlto itself.
129 (("\\$\\(XMLTO\\) man")
130 (string-append "$(XMLTO) -x " xsldoc
131 "/manpages/docbook.xsl man")))
132 (setenv "STYLESHEET"
133 (string-append xsldoc "/html/docbook.xsl"))
134 #t))))))
135 (home-page "https://www.freedesktop.org/wiki/Software/xdg-utils/")
136 (synopsis "Freedesktop.org scripts for desktop integration")
137 (description "The xdg-utils package is a set of simple scripts that
138 provide basic desktop integration functions in the framework of the
139 freedesktop.org project.")
140 (license license:expat)))
141
142 (define-public libinput
143 (package
144 (name "libinput")
145 (version "1.7.3")
146 (source (origin
147 (method url-fetch)
148 (uri (string-append "https://freedesktop.org/software/libinput/"
149 name "-" version ".tar.xz"))
150 (sha256
151 (base32
152 "07fbzxddvhjcch43hdxb24sj7ri96zzpcjalvsicmw0i4wnn2v89"))))
153 (build-system gnu-build-system)
154 (native-inputs
155 `(("cairo" ,cairo)
156 ("gtk+" ,gtk+)
157 ("pkg-config" ,pkg-config)))
158 (propagated-inputs
159 `(("libudev" ,eudev))) ; required by libinput.pc
160 (inputs
161 `(("glib" ,glib)
162 ("libevdev" ,libevdev)
163 ("mtdev" ,mtdev)
164 ("libwacom" ,libwacom)))
165 (home-page "https://www.freedesktop.org/wiki/Software/libinput/")
166 (synopsis "Input devices handling library")
167 (description
168 "Libinput is a library to handle input devices for display servers and
169 other applications that need to directly deal with input devices.")
170 (license license:x11)))
171
172 (define-public libinput-minimal
173 (package (inherit libinput)
174 (name "libinput-minimal")
175 (native-inputs
176 `(("pkg-config" ,pkg-config)))
177 (inputs
178 `(("libevdev" ,libevdev)
179 ("mtdev" ,mtdev)))
180 (arguments
181 `(#:configure-flags
182 '("--disable-libwacom")))))
183
184 (define-public libxdg-basedir
185 (package
186 (name "libxdg-basedir")
187 (version "1.2.0")
188 (source (origin
189 (method url-fetch)
190 (uri (string-append
191 "https://github.com/devnev/libxdg-basedir/archive/"
192 name "-" version ".tar.gz"))
193 (sha256
194 (base32
195 "0s28c7sfwqimsmb3kn91mx7wi55fs3flhbmynl9k60rrllr00aqw"))))
196 (build-system gnu-build-system)
197 (arguments
198 '(#:phases
199 (modify-phases %standard-phases
200 (add-after 'unpack 'autogen
201 (lambda _
202 ;; Run 'configure' in its own phase, not now.
203 (substitute* "autogen.sh"
204 (("^.*\\./configure.*") ""))
205 (zero? (system* "sh" "autogen.sh")))))))
206 (native-inputs
207 `(("autoconf" ,autoconf)
208 ("automake" ,automake)
209 ("libtool" ,libtool)))
210 (home-page "https://github.com/devnev/libxdg-basedir")
211 (synopsis "Implementation of the XDG Base Directory specification")
212 (description
213 "libxdg-basedir is a C library providing some functions to use with
214 the freedesktop.org XDG Base Directory specification.")
215 (license license:expat)))
216
217 (define-public elogind
218 (package
219 (name "elogind")
220 (version "232.4")
221 (source (origin
222 (method url-fetch)
223 (uri (string-append "https://github.com/elogind/elogind/"
224 "archive/v" version ".tar.gz"))
225 (file-name (string-append name "-" version ".tar.gz"))
226 (sha256
227 (base32
228 "1qcxian48z2dj5gfmp7brrngdydqf2jm00f4rjr5sy1myh8fy931"))
229 (modules '((guix build utils)))
230 (snippet
231 '(begin
232 (use-modules (guix build utils))
233 (substitute* "Makefile.am"
234 ;; Avoid validation against DTD because the DTDs for
235 ;; both doctype 4.2 and 4.5 are needed.
236 (("XSLTPROC_FLAGS = ") "XSLTPROC_FLAGS = --novalid"))
237 #t))))
238 (build-system gnu-build-system)
239 (arguments
240 `(#:tests? #f ;FIXME: "make check" in the "po" directory fails.
241 #:configure-flags
242 (list (string-append "--with-udevrulesdir="
243 (assoc-ref %outputs "out")
244 "/lib/udev/rules.d")
245
246 ;; Let elogind be its own cgroup controller, rather than relying
247 ;; on systemd or OpenRC. By default, 'configure' makes an
248 ;; incorrect guess.
249 "--with-cgroup-controller=elogind"
250
251 (string-append "--with-rootprefix="
252 (assoc-ref %outputs "out"))
253 (string-append "--with-rootlibexecdir="
254 (assoc-ref %outputs "out")
255 "/libexec/elogind")
256 ;; These are needed to ensure that lto linking works.
257 "RANLIB=gcc-ranlib"
258 "AR=gcc-ar"
259 "NM=gcc-nm")
260 #:make-flags '("PKTTYAGENT=/run/current-system/profile/bin/pkttyagent")
261 #:phases
262 (modify-phases %standard-phases
263 (add-after 'unpack 'patch-locale-header
264 (lambda _
265 ;; Fix compilation with glibc >= 2.26, which removed xlocale.h.
266 ;; This can be removed for elogind 234.
267 (substitute* "src/basic/parse-util.c"
268 (("xlocale\\.h") "locale.h"))))
269 (add-before 'configure 'autogen
270 (lambda _
271 (and (zero? (system* "intltoolize" "--force" "--automake"))
272 (zero? (system* "autoreconf" "-vif")))))
273 (add-before 'build 'fix-service-file
274 (lambda* (#:key outputs #:allow-other-keys)
275 ;; Fix the file name of the 'elogind' binary in the D-Bus
276 ;; '.service' file.
277 (substitute* "src/login/org.freedesktop.login1.service"
278 (("^Exec=.*")
279 (string-append "Exec=" (assoc-ref %outputs "out")
280 "/libexec/elogind/elogind\n")))))
281 (add-after 'install 'add-libcap-to-search-path
282 (lambda* (#:key inputs outputs #:allow-other-keys)
283 ;; Add a missing '-L' for libcap in libelogind.la. See
284 ;; <https://lists.gnu.org/archive/html/guix-devel/2017-09/msg00084.html>.
285 (let ((libcap (assoc-ref inputs "libcap"))
286 (out (assoc-ref outputs "out")))
287 (substitute* (string-append out "/lib/libelogind.la")
288 (("-lcap")
289 (string-append "-L" libcap "/lib -lcap")))
290 #t)))
291 (add-after 'unpack 'remove-uaccess-tag
292 (lambda _
293 ;; systemd supports a "uaccess" built-in tag, but eudev currently
294 ;; doesn't. This leads to eudev warnings that we'd rather not
295 ;; see, so remove the reference to "uaccess."
296 (substitute* "src/login/73-seat-late.rules.in"
297 (("^TAG==\"uaccess\".*" line)
298 (string-append "# " line "\n")))
299 #t)))))
300 (native-inputs
301 `(("autoconf" ,autoconf)
302 ("automake" ,automake)
303 ("libtool" ,libtool)
304 ("intltool" ,intltool)
305 ("gettext" ,gettext-minimal)
306 ("python" ,python)
307 ("docbook-xsl" ,docbook-xsl)
308 ("docbook-xml" ,docbook-xml)
309 ("xsltproc" ,libxslt)
310 ("m4" ,m4)
311 ("libxml2" ,libxml2) ;for XML_CATALOG_FILES
312 ("pkg-config" ,pkg-config)
313
314 ;; Use gperf 3.0 to work around
315 ;; <https://github.com/wingo/elogind/issues/8>.
316 ("gperf" ,gperf-3.0)))
317 (inputs
318 `(("linux-pam" ,linux-pam)
319 ("linux-libre-headers" ,linux-libre-headers)
320 ("libcap" ,libcap)
321 ("shepherd" ,shepherd) ;for 'halt' and 'reboot', invoked
322 ;when pressing the power button
323 ("dbus" ,dbus)
324 ("eudev" ,eudev)
325 ("acl" ,acl))) ;to add individual users to ACLs on /dev nodes
326 (home-page "https://github.com/elogind/elogind")
327 (synopsis "User, seat, and session management service")
328 (description "Elogind is the systemd project's \"logind\" service,
329 extracted out as a separate project. Elogind integrates with PAM to provide
330 the org.freedesktop.login1 interface over the system bus, allowing other parts
331 of a the system to know what users are logged in, and where.")
332 (license license:lgpl2.1+)))
333
334 (define-public packagekit
335 (package
336 (name "packagekit")
337 (version "1.1.5")
338 (source (origin
339 (method url-fetch)
340 (uri (string-append
341 "https://www.freedesktop.org/software/"
342 "PackageKit/releases/"
343 "PackageKit-" version ".tar.xz"))
344 (sha256
345 (base32
346 "035pqxgkyki813hyw2frrbpfllq113zfk5qcp9wvsq5lsp74ix2h"))))
347 (build-system gnu-build-system)
348 (arguments
349 `(#:tests? #f
350 #:make-flags (list (string-append "BASH_COMPLETIONS_DIR="
351 %output "/etc/bash_completion.d"))
352 #:configure-flags
353 '("--disable-systemd")))
354 (native-inputs
355 `(("intltool" ,intltool)
356 ("pkg-config" ,pkg-config)
357 ("python" ,python-wrapper)
358 ("glib:bin" ,glib "bin")))
359 (inputs
360 `(("glib" ,glib)
361 ("bash-completion", bash-completion)
362 ("polkit" ,polkit)))
363 (propagated-inputs
364 `(("sqlite" ,sqlite)))
365 (home-page "https://www.freedesktop.org/software/PackageKit/")
366 (synopsis "API for package management, through D-Bus")
367 (description
368 "PackageKit provides a way of performing package management tasks,
369 e.g. updating, removing and installing software. Through supporting many
370 backends, PackageKit can perform these tasks using the appropriate package
371 manager for the current system.")
372 (license license:gpl2+)))
373
374 (define-public python-pyxdg
375 (package
376 (name "python-pyxdg")
377 (version "0.25")
378 (source
379 (origin
380 (method url-fetch)
381 (uri (string-append
382 "https://pypi.python.org/packages/source/p/pyxdg/pyxdg-"
383 version ".tar.gz"))
384 (sha256
385 (base32
386 "179767h8m634ydlm4v8lnz01ba42gckfp684id764zaip7h87s41"))))
387 (build-system python-build-system)
388 (arguments
389 '(#:phases
390 (modify-phases %standard-phases
391 (replace 'check
392 (lambda* (#:key inputs #:allow-other-keys)
393 (setenv "XDG_DATA_DIRS"
394 (string-append (assoc-ref inputs "shared-mime-info")
395 "/share/"))
396 (substitute* "test/test-icon.py"
397 (("/usr/share/icons/hicolor/index.theme")
398 (string-append (assoc-ref inputs "hicolor-icon-theme")
399 "/share/icons/hicolor/index.theme"))
400 ;; FIXME: This test fails because the theme contains the unknown
401 ;; key "Scale".
402 (("theme.validate\\(\\)") "#"))
403
404 ;; One test fails with:
405 ;; AssertionError: 'x-apple-ios-png' != 'png'
406 (substitute* "test/test-mime.py"
407 (("self.check_mimetype\\(imgpng, 'image', 'png'\\)") "#"))
408 (zero? (system* "nosetests" "-v")))))))
409 (native-inputs
410 `(("shared-mime-info" ,shared-mime-info) ;for tests
411 ("hicolor-icon-theme" ,hicolor-icon-theme) ;for tests
412 ("python-nose" ,python-nose)))
413 (home-page "https://www.freedesktop.org/wiki/Software/pyxdg")
414 (synopsis "Implementations of freedesktop.org standards in Python")
415 (description
416 "PyXDG is a collection of implementations of freedesktop.org standards in
417 Python.")
418 (license license:lgpl2.0)))
419
420 (define-public python2-pyxdg
421 (package-with-python2 python-pyxdg))
422
423 (define-public wayland
424 (package
425 (name "wayland")
426 (version "1.14.0")
427 (source (origin
428 (method url-fetch)
429 (uri (string-append "https://wayland.freedesktop.org/releases/"
430 name "-" version ".tar.xz"))
431 (sha256
432 (base32
433 "1f3sla6h0bw15fz8pjc67jhwj7pwmfdc7qlj42j5k9v116ycm07d"))))
434 (build-system gnu-build-system)
435 (arguments
436 `(#:parallel-tests? #f))
437 (native-inputs
438 `(("doxygen" ,doxygen)
439 ("graphviz" ,graphviz)
440 ("pkg-config" ,pkg-config)
441 ("xmlto" ,xmlto)
442 ("xsltproc" ,libxslt)))
443 (inputs
444 `(("docbook-xml" ,docbook-xml)
445 ("docbook-xsl" ,docbook-xsl)
446 ("expat" ,expat)
447 ("libffi" ,libffi)
448 ("libxml2" ,libxml2))) ; for XML_CATALOG_FILES
449 (home-page "https://wayland.freedesktop.org/")
450 (synopsis "Display server protocol")
451 (description
452 "Wayland is a protocol for a compositor to talk to its clients as well as
453 a C library implementation of that protocol. The compositor can be a standalone
454 display server running on Linux kernel modesetting and evdev input devices, an X
455 application, or a wayland client itself. The clients can be traditional
456 applications, X servers (rootless or fullscreen) or other display servers.")
457 (license license:x11)))
458
459 (define-public wayland-protocols
460 (package
461 (name "wayland-protocols")
462 (version "1.12")
463 (source (origin
464 (method url-fetch)
465 (uri (string-append
466 "https://wayland.freedesktop.org/releases/"
467 "wayland-protocols-" version ".tar.xz"))
468 (sha256
469 (base32
470 "1cn8ny4zr9xlcdh8qi1qnkmvia8cp4ixnsbhd9sp9571w6lyh69v"))))
471 (build-system gnu-build-system)
472 (inputs
473 `(("wayland" ,wayland)))
474 (native-inputs
475 `(("pkg-config" ,pkg-config)))
476 (synopsis "Wayland protocols")
477 (description "This package contains XML definitions of the Wayland protocols.")
478 (home-page "https://wayland.freedesktop.org")
479 (license license:expat)))
480
481 (define-public weston
482 (package
483 (name "weston")
484 (version "3.0.0")
485 (source (origin
486 (method url-fetch)
487 (uri (string-append
488 "https://wayland.freedesktop.org/releases/"
489 "weston-" version ".tar.xz"))
490 (sha256
491 (base32
492 "19936zlkb75xcaidd8fag4ah8000wrh2ziqy7nxkq36pimgdbqfd"))))
493 (build-system gnu-build-system)
494 (native-inputs
495 `(("pkg-config" ,pkg-config)
496 ("xorg-server" ,xorg-server)))
497 (inputs
498 `(("cairo" ,cairo-xcb)
499 ("dbus" ,dbus)
500 ("elogind" ,elogind)
501 ("libinput" ,libinput-minimal)
502 ("libunwind" ,libunwind)
503 ("libxcursor" ,libxcursor)
504 ("libxkbcommon" ,libxkbcommon)
505 ("mesa" ,mesa)
506 ("mtdev" ,mtdev)
507 ("linux-pam" ,linux-pam)
508 ("wayland" ,wayland)
509 ("wayland-protocols" ,wayland-protocols)
510 ("xorg-server-xwayland" ,xorg-server-xwayland)))
511 (arguments
512 `(#:configure-flags
513 (list "--disable-setuid-install"
514 "--enable-systemd-login"
515 (string-append "--with-xserver-path="
516 (assoc-ref %build-inputs "xorg-server-xwayland")
517 "/bin/Xwayland"))
518 #:phases
519 (modify-phases %standard-phases
520 (add-before 'configure 'use-elogind
521 (lambda _
522 ;; Use elogind instead of systemd
523 (substitute* "configure"
524 (("libsystemd-login >= 198") "libelogind"))
525 (substitute* '("libweston/launcher-logind.c"
526 "libweston/weston-launch.c")
527 (("#include <systemd/sd-login.h>")
528 "#include <elogind/sd-login.h>"))
529 #t))
530 (add-after 'configure 'patch-confdefs.h
531 (lambda _
532 (system "echo \"#define HAVE_SYSTEMD_LOGIN_209 1\" >> confdefs.h")))
533 (add-before 'check 'setup
534 (lambda _
535 (setenv "HOME" (getcwd))
536 (setenv "XDG_RUNTIME_DIR" (getcwd))
537 #t))
538 (add-before 'check 'start-xorg-server
539 (lambda* (#:key inputs #:allow-other-keys)
540 ;; The test suite requires a running X server.
541 (system (string-append (assoc-ref inputs "xorg-server")
542 "/bin/Xvfb :1 &"))
543 (setenv "DISPLAY" ":1")
544 #t)))))
545 (home-page "https://wayland.freedesktop.org")
546 (synopsis "Reference implementation of a Wayland compositor")
547 (description "Weston is the reference implementation of a Wayland
548 compositor, and a useful compositor in its own right.
549
550 A Wayland compositor allows applications to render to a shared offscreen
551 buffer using OpenGL ES. The compositor then culls the hidden parts and
552 composes the final output. A Wayland compositor is essentially a
553 multiplexer to the KMS/DRM Linux kernel devices.")
554 (license license:expat)))
555
556 (define-public exempi
557 (package
558 (name "exempi")
559 (version "2.4.2")
560 (source (origin
561 (method url-fetch)
562 (uri (string-append
563 "https://libopenraw.freedesktop.org/download/"
564 name "-" version ".tar.bz2"))
565 (sha256
566 (base32
567 "1v665fc7x0yi7x6lzskvd8bd2anf7951svn2vd5384dblmgv43av"))))
568 (build-system gnu-build-system)
569 (arguments
570 `(#:configure-flags (list (string-append "--with-boost="
571 (assoc-ref %build-inputs "boost")))))
572 (native-inputs
573 `(("boost" ,boost))) ; tests
574 (inputs
575 `(("expat" ,expat)
576 ("zlib" ,zlib)))
577 (home-page "https://wiki.freedesktop.org/libopenraw/Exempi")
578 (synopsis "XMP metadata handling library")
579 (description "Exempi is an implementation of the Extensible Metadata
580 Platform (XMP), which enables embedding metadata in PDF and image formats.")
581 (license license:bsd-3)))
582
583 (define-public libatasmart
584 (package
585 (name "libatasmart")
586 (version "0.19")
587 (source (origin
588 (method url-fetch)
589 (uri (string-append "http://0pointer.de/public/"
590 name "-" version ".tar.xz"))
591 (sha256
592 (base32
593 "138gvgdwk6h4ljrjsr09pxk1nrki4b155hqdzyr8mlk3bwsfmw31"))))
594 (build-system gnu-build-system)
595 (native-inputs
596 `(("pkg-config" ,pkg-config)))
597 (inputs
598 `(("udev" ,eudev)))
599 (home-page "http://0pointer.de/blog/projects/being-smart.html")
600 (synopsis "ATA S.M.A.R.T. reading and parsing library")
601 (description
602 "This library supports a subset of the ATA S.M.A.R.T. (Self-Monitoring,
603 Analysis and Reporting Technology) functionality.")
604 (license license:lgpl2.1+)))
605
606 (define-public udisks
607 (package
608 (name "udisks")
609 (version "2.1.8")
610 (source (origin
611 (method url-fetch)
612 (uri (string-append "https://udisks.freedesktop.org/releases/"
613 name "-" version ".tar.bz2"))
614 (sha256
615 (base32
616 "1nkxhnqh39c9pzvm4zfj50rgv6apqawdx09bv3sfaxrah4a6jhfs"))))
617 (build-system gnu-build-system)
618 (native-inputs
619 `(("docbook-xml" ,docbook-xml-4.3) ; to build the manpages
620 ("docbook-xsl" ,docbook-xsl)
621 ("glib:bin" ,glib "bin") ; for glib-mkenums
622 ("gobject-introspection" ,gobject-introspection)
623 ("intltool" ,intltool)
624 ("pkg-config" ,pkg-config)
625 ("xsltproc" ,libxslt)))
626 (propagated-inputs
627 `(("glib" ,glib))) ; required by udisks2.pc
628 (inputs
629 `(("acl" ,acl)
630 ("libatasmart" ,libatasmart)
631 ("libgudev" ,libgudev)
632 ("polkit" ,polkit)
633 ("util-linux" ,util-linux)
634 ("cryptsetup" ,cryptsetup)
635 ("parted" ,parted)))
636 (outputs '("out"
637 "doc")) ;5 MiB of gtk-doc HTML
638 (arguments
639 `(#:tests? #f ; requiring system message dbus
640 #:disallowed-references ("doc") ;enforce separation of "doc"
641 #:configure-flags
642 (list "--enable-man"
643 "--localstatedir=/var"
644 "--enable-fhs-media" ;mount devices in /media, not /run/media
645 (string-append "--with-html-dir="
646 (assoc-ref %outputs "doc")
647 "/share/doc/udisks/html")
648 (string-append "--with-udevdir=" %output "/lib/udev"))
649 #:make-flags
650 (let* ((docbook-xsl-name-version ,(string-append
651 (package-name docbook-xsl) "-"
652 (package-version docbook-xsl)))
653 (docbook-xsl-catalog-file (string-append
654 (assoc-ref %build-inputs "docbook-xsl")
655 "/xml/xsl/"
656 docbook-xsl-name-version
657 "/catalog.xml"))
658 (docbook-xml-catalog-file (string-append
659 (assoc-ref %build-inputs "docbook-xml")
660 "/xml/dtd/docbook/catalog.xml")))
661 ;; Reference the catalog files required to build the manpages.
662 (list (string-append "XML_CATALOG_FILES=" docbook-xsl-catalog-file " "
663 docbook-xml-catalog-file)))
664 #:phases
665 (modify-phases %standard-phases
666 (add-before
667 'configure 'fix-girdir
668 (lambda _
669 ;; Install introspection data to its own output.
670 (substitute* "udisks/Makefile.in"
671 (("girdir = .*")
672 "girdir = $(datadir)/gir-1.0\n")
673 (("typelibsdir = .*")
674 "typelibsdir = $(libdir)/girepository-1.0\n"))))
675 (add-after 'install 'wrap-udisksd
676 (lambda* (#:key outputs inputs #:allow-other-keys)
677 ;; Tell 'udisksd' where to find the 'mount' command.
678 (let ((out (assoc-ref outputs "out"))
679 (utils (assoc-ref inputs "util-linux"))
680 (cryptsetup (assoc-ref inputs "cryptsetup"))
681 (parted (assoc-ref inputs "parted")))
682 (wrap-program (string-append out "/libexec/udisks2/udisksd")
683 `("PATH" ":" prefix
684 (,(string-append utils "/bin") ;for 'mount'
685 ;; cryptsetup is required for setting encrypted
686 ;; partitions, e.g. in gnome-disks
687 ,(string-append cryptsetup "/sbin")
688 ;; parted is required for managing partitions, e.g. in
689 ;; gnome-disks
690 ,(string-append parted "/sbin")
691 "/run/current-system/profile/bin"
692 "/run/current-system/profile/sbin")))
693 #t))))))
694 (home-page "https://www.freedesktop.org/wiki/Software/udisks/")
695 (synopsis "Disk manager service")
696 (description
697 "UDisks provides interfaces to enumerate and perform operations on disks
698 and storage devices. Any application (including unprivileged ones) can access
699 the udisksd(8) daemon via the name org.freedesktop.UDisks2 on the system
700 message bus.")
701 ;; The dynamic library are under LGPLv2+, others are GPLv2+.
702 (license (list license:gpl2+ license:lgpl2.0+))))
703
704 (define-public accountsservice
705 (package
706 (name "accountsservice")
707 (version "0.6.43")
708 (source (origin
709 (method url-fetch)
710 (uri (string-append "https://www.freedesktop.org/software/"
711 name "/" name "-" version ".tar.xz"))
712 (sha256
713 (base32
714 "1k6n9079001sgcwlkq0bz6mkn4m8y4dwf6hs1qm85swcld5ajfzd"))))
715 (build-system gnu-build-system)
716 (arguments
717 '(#:tests? #f ; XXX: tests require DocBook 4.1.2
718 #:configure-flags
719 '("--localstatedir=/var")
720 #:phases
721 (modify-phases %standard-phases
722 (add-before
723 'configure 'pre-configure
724 (lambda* (#:key inputs #:allow-other-keys)
725 ;; Don't try to create /var/lib/AccountsService.
726 (substitute* "src/Makefile.in"
727 (("\\$\\(MKDIR_P\\).*/lib/AccountsService.*") "true"))
728 (let ((shadow (assoc-ref inputs "shadow")))
729 (substitute* '("src/user.c" "src/daemon.c")
730 (("/usr/sbin/usermod") (string-append shadow "/sbin/usermod"))
731 (("/usr/sbin/useradd") (string-append shadow "/sbin/useradd"))
732 (("/usr/sbin/userdel") (string-append shadow "/sbin/userdel"))
733 (("/usr/bin/passwd") (string-append shadow "/bin/passwd"))
734 (("/usr/bin/chage") (string-append shadow "/bin/chage"))))
735 #t)))))
736 (native-inputs
737 `(("glib:bin" ,glib "bin") ; for gdbus-codegen, etc.
738 ("gobject-introspection" ,gobject-introspection)
739 ("intltool" ,intltool)
740 ("pkg-config" ,pkg-config)))
741 (inputs
742 `(("shadow" ,shadow)
743 ("polkit" ,polkit)))
744 (home-page "https://www.freedesktop.org/wiki/Software/AccountsService/")
745 (synopsis "D-Bus interface for user account query and manipulation")
746 (description
747 "The AccountService project provides a set of D-Bus interfaces for querying
748 and manipulating user account information and an implementation of these
749 interfaces, based on the useradd, usermod and userdel commands.")
750 (license license:gpl3+)))
751
752 (define-public libmbim
753 (package
754 (name "libmbim")
755 (version "1.12.4")
756 (source (origin
757 (method url-fetch)
758 (uri (string-append
759 "https://www.freedesktop.org/software/" name "/"
760 name "-" version ".tar.xz"))
761 (sha256
762 (base32
763 "0flpgzsqpjgybjkx4smbb4rjxf2w1xgd1v9gmz61rvl89qasznbv"))))
764 (build-system gnu-build-system)
765 (native-inputs
766 `(("glib:bin" ,glib "bin") ; for glib-mkenums
767 ("pkg-config" ,pkg-config)
768 ("python" ,python-wrapper)))
769 (propagated-inputs
770 `(("glib" ,glib))) ; required by mbim-glib.pc
771 (inputs
772 `(("libgudev" ,libgudev)))
773 (synopsis "Library to communicate with MBIM-powered modems")
774 (home-page "https://www.freedesktop.org/wiki/Software/libmbim/")
775 (description
776 "Libmbim is a GLib-based library for talking to WWAN modems and devices
777 which speak the Mobile Interface Broadband Model (MBIM) protocol.")
778 (license
779 ;; The libmbim-glib library is released under the LGPLv2+ license.
780 ;; The mbimcli tool is released under the GPLv2+ license.
781 (list license:lgpl2.0+ license:gpl2+))))
782
783 (define-public libqmi
784 (package
785 (name "libqmi")
786 (version "1.14.2")
787 (source (origin
788 (method url-fetch)
789 (uri (string-append
790 "https://www.freedesktop.org/software/" name "/"
791 name "-" version ".tar.xz"))
792 (sha256
793 (base32
794 "0h009bzss4bal47nk21lyp4s3mmlcivhhaaj7r9229qvx85bi0v2"))))
795 (build-system gnu-build-system)
796 (native-inputs
797 `(("glib:bin" ,glib "bin") ; for glib-mkenums
798 ("pkg-config" ,pkg-config)
799 ("python" ,python-wrapper)))
800 (propagated-inputs
801 `(("glib" ,glib))) ; required by qmi-glib.pc
802 (synopsis "Library to communicate with QMI-powered modems")
803 (home-page "https://www.freedesktop.org/wiki/Software/libqmi/")
804 (description
805 "Libqmi is a GLib-based library for talking to WWAN modems and devices
806 which speak the Qualcomm MSM Interface (QMI) protocol.")
807 (license
808 ;; The libqmi-glib library is released under the LGPLv2+ license.
809 ;; The qmicli tool is released under the GPLv2+ license.
810 (list license:lgpl2.0+ license:gpl2+))))
811
812 (define-public modem-manager
813 (package
814 (name "modem-manager")
815 (version "1.4.14")
816 (source (origin
817 (method url-fetch)
818 (uri (string-append
819 "https://www.freedesktop.org/software/ModemManager/"
820 "ModemManager-" version ".tar.xz"))
821 (sha256
822 (base32
823 "18hvffwcncwz14kdzk42jbkh362n0kjv3kgx7axbqx572pawvrmb"))))
824 (build-system gnu-build-system)
825 (arguments
826 '(#:configure-flags
827 `(,(string-append "--with-udev-base-dir=" %output "/lib/udev"))))
828 (native-inputs
829 `(("glib:bin" ,glib "bin") ; for glib-mkenums
830 ("gobject-introspection" ,gobject-introspection)
831 ("intltool" ,intltool)
832 ("pkg-config" ,pkg-config)
833 ("vala" ,vala)
834 ;; For testing.
835 ("dbus" ,dbus)))
836 (propagated-inputs
837 `(("glib" ,glib))) ; required by mm-glib.pc
838 (inputs
839 `(("libgudev" ,libgudev)
840 ("libmbim" ,libmbim)
841 ("libqmi" ,libqmi)
842 ("polkit" ,polkit)))
843 (synopsis "Mobile broadband modems manager")
844 (home-page "https://www.freedesktop.org/wiki/Software/ModemManager/")
845 (description
846 "ModemManager is a DBus-activated daemon which controls mobile
847 broadband (2G/3G/4G) devices and connections. Whether built-in devices, USB
848 dongles, bluetooth-paired telephones, or professional RS232/USB devices with
849 external power supplies, ModemManager is able to prepare and configure the
850 modems and setup connections with them.")
851 (license license:gpl2+)))
852
853 (define-public telepathy-logger
854 (package
855 (name "telepathy-logger")
856 (version "0.8.2")
857 (source (origin
858 (method url-fetch)
859 (uri (string-append "https://telepathy.freedesktop.org/releases/"
860 name "/" name "-" version ".tar.bz2"))
861 (sha256
862 (base32
863 "1bjx85k7jyfi5pvl765fzc7q2iz9va51anrc2djv7caksqsdbjlg"))))
864 (build-system gnu-build-system)
865 (arguments
866 '(#:parallel-tests? #f
867 #:phases
868 (modify-phases %standard-phases
869 (add-before 'check 'pre-check
870 (lambda _
871 (setenv "HOME" (getenv "TMPDIR"))
872 #t)))))
873 (native-inputs
874 `(("glib:bin" ,glib "bin") ; for glib-genmarshal, etc.
875 ("gobject-introspection" ,gobject-introspection)
876 ("intltool" ,intltool)
877 ("pkg-config" ,pkg-config)
878 ("python" ,python-2)
879 ("xsltproc" ,libxslt)))
880 (propagated-inputs
881 ;; telepathy-logger-0.2.pc refers to all these.
882 `(("libxml2" ,libxml2)
883 ("sqlite" ,sqlite)
884 ("telepathy-glib" ,telepathy-glib)))
885 (synopsis "Telepathy logger library")
886 (home-page "https://telepathy.freedesktop.org/")
887 (description
888 "Telepathy logger is a headless observer client that logs information
889 received by the Telepathy framework. It features pluggable backends to log
890 different sorts of messages in different formats.")
891 (license license:lgpl2.1+)))
892
893 (define-public telepathy-idle
894 (package
895 (name "telepathy-idle")
896 (version "0.2.0")
897 (source (origin
898 (method url-fetch)
899 (uri (string-append "https://telepathy.freedesktop.org/releases/"
900 name "/" name "-" version ".tar.bz2"))
901 (sha256
902 (base32
903 "1argdzbif1vdmwp5vqbgkadq9ancjmgdm2ncp0qfckni715ss4rh"))))
904 (build-system gnu-build-system)
905 (native-inputs
906 `(("pkg-config" ,pkg-config)))
907 (inputs
908 `(("xsltproc" ,libxslt)
909 ("python" ,python-2)
910 ("python-dbus" ,python2-dbus)))
911 (propagated-inputs
912 `(("telepathy-glib" ,telepathy-glib)))
913 (home-page "https://telepathy.freedesktop.org/")
914 (synopsis "Telepathy IRC connection manager")
915 (description
916 "Idle is an IRC connection manager for the Telepathy framework. This
917 package enables usage of IRC channels and private messages in Telepathy instant
918 messaging clients such as Empathy, GNOME Shell or KDE Telepathy.")
919 (license (list license:lgpl2.1 license:lgpl2.1+))))
920
921 (define-public telepathy-mission-control
922 (package
923 (name "telepathy-mission-control")
924 (version "5.16.4")
925 (source (origin
926 (method url-fetch)
927 (uri (string-append "https://telepathy.freedesktop.org/releases/"
928 name "/" name "-" version ".tar.gz"))
929 (sha256
930 (base32
931 "1jz6wwgsfxixha6ys2hbzbk5faqnj9kh2m5qdlgx5anqgandsscp"))))
932 (build-system gnu-build-system)
933 (native-inputs
934 `(("glib:bin" ,glib "bin") ; for glib-compile-schemas, etc.
935 ("pkg-config" ,pkg-config)))
936 (inputs
937 `(("dconf" ,dconf)
938 ("gtk-doc" ,gtk-doc)
939 ("libgnome-keyring" ,libgnome-keyring)
940 ("python" ,python-2)
941 ("xsltproc" ,libxslt)))
942 (propagated-inputs
943 `(("telepathy-glib" ,telepathy-glib)))
944 (home-page "https://telepathy.freedesktop.org/wiki/Components/Mission_Control/")
945 (synopsis "Telepathy real-time communication framework management daemon")
946 (description
947 "Telepathy Mission Control 5 is an account manager and channel dispatcher
948 for the Telepathy framework, allowing user interfaces and other clients to
949 share connections to real-time communication services without conflicting.")
950 (license license:lgpl2.1)))
951
952 (define-public colord-gtk
953 (package
954 (name "colord-gtk")
955 (version "0.1.26")
956 (source (origin
957 (method url-fetch)
958 (uri (string-append "https://www.freedesktop.org/software/colord"
959 "/releases/" name "-" version ".tar.xz"))
960 (sha256
961 (base32
962 "0i9y3bb5apj6a0f8cx36l6mjzs7xc0k7nf0magmf58vy2mzhpl18"))))
963 (build-system gnu-build-system)
964 (arguments '(#:tests? #f)) ; require the colord system service
965 (native-inputs
966 `(("gobject-introspection" ,gobject-introspection)
967 ("intltool" ,intltool)
968 ("pkg-config" ,pkg-config)
969 ("vala" ,vala)))
970 (propagated-inputs
971 ;; colord-gtk.pc refers to all these.
972 `(("colord" ,colord)
973 ("gtk+" ,gtk+)))
974 (synopsis "GTK integration for libcolord")
975 (home-page "https://www.freedesktop.org/software/colord/")
976 (description
977 "This is a GTK+ convenience library for interacting with colord. It is
978 useful for both applications which need colour management and applications that
979 wish to perform colour calibration.")
980 (license license:lgpl2.1+)))
981
982 (define-public libfprint
983 (package
984 (name "libfprint")
985 (version "0.6.0")
986 (source (origin
987 (method url-fetch)
988 (uri (string-append "https://people.freedesktop.org/~hadess/"
989 name "-" version ".tar.xz"))
990 (sha256
991 (base32
992 "1giwh2z63mn45galsjb59rhyrvgwcy01hvvp4g01iaa2snvzr0r5"))))
993 (build-system gnu-build-system)
994 (arguments
995 '(#:configure-flags (list (string-append "--with-udev-rules-dir="
996 (assoc-ref %outputs "out")
997 "/lib/udev/rules.d"))))
998 (native-inputs
999 `(("pkg-config" ,pkg-config)))
1000 (inputs
1001 `(("libusb" ,libusb)
1002 ("nss" ,nss)
1003 ("glib" ,glib)
1004 ("eudev" ,eudev)
1005 ("pixman" ,pixman)))
1006 (home-page "https://www.freedesktop.org/wiki/Software/fprint/libfprint/")
1007 (synopsis "Library to access fingerprint readers")
1008 (description
1009 "libfprint is a library designed to make it easy for application
1010 developers to add support for consumer fingerprint readers to their
1011 software.")
1012 (license license:lgpl2.1+)))
1013
1014 (define-public fprintd
1015 (package
1016 (name "fprintd")
1017 (version "0.7.0")
1018 (source (origin
1019 (method url-fetch)
1020 (uri (string-append
1021 "https://people.freedesktop.org/~hadess/fprintd-"
1022 version ".tar.xz"))
1023 (sha256
1024 (base32
1025 "05915i0bv7q62fqrs5diqwr8dz3pwqa1c1ivcgggkjyw0xk4ldp5"))))
1026 (build-system gnu-build-system)
1027 (arguments
1028 '(#:phases (modify-phases %standard-phases
1029 (add-before 'build 'set-sysconfdir
1030 (lambda* (#:key outputs #:allow-other-keys)
1031 ;; Work around a bug whereby the 'SYSCONFDIR' macro
1032 ;; expands literally to '${prefix}/etc'.
1033 (let ((out (assoc-ref outputs "out")))
1034 (substitute* "src/main.c"
1035 (("SYSCONFDIR, \"fprintd.conf\"")
1036 (string-append "\"" out "/etc\", "
1037 "\"fprintd.conf\"")))
1038 #t))))))
1039 (native-inputs
1040 `(("pkg-config" ,pkg-config)
1041 ("intltool" ,intltool)))
1042 (inputs
1043 `(("libfprint" ,libfprint)
1044 ("dbus-glib" ,dbus-glib)
1045 ("polkit" ,polkit)
1046 ("linux-pam" ,linux-pam))) ;for pam_fprintd
1047 (home-page "https://www.freedesktop.org/wiki/Software/fprint/fprintd/")
1048 (synopsis "D-Bus daemon that exposes fingerprint reader functionality")
1049 (description
1050 "fprintd is a D-Bus daemon that offers functionality of libfprint, a
1051 library to access fingerprint readers, over the D-Bus interprocess
1052 communication bus. This daemon layer above libfprint solves problems related
1053 to applications simultaneously competing for fingerprint readers.")
1054 (license license:gpl2+)))
1055
1056 (define-public desktop-file-utils
1057 (package
1058 (name "desktop-file-utils")
1059 (version "0.23")
1060 (source (origin
1061 (method url-fetch)
1062 (uri (string-append "https://www.freedesktop.org/software/" name
1063 "/releases/" name "-" version ".tar.xz"))
1064 (sha256
1065 (base32
1066 "119kj2w0rrxkhg4f9cf5waa55jz1hj8933vh47vcjipcplql02bc"))))
1067 (build-system gnu-build-system)
1068 (native-inputs
1069 `(("pkg-config" ,pkg-config)))
1070 (inputs
1071 `(("glib" ,glib)))
1072 (home-page "https://www.freedesktop.org/wiki/Software/desktop-file-utils/")
1073 (synopsis "Utilities for working with desktop entries")
1074 (description
1075 "This package contains a few command line utilities for working with
1076 desktop entries:
1077
1078 desktop-file-validate: validates a desktop file and prints warnings/errors
1079 about desktop entry specification violations.
1080
1081 desktop-file-install: installs a desktop file to the applications directory,
1082 optionally munging it a bit in transit.
1083
1084 update-desktop-database: updates the database containing a cache of MIME types
1085 handled by desktop files.")
1086 (license license:gpl2+)))
1087
1088 (define-public xdg-user-dirs
1089 (package
1090 (name "xdg-user-dirs")
1091 (version "0.16")
1092 (source (origin
1093 (method url-fetch)
1094 (uri (string-append "http://user-dirs.freedesktop.org/releases/"
1095 name "-" version ".tar.gz"))
1096 (sha256
1097 (base32 "1rp3c94hxjlfsryvwajklynfnrcvxplhwnjqc7395l89i0nb83vp"))))
1098 (build-system gnu-build-system)
1099 (native-inputs
1100 `(("gettext" ,gettext-minimal)
1101 ("docbook-xsl" ,docbook-xsl)
1102 ("docbook-xml" ,docbook-xml-4.3)
1103 ("xsltproc" ,libxslt)))
1104 (arguments
1105 `(#:phases
1106 (modify-phases %standard-phases
1107 (add-before 'build 'locate-catalog-files
1108 (lambda* (#:key inputs #:allow-other-keys)
1109 (let ((xmldoc (string-append (assoc-ref inputs "docbook-xml")
1110 "/xml/dtd/docbook"))
1111 (xsldoc (string-append (assoc-ref inputs "docbook-xsl")
1112 "/xml/xsl/docbook-xsl-"
1113 ,(package-version docbook-xsl))))
1114 (for-each (lambda (file)
1115 (substitute* file
1116 (("http://.*/docbookx\\.dtd")
1117 (string-append xmldoc "/docbookx.dtd"))))
1118 (find-files "man" "\\.xml$"))
1119 (substitute* "man/Makefile"
1120 (("http://.*/docbook\\.xsl")
1121 (string-append xsldoc "/manpages/docbook.xsl")))
1122 #t))))))
1123 (home-page "https://www.freedesktop.org/wiki/Software/xdg-user-dirs/")
1124 (synopsis "Tool to help manage \"well known\" user directories")
1125 (description "xdg-user-dirs is a tool to help manage \"well known\" user
1126 directories, such as the desktop folder or the music folder. It also handles
1127 localization (i.e. translation) of the file names. Designed to be
1128 automatically run when a user logs in, xdg-user-dirs can also be run
1129 manually by a user.")
1130 (license license:gpl2)))
1131
1132 (define-public perl-file-basedir
1133 (package
1134 (name "perl-file-basedir")
1135 (version "0.07")
1136 (source
1137 (origin
1138 (method url-fetch)
1139 (uri (string-append "mirror://cpan/authors/id/K/KI/KIMRYAN/"
1140 "File-BaseDir-" version ".tar.gz"))
1141 (sha256
1142 (base32
1143 "0aq8d4hsaxqibp36f773y6dfck7zd82v85sp8vhi6pjkg3pmf2hj"))))
1144 (build-system perl-build-system)
1145 (native-inputs
1146 `(("perl-module-build" ,perl-module-build)
1147 ("perl-file-which" ,perl-file-which)
1148 ("perl-test-pod" ,perl-test-pod)
1149 ("perl-test-pod-coverage" ,perl-test-pod-coverage)
1150 ("xdg-user-dirs" ,xdg-user-dirs)))
1151 (propagated-inputs
1152 `(("perl-ipc-system-simple" ,perl-ipc-system-simple)))
1153 (home-page "http://search.cpan.org/dist/File-BaseDir/")
1154 (synopsis "Use the Freedesktop.org base directory specification")
1155 (description
1156 "@code{File::Basedir} can be used to find directories and files as
1157 specified by the Freedesktop.org Base Directory Specification. This
1158 specifications gives a mechanism to locate directories for configuration,
1159 application data and cache data.")
1160 (license license:perl-license)))
1161
1162 (define-public perl-file-desktopentry
1163 (package
1164 (name "perl-file-desktopentry")
1165 (version "0.22")
1166 (source
1167 (origin
1168 (method url-fetch)
1169 (uri (string-append "mirror://cpan/authors/id/M/MI/MICHIELB/"
1170 "File-DesktopEntry-" version ".tar.gz"))
1171 (sha256
1172 (base32
1173 "1f1maqix2kbfg2rf008m7mqnvv6nvcf9y6pcgdv2kxp2vbih370n"))))
1174 (build-system perl-build-system)
1175 (native-inputs
1176 `(("perl-test-pod" ,perl-test-pod)
1177 ("perl-test-pod-coverage" ,perl-test-pod-coverage)))
1178 (propagated-inputs
1179 `(("perl-file-basedir" ,perl-file-basedir)
1180 ("perl-uri" ,perl-uri)))
1181 (home-page "http://search.cpan.org/~michielb/File-DesktopEntry/")
1182 (synopsis "Handle @file{.desktop} files")
1183 (description
1184 "@code{File::DesktopEntry} parses @file{.desktop} files defined by the
1185 Freedesktop.org @dfn{Desktop Entry} specification. It can also run the
1186 applications define in those files.")
1187 (license license:perl-license)))
1188
1189 (define-public perl-file-mimeinfo
1190 (package
1191 (name "perl-file-mimeinfo")
1192 (version "0.28")
1193 (source
1194 (origin
1195 (method url-fetch)
1196 (uri (string-append "mirror://cpan/authors/id/M/MI/MICHIELB/"
1197 "File-MimeInfo-" version ".tar.gz"))
1198 (sha256
1199 (base32
1200 "1ipbh63bkh1r2gy5g7q4bzhki8j29mm1jkhbv60p9vwsdys5s91a"))))
1201 (build-system perl-build-system)
1202 ;; If the tests are fixed, add perl-test-pod, perl-test-pod-coverage, and
1203 ;; perl-test-tiny as native-inputs.
1204 (propagated-inputs
1205 `(("shared-mime-info" ,shared-mime-info)
1206 ("perl-file-desktopentry" ,perl-file-desktopentry)))
1207 (arguments
1208 ;; Some tests fail due to requiring the mimetype of perl files to be
1209 ;; text/plain when they are actually application/x-perl.
1210 `(#:tests? #f
1211 #:phases
1212 (modify-phases %standard-phases
1213 (add-after 'install 'wrap-programs
1214 (lambda* (#:key outputs #:allow-other-keys)
1215 (let ((out (assoc-ref outputs "out")))
1216 (for-each (lambda (prog)
1217 (wrap-program (string-append out "/bin/" prog)
1218 `("PERL5LIB" ":" prefix
1219 (,(string-append (getenv "PERL5LIB") ":" out
1220 "/lib/perl5/site_perl")))))
1221 '("mimeopen" "mimetype")))
1222 #t)))))
1223 (home-page "http://search.cpan.org/dist/File-MimeInfo/")
1224 (synopsis "Determine file type from the file name")
1225 (description
1226 "@code{File::Mimeinfo} can be used to determine the MIME type of a file.
1227 It tries to implement the Freedesktop specification for a shared MIME
1228 database.
1229
1230 This package also contains two related utilities:
1231
1232 @itemize
1233 @item @command{mimetype} determines a file's MIME type;
1234 @item @command{mimeopen} opens files in an appropriate program according to
1235 their MIME type.
1236 @end itemize")
1237 (license license:perl-license)))