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> |
cff1c5c1 AE |
7 | ;;; |
8 | ;;; This file is part of GNU Guix. | |
9 | ;;; | |
10 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
11 | ;;; under the terms of the GNU General Public License as published by | |
12 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
13 | ;;; your option) any later version. | |
14 | ;;; | |
15 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
16 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | ;;; GNU General Public License for more details. | |
19 | ;;; | |
20 | ;;; You should have received a copy of the GNU General Public License | |
21 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
22 | ||
23 | (define-module (gnu packages polkit) | |
4923e06f | 24 | #:use-module ((guix licenses) #:select (lgpl2.0+)) |
cff1c5c1 AE |
25 | #:use-module (guix packages) |
26 | #:use-module (guix download) | |
054a3921 | 27 | #:use-module (guix build-system cmake) |
cff1c5c1 | 28 | #:use-module (guix build-system gnu) |
c4bd2aca | 29 | #:use-module (gnu packages) |
7b6c5c5d | 30 | #:use-module (gnu packages freedesktop) |
c4bd2aca | 31 | #:use-module (gnu packages glib) |
728dc8fa | 32 | #:use-module (gnu packages gtk) |
4923e06f | 33 | #:use-module (gnu packages gnuzilla) |
c4bd2aca | 34 | #:use-module (gnu packages linux) |
cff1c5c1 | 35 | #:use-module (gnu packages perl) |
c4bd2aca AE |
36 | #:use-module (gnu packages pkg-config) |
37 | #:use-module (gnu packages python) | |
054a3921 | 38 | #:use-module (gnu packages qt) |
c4bd2aca | 39 | #:use-module (gnu packages xml)) |
cff1c5c1 | 40 | |
c4bd2aca AE |
41 | (define-public polkit |
42 | (package | |
43 | (name "polkit") | |
c7bdc6bb | 44 | (version "0.113") |
c4bd2aca AE |
45 | (source (origin |
46 | (method url-fetch) | |
47 | (uri (string-append | |
5cc3096c | 48 | "https://www.freedesktop.org/software/polkit/releases/" |
c4bd2aca AE |
49 | name "-" version ".tar.gz")) |
50 | (sha256 | |
51 | (base32 | |
c7bdc6bb | 52 | "109w86kfqrgz83g9ivggplmgc77rz8kx8646izvm2jb57h4rbh71")) |
fc1adab1 | 53 | (patches (search-patches "polkit-drop-test.patch")) |
7b6c5c5d AW |
54 | (modules '((guix build utils))) |
55 | (snippet | |
56 | '(begin | |
57 | (use-modules (guix build utils)) | |
58 | (substitute* "configure" | |
59 | ;; Replace libsystemd-login with libelogind. | |
60 | (("libsystemd-login") "libelogind") | |
61 | ;; Skip the sanity check that the current system runs | |
62 | ;; systemd. | |
63 | (("test ! -d /sys/fs/cgroup/systemd/") "false")) | |
64 | (substitute* "src/polkit/polkitunixsession-systemd.c" | |
65 | (("systemd") "elogind")) | |
66 | (substitute* "src/polkitbackend/polkitbackendsessionmonitor-systemd.c" | |
67 | (("systemd") "elogind")) | |
68 | (substitute* "src/polkitbackend/polkitbackendjsauthority.c" | |
3f130e42 AW |
69 | (("systemd") "elogind")) |
70 | ||
222e3319 LC |
71 | ;; GuixSD's polkit service stores actions under |
72 | ;; /etc/polkit-1/actions. | |
3f130e42 AW |
73 | (substitute* "src/polkitbackend/polkitbackendinteractiveauthority.c" |
74 | (("PACKAGE_DATA_DIR \"/polkit-1/actions\"") | |
222e3319 LC |
75 | "PACKAGE_SYSCONF_DIR \"/polkit-1/actions\"")) |
76 | ||
77 | ;; Set the setuid helper's real location. | |
78 | (substitute* "src/polkitagent/polkitagentsession.c" | |
79 | (("PACKAGE_PREFIX \"/lib/polkit-1/polkit-agent-helper-1\"") | |
80 | "\"/run/setuid-programs/polkit-agent-helper-1\"")))))) | |
c4bd2aca AE |
81 | (build-system gnu-build-system) |
82 | (inputs | |
3f130e42 AW |
83 | `(("expat" ,expat) |
84 | ("linux-pam" ,linux-pam) | |
85 | ("elogind" ,elogind) | |
86 | ("mozjs" ,mozjs) | |
87 | ("nspr" ,nspr))) | |
b118401f | 88 | (propagated-inputs |
3f130e42 | 89 | `(("glib" ,glib))) ; required by polkit-gobject-1.pc |
c4bd2aca | 90 | (native-inputs |
3f130e42 AW |
91 | `(("pkg-config" ,pkg-config) |
92 | ("glib:bin" ,glib "bin") ; for glib-mkenums | |
93 | ("intltool" ,intltool) | |
94 | ("gobject-introspection" ,gobject-introspection))) | |
95 | (arguments | |
96 | `(#:configure-flags '("--sysconfdir=/etc" | |
97 | "--enable-man-pages") | |
98 | #:phases | |
99 | (modify-phases %standard-phases | |
100 | (add-after | |
101 | 'unpack 'fix-introspection-install-dir | |
102 | (lambda* (#:key outputs #:allow-other-keys) | |
103 | (let ((out (assoc-ref outputs "out"))) | |
104 | (substitute* (find-files "." "Makefile.in") | |
105 | (("@INTROSPECTION_GIRDIR@") | |
106 | (string-append out "/share/gir-1.0/")) | |
107 | (("@INTROSPECTION_TYPELIBDIR@") | |
108 | (string-append out "/lib/girepository-1.0/")))))) | |
109 | (replace | |
110 | 'install | |
111 | (lambda* (#:key outputs (make-flags '()) #:allow-other-keys) | |
112 | ;; Override sysconfdir during "make install", to avoid attempting | |
113 | ;; to install in /etc, and to instead install the skeletons in the | |
114 | ;; output directory. | |
115 | (let ((out (assoc-ref outputs "out"))) | |
116 | (zero? (apply system* | |
117 | "make" "install" | |
118 | (string-append "sysconfdir=" out "/etc") | |
119 | (string-append "polkit_actiondir=" | |
120 | out "/share/polkit-1/actions") | |
121 | make-flags)))))))) | |
c4bd2aca AE |
122 | (home-page "http://www.freedesktop.org/wiki/Software/polkit/") |
123 | (synopsis "Authorization API for privilege management") | |
124 | (description "Polkit is an application-level toolkit for defining and | |
125 | handling the policy that allows unprivileged processes to speak to | |
126 | privileged processes. It is a framework for centralizing the decision | |
127 | making process with respect to granting access to privileged operations | |
128 | for unprivileged applications.") | |
129 | (license lgpl2.0+))) | |
054a3921 AE |
130 | |
131 | (define-public polkit-qt | |
132 | (package | |
133 | (name "polkit-qt") | |
134 | (version "1-0.112.0") | |
135 | (source (origin | |
136 | (method url-fetch) | |
137 | (uri (string-append | |
138 | "http://download.kde.org/stable/apps/KDE4.x/admin/" | |
139 | name "-" version ".tar.bz2")) | |
140 | (sha256 | |
141 | (base32 | |
142 | "1ip78x20hjqvm08kxhp6gb8hf6k5n6sxyx6kk2yvvq53djzh7yv7")))) | |
143 | (build-system cmake-build-system) | |
144 | (inputs | |
7fe8ad76 | 145 | `(("polkit" ,polkit))) |
054a3921 | 146 | (propagated-inputs |
51b1d539 | 147 | `(("qtbase" ,qtbase))) |
054a3921 | 148 | (native-inputs |
b3546174 | 149 | `(("pkg-config" ,pkg-config))) |
054a3921 | 150 | (arguments |
cb151c68 LC |
151 | `(#:configure-flags (list (string-append "-DCMAKE_INSTALL_RPATH=" |
152 | (assoc-ref %outputs "out") | |
153 | "/lib:" | |
154 | (assoc-ref %outputs "out") | |
155 | "/lib64")) | |
156 | #:tests? #f)) ; there is a test subdirectory, but no test target | |
054a3921 AE |
157 | (home-page "http://api.kde.org/kdesupport-api/polkit-qt-1-apidocs/") |
158 | (synopsis "Qt frontend to the polkit library") | |
159 | (description "Polkit-qt is a library that lets developers use the | |
160 | PolicyKit API through a Qt-styled API. It is mainly a wrapper around | |
161 | QAction and QAbstractButton that lets you integrate those two component | |
162 | easily with PolicyKit.") | |
163 | (license lgpl2.0+))) | |
728dc8fa HY |
164 | |
165 | (define-public polkit-gnome | |
166 | (package | |
167 | (name "polkit-gnome") | |
168 | (version "0.105") | |
169 | (source (origin | |
170 | (method url-fetch) | |
171 | (uri (string-append "mirror://gnome/sources/" | |
172 | name "/" version "/" | |
173 | name "-" version ".tar.xz")) | |
174 | (sha256 | |
175 | (base32 | |
176 | "0sckmcbxyj6sbrnfc5p5lnw27ccghsid6v6wxq09mgxqcd4lk10p")))) | |
177 | (build-system gnu-build-system) | |
178 | (inputs `(("gtk+" ,gtk+) | |
179 | ("polkit" ,polkit))) | |
180 | (native-inputs `(("intltool" ,intltool) | |
181 | ("pkg-config" ,pkg-config))) | |
182 | (synopsis "Legacy polkit authentication agent for GNOME") | |
183 | (description "PolicyKit-gnome provides a D-Bus session bus service | |
184 | that is used to bring up authentication dialogs used for obtaining | |
185 | privileges.") | |
186 | (home-page "http://www.freedesktop.org/wiki/Software/polkit/") | |
187 | (license lgpl2.0+))) |