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>
6 ;;; Copyright © 2017 Huang Ying <huang.ying.caritas@gmail.com>
7 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
10 ;;; This file is part of GNU Guix.
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25 (define-module (gnu packages polkit)
26 #:use-module ((guix licenses) #:select (lgpl2.0+))
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix build-system cmake)
30 #:use-module (guix build-system gnu)
31 #:use-module (gnu packages)
32 #:use-module (gnu packages freedesktop)
33 #:use-module (gnu packages glib)
34 #:use-module (gnu packages gtk)
35 #:use-module (gnu packages gnuzilla)
36 #:use-module (gnu packages linux)
37 #:use-module (gnu packages nss)
38 #:use-module (gnu packages perl)
39 #:use-module (gnu packages pkg-config)
40 #:use-module (gnu packages qt)
41 #:use-module (gnu packages xml))
50 "https://www.freedesktop.org/software/polkit/releases/"
51 name "-" version ".tar.gz"))
54 "1c9lbpndh5zis22f154vjrhnqw65z8s85nrgl42v738yf6g0q5w8"))
55 (modules '((guix build utils)))
58 (use-modules (guix build utils))
59 ;; Disable broken test.
60 (substitute* "test/Makefile.in"
61 (("SUBDIRS = mocklibc . polkit polkitbackend")
62 "SUBDIRS = mocklibc . polkit"))
63 (substitute* "configure"
64 ;; Replace libsystemd-login with libelogind.
65 (("libsystemd-login") "libelogind")
66 ;; Skip the sanity check that the current system runs
68 (("test ! -d /sys/fs/cgroup/systemd/") "false"))
69 (substitute* "src/polkit/polkitunixsession-systemd.c"
70 (("systemd") "elogind"))
71 (substitute* "src/polkitbackend/polkitbackendsessionmonitor-systemd.c"
72 (("systemd") "elogind"))
73 (substitute* "src/polkitbackend/polkitbackendjsauthority.cpp"
74 (("systemd") "elogind"))
76 ;; Guix System's polkit service stores actions under
77 ;; /etc/polkit-1/actions.
78 (substitute* "src/polkitbackend/polkitbackendinteractiveauthority.c"
79 (("PACKAGE_DATA_DIR \"/polkit-1/actions\"")
80 "PACKAGE_SYSCONF_DIR \"/polkit-1/actions\""))
82 ;; Set the setuid helper's real location.
83 (substitute* "src/polkitagent/polkitagentsession.c"
84 (("PACKAGE_PREFIX \"/lib/polkit-1/polkit-agent-helper-1\"")
85 "\"/run/setuid-programs/polkit-agent-helper-1\""))
87 (build-system gnu-build-system)
90 ("linux-pam" ,linux-pam)
95 `(("glib" ,glib))) ; required by polkit-gobject-1.pc
97 `(("pkg-config" ,pkg-config)
98 ("glib:bin" ,glib "bin") ; for glib-mkenums
99 ("intltool" ,intltool)
100 ("gobject-introspection" ,gobject-introspection)))
102 `(#:configure-flags '("--sysconfdir=/etc"
103 ;; XXX: MozJS 60 requires the C++11 ABI or higher.
104 ;; Remove when the default compiler is >= GCC 6.
105 "CXXFLAGS=-std=gnu++11"
106 "--enable-man-pages")
108 (modify-phases %standard-phases
110 'unpack 'fix-introspection-install-dir
111 (lambda* (#:key outputs #:allow-other-keys)
112 (let ((out (assoc-ref outputs "out")))
113 (substitute* (find-files "." "Makefile.in")
114 (("@INTROSPECTION_GIRDIR@")
115 (string-append out "/share/gir-1.0/"))
116 (("@INTROSPECTION_TYPELIBDIR@")
117 (string-append out "/lib/girepository-1.0/")))
121 (lambda* (#:key outputs (make-flags '()) #:allow-other-keys)
122 ;; Override sysconfdir during "make install", to avoid attempting
123 ;; to install in /etc, and to instead install the skeletons in the
125 (let ((out (assoc-ref outputs "out")))
126 (apply invoke "make" "install"
127 (string-append "sysconfdir=" out "/etc")
128 (string-append "polkit_actiondir="
129 out "/share/polkit-1/actions")
132 (home-page "https://www.freedesktop.org/wiki/Software/polkit/")
133 (synopsis "Authorization API for privilege management")
134 (description "Polkit is an application-level toolkit for defining and
135 handling the policy that allows unprivileged processes to speak to
136 privileged processes. It is a framework for centralizing the decision
137 making process with respect to granting access to privileged operations
138 for unprivileged applications.")
141 (define-public polkit-qt
144 (version "1-0.112.0")
148 "http://download.kde.org/stable/apps/KDE4.x/admin/"
149 name "-" version ".tar.bz2"))
152 "1ip78x20hjqvm08kxhp6gb8hf6k5n6sxyx6kk2yvvq53djzh7yv7"))))
153 (build-system cmake-build-system)
155 `(("polkit" ,polkit)))
157 `(("qtbase" ,qtbase)))
159 `(("pkg-config" ,pkg-config)))
161 `(#:configure-flags (list (string-append "-DCMAKE_INSTALL_RPATH="
162 (assoc-ref %outputs "out")
164 (assoc-ref %outputs "out")
166 #:tests? #f)) ; there is a test subdirectory, but no test target
167 (home-page "http://api.kde.org/kdesupport-api/polkit-qt-1-apidocs/")
168 (synopsis "Qt frontend to the polkit library")
169 (description "Polkit-qt is a library that lets developers use the
170 PolicyKit API through a Qt-styled API. It is mainly a wrapper around
171 QAction and QAbstractButton that lets you integrate those two component
172 easily with PolicyKit.")
175 (define-public polkit-gnome
177 (name "polkit-gnome")
181 (uri (string-append "mirror://gnome/sources/"
183 name "-" version ".tar.xz"))
186 "0sckmcbxyj6sbrnfc5p5lnw27ccghsid6v6wxq09mgxqcd4lk10p"))))
187 (build-system gnu-build-system)
188 (inputs `(("gtk+" ,gtk+)
190 (native-inputs `(("intltool" ,intltool)
191 ("pkg-config" ,pkg-config)))
192 (synopsis "Legacy polkit authentication agent for GNOME")
193 (description "PolicyKit-gnome provides a D-Bus session bus service
194 that is used to bring up authentication dialogs used for obtaining
196 (home-page "https://www.freedesktop.org/wiki/Software/polkit/")