Commit | Line | Data |
---|---|---|
cff1c5c1 AE |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2014 Andreas Enge <andreas@enge.fr> | |
7b6c5c5d | 3 | ;;; Copyright © 2015 Andy Wingo <wingo@igalia.com> |
3f130e42 | 4 | ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org> |
7fe8ad76 | 5 | ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il> |
728dc8fa | 6 | ;;; Copyright © 2017 Huang Ying <huang.ying.caritas@gmail.com> |
3c4bbb4c | 7 | ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr> |
bcdee2dc | 8 | ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net> |
cff1c5c1 AE |
9 | ;;; |
10 | ;;; This file is part of GNU Guix. | |
11 | ;;; | |
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. | |
16 | ;;; | |
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. | |
21 | ;;; | |
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/>. | |
24 | ||
25 | (define-module (gnu packages polkit) | |
4923e06f | 26 | #:use-module ((guix licenses) #:select (lgpl2.0+)) |
cff1c5c1 AE |
27 | #:use-module (guix packages) |
28 | #:use-module (guix download) | |
054a3921 | 29 | #:use-module (guix build-system cmake) |
cff1c5c1 | 30 | #:use-module (guix build-system gnu) |
c4bd2aca | 31 | #:use-module (gnu packages) |
7b6c5c5d | 32 | #:use-module (gnu packages freedesktop) |
c4bd2aca | 33 | #:use-module (gnu packages glib) |
728dc8fa | 34 | #:use-module (gnu packages gtk) |
4923e06f | 35 | #:use-module (gnu packages gnuzilla) |
c4bd2aca | 36 | #:use-module (gnu packages linux) |
aff0cce9 | 37 | #:use-module (gnu packages nss) |
cff1c5c1 | 38 | #:use-module (gnu packages perl) |
c4bd2aca | 39 | #:use-module (gnu packages pkg-config) |
054a3921 | 40 | #:use-module (gnu packages qt) |
c4bd2aca | 41 | #:use-module (gnu packages xml)) |
cff1c5c1 | 42 | |
c4bd2aca AE |
43 | (define-public polkit |
44 | (package | |
45 | (name "polkit") | |
35884195 | 46 | (version "0.116") |
c4bd2aca AE |
47 | (source (origin |
48 | (method url-fetch) | |
49 | (uri (string-append | |
5cc3096c | 50 | "https://www.freedesktop.org/software/polkit/releases/" |
c4bd2aca AE |
51 | name "-" version ".tar.gz")) |
52 | (sha256 | |
53 | (base32 | |
35884195 | 54 | "1c9lbpndh5zis22f154vjrhnqw65z8s85nrgl42v738yf6g0q5w8")) |
7b6c5c5d AW |
55 | (modules '((guix build utils))) |
56 | (snippet | |
57 | '(begin | |
58 | (use-modules (guix build utils)) | |
bcdee2dc RW |
59 | ;; Disable broken test. |
60 | (substitute* "test/Makefile.in" | |
61 | (("SUBDIRS = mocklibc . polkit polkitbackend") | |
62 | "SUBDIRS = mocklibc . polkit")) | |
7b6c5c5d AW |
63 | (substitute* "configure" |
64 | ;; Replace libsystemd-login with libelogind. | |
65 | (("libsystemd-login") "libelogind") | |
66 | ;; Skip the sanity check that the current system runs | |
67 | ;; systemd. | |
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")) | |
bcdee2dc | 73 | (substitute* "src/polkitbackend/polkitbackendjsauthority.cpp" |
3f130e42 AW |
74 | (("systemd") "elogind")) |
75 | ||
59e80445 | 76 | ;; Guix System's polkit service stores actions under |
222e3319 | 77 | ;; /etc/polkit-1/actions. |
3f130e42 AW |
78 | (substitute* "src/polkitbackend/polkitbackendinteractiveauthority.c" |
79 | (("PACKAGE_DATA_DIR \"/polkit-1/actions\"") | |
222e3319 LC |
80 | "PACKAGE_SYSCONF_DIR \"/polkit-1/actions\"")) |
81 | ||
82 | ;; Set the setuid helper's real location. | |
83 | (substitute* "src/polkitagent/polkitagentsession.c" | |
84 | (("PACKAGE_PREFIX \"/lib/polkit-1/polkit-agent-helper-1\"") | |
3c4bbb4c TGR |
85 | "\"/run/setuid-programs/polkit-agent-helper-1\"")) |
86 | #t)))) | |
c4bd2aca AE |
87 | (build-system gnu-build-system) |
88 | (inputs | |
3f130e42 AW |
89 | `(("expat" ,expat) |
90 | ("linux-pam" ,linux-pam) | |
91 | ("elogind" ,elogind) | |
35884195 | 92 | ("mozjs" ,mozjs-60) |
3f130e42 | 93 | ("nspr" ,nspr))) |
b118401f | 94 | (propagated-inputs |
3f130e42 | 95 | `(("glib" ,glib))) ; required by polkit-gobject-1.pc |
c4bd2aca | 96 | (native-inputs |
3f130e42 AW |
97 | `(("pkg-config" ,pkg-config) |
98 | ("glib:bin" ,glib "bin") ; for glib-mkenums | |
99 | ("intltool" ,intltool) | |
100 | ("gobject-introspection" ,gobject-introspection))) | |
101 | (arguments | |
102 | `(#:configure-flags '("--sysconfdir=/etc" | |
103 | "--enable-man-pages") | |
104 | #:phases | |
105 | (modify-phases %standard-phases | |
106 | (add-after | |
107 | 'unpack 'fix-introspection-install-dir | |
108 | (lambda* (#:key outputs #:allow-other-keys) | |
109 | (let ((out (assoc-ref outputs "out"))) | |
110 | (substitute* (find-files "." "Makefile.in") | |
111 | (("@INTROSPECTION_GIRDIR@") | |
112 | (string-append out "/share/gir-1.0/")) | |
113 | (("@INTROSPECTION_TYPELIBDIR@") | |
3c4bbb4c TGR |
114 | (string-append out "/lib/girepository-1.0/"))) |
115 | #t))) | |
3f130e42 AW |
116 | (replace |
117 | 'install | |
118 | (lambda* (#:key outputs (make-flags '()) #:allow-other-keys) | |
119 | ;; Override sysconfdir during "make install", to avoid attempting | |
120 | ;; to install in /etc, and to instead install the skeletons in the | |
121 | ;; output directory. | |
122 | (let ((out (assoc-ref outputs "out"))) | |
87b6305e | 123 | (apply invoke "make" "install" |
3f130e42 AW |
124 | (string-append "sysconfdir=" out "/etc") |
125 | (string-append "polkit_actiondir=" | |
126 | out "/share/polkit-1/actions") | |
3c4bbb4c TGR |
127 | make-flags) |
128 | #t)))))) | |
57e7d748 | 129 | (home-page "https://www.freedesktop.org/wiki/Software/polkit/") |
c4bd2aca AE |
130 | (synopsis "Authorization API for privilege management") |
131 | (description "Polkit is an application-level toolkit for defining and | |
132 | handling the policy that allows unprivileged processes to speak to | |
133 | privileged processes. It is a framework for centralizing the decision | |
134 | making process with respect to granting access to privileged operations | |
135 | for unprivileged applications.") | |
136 | (license lgpl2.0+))) | |
054a3921 AE |
137 | |
138 | (define-public polkit-qt | |
139 | (package | |
140 | (name "polkit-qt") | |
141 | (version "1-0.112.0") | |
142 | (source (origin | |
143 | (method url-fetch) | |
144 | (uri (string-append | |
1780e786 EF |
145 | "mirror://kde//stable/apps/KDE4.x/admin/" |
146 | "polkit-qt-" version ".tar.bz2")) | |
054a3921 AE |
147 | (sha256 |
148 | (base32 | |
149 | "1ip78x20hjqvm08kxhp6gb8hf6k5n6sxyx6kk2yvvq53djzh7yv7")))) | |
150 | (build-system cmake-build-system) | |
151 | (inputs | |
7fe8ad76 | 152 | `(("polkit" ,polkit))) |
054a3921 | 153 | (propagated-inputs |
51b1d539 | 154 | `(("qtbase" ,qtbase))) |
054a3921 | 155 | (native-inputs |
b3546174 | 156 | `(("pkg-config" ,pkg-config))) |
054a3921 | 157 | (arguments |
cb151c68 LC |
158 | `(#:configure-flags (list (string-append "-DCMAKE_INSTALL_RPATH=" |
159 | (assoc-ref %outputs "out") | |
160 | "/lib:" | |
161 | (assoc-ref %outputs "out") | |
162 | "/lib64")) | |
163 | #:tests? #f)) ; there is a test subdirectory, but no test target | |
943cc0e8 | 164 | (home-page "https://api.kde.org/kdesupport-api/polkit-qt-1-apidocs/") |
054a3921 AE |
165 | (synopsis "Qt frontend to the polkit library") |
166 | (description "Polkit-qt is a library that lets developers use the | |
167 | PolicyKit API through a Qt-styled API. It is mainly a wrapper around | |
168 | QAction and QAbstractButton that lets you integrate those two component | |
169 | easily with PolicyKit.") | |
170 | (license lgpl2.0+))) | |
728dc8fa HY |
171 | |
172 | (define-public polkit-gnome | |
173 | (package | |
174 | (name "polkit-gnome") | |
175 | (version "0.105") | |
176 | (source (origin | |
177 | (method url-fetch) | |
178 | (uri (string-append "mirror://gnome/sources/" | |
179 | name "/" version "/" | |
180 | name "-" version ".tar.xz")) | |
181 | (sha256 | |
182 | (base32 | |
183 | "0sckmcbxyj6sbrnfc5p5lnw27ccghsid6v6wxq09mgxqcd4lk10p")))) | |
184 | (build-system gnu-build-system) | |
185 | (inputs `(("gtk+" ,gtk+) | |
186 | ("polkit" ,polkit))) | |
187 | (native-inputs `(("intltool" ,intltool) | |
188 | ("pkg-config" ,pkg-config))) | |
189 | (synopsis "Legacy polkit authentication agent for GNOME") | |
190 | (description "PolicyKit-gnome provides a D-Bus session bus service | |
191 | that is used to bring up authentication dialogs used for obtaining | |
192 | privileges.") | |
57e7d748 | 193 | (home-page "https://www.freedesktop.org/wiki/Software/polkit/") |
728dc8fa | 194 | (license lgpl2.0+))) |