1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2015 Andy Wingo <wingo@igalia.com>
4 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
7 ;;; This file is part of GNU Guix.
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22 (define-module (gnu packages polkit)
23 #:use-module ((guix licenses) #:select (lgpl2.0+))
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system cmake)
27 #:use-module (guix build-system gnu)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages freedesktop)
30 #:use-module (gnu packages glib)
31 #:use-module (gnu packages gnuzilla)
32 #:use-module (gnu packages linux)
33 #:use-module (gnu packages perl)
34 #:use-module (gnu packages pkg-config)
35 #:use-module (gnu packages python)
36 #:use-module (gnu packages qt)
37 #:use-module (gnu packages xml))
46 "https://www.freedesktop.org/software/polkit/releases/"
47 name "-" version ".tar.gz"))
50 "109w86kfqrgz83g9ivggplmgc77rz8kx8646izvm2jb57h4rbh71"))
51 (patches (search-patches "polkit-drop-test.patch"))
52 (modules '((guix build utils)))
55 (use-modules (guix build utils))
56 (substitute* "configure"
57 ;; Replace libsystemd-login with libelogind.
58 (("libsystemd-login") "libelogind")
59 ;; Skip the sanity check that the current system runs
61 (("test ! -d /sys/fs/cgroup/systemd/") "false"))
62 (substitute* "src/polkit/polkitunixsession-systemd.c"
63 (("systemd") "elogind"))
64 (substitute* "src/polkitbackend/polkitbackendsessionmonitor-systemd.c"
65 (("systemd") "elogind"))
66 (substitute* "src/polkitbackend/polkitbackendjsauthority.c"
67 (("systemd") "elogind"))
69 ;; GuixSD's polkit service stores actions under
70 ;; /etc/polkit-1/actions.
71 (substitute* "src/polkitbackend/polkitbackendinteractiveauthority.c"
72 (("PACKAGE_DATA_DIR \"/polkit-1/actions\"")
73 "PACKAGE_SYSCONF_DIR \"/polkit-1/actions\""))
75 ;; Set the setuid helper's real location.
76 (substitute* "src/polkitagent/polkitagentsession.c"
77 (("PACKAGE_PREFIX \"/lib/polkit-1/polkit-agent-helper-1\"")
78 "\"/run/setuid-programs/polkit-agent-helper-1\""))))))
79 (build-system gnu-build-system)
82 ("linux-pam" ,linux-pam)
87 `(("glib" ,glib))) ; required by polkit-gobject-1.pc
89 `(("pkg-config" ,pkg-config)
90 ("glib:bin" ,glib "bin") ; for glib-mkenums
91 ("intltool" ,intltool)
92 ("gobject-introspection" ,gobject-introspection)))
94 `(#:configure-flags '("--sysconfdir=/etc"
97 (modify-phases %standard-phases
99 'unpack 'fix-introspection-install-dir
100 (lambda* (#:key outputs #:allow-other-keys)
101 (let ((out (assoc-ref outputs "out")))
102 (substitute* (find-files "." "Makefile.in")
103 (("@INTROSPECTION_GIRDIR@")
104 (string-append out "/share/gir-1.0/"))
105 (("@INTROSPECTION_TYPELIBDIR@")
106 (string-append out "/lib/girepository-1.0/"))))))
109 (lambda* (#:key outputs (make-flags '()) #:allow-other-keys)
110 ;; Override sysconfdir during "make install", to avoid attempting
111 ;; to install in /etc, and to instead install the skeletons in the
113 (let ((out (assoc-ref outputs "out")))
114 (zero? (apply system*
116 (string-append "sysconfdir=" out "/etc")
117 (string-append "polkit_actiondir="
118 out "/share/polkit-1/actions")
120 (home-page "http://www.freedesktop.org/wiki/Software/polkit/")
121 (synopsis "Authorization API for privilege management")
122 (description "Polkit is an application-level toolkit for defining and
123 handling the policy that allows unprivileged processes to speak to
124 privileged processes. It is a framework for centralizing the decision
125 making process with respect to granting access to privileged operations
126 for unprivileged applications.")
129 (define-public polkit-qt
132 (version "1-0.112.0")
136 "http://download.kde.org/stable/apps/KDE4.x/admin/"
137 name "-" version ".tar.bz2"))
140 "1ip78x20hjqvm08kxhp6gb8hf6k5n6sxyx6kk2yvvq53djzh7yv7"))))
141 (build-system cmake-build-system)
143 `(("polkit" ,polkit)))
145 `(("qt" ,qt))) ; qt-4 according to the pkg-config files
147 `(("pkg-config" ,pkg-config)))
149 `(#:configure-flags (list (string-append "-DCMAKE_INSTALL_RPATH="
150 (assoc-ref %outputs "out")
152 (assoc-ref %outputs "out")
154 #:tests? #f)) ; there is a test subdirectory, but no test target
155 (home-page "http://api.kde.org/kdesupport-api/polkit-qt-1-apidocs/")
156 (synopsis "Qt frontend to the polkit library")
157 (description "Polkit-qt is a library that lets developers use the
158 PolicyKit API through a Qt-styled API. It is mainly a wrapper around
159 QAction and QAbstractButton that lets you integrate those two component
160 easily with PolicyKit.")