gnu: gtk-engines: Don't propagate GTK+.
[jackhill/guix/guix.git] / gnu / packages / polkit.scm
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 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
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.
13 ;;;
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.
18 ;;;
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/>.
21
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))
38
39 (define-public polkit
40 (package
41 (name "polkit")
42 (version "0.113")
43 (source (origin
44 (method url-fetch)
45 (uri (string-append
46 "https://www.freedesktop.org/software/polkit/releases/"
47 name "-" version ".tar.gz"))
48 (sha256
49 (base32
50 "109w86kfqrgz83g9ivggplmgc77rz8kx8646izvm2jb57h4rbh71"))
51 (patches (search-patches "polkit-drop-test.patch"))
52 (modules '((guix build utils)))
53 (snippet
54 '(begin
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
60 ;; systemd.
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"))
68
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\""))
74
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)
80 (inputs
81 `(("expat" ,expat)
82 ("linux-pam" ,linux-pam)
83 ("elogind" ,elogind)
84 ("mozjs" ,mozjs)
85 ("nspr" ,nspr)))
86 (propagated-inputs
87 `(("glib" ,glib))) ; required by polkit-gobject-1.pc
88 (native-inputs
89 `(("pkg-config" ,pkg-config)
90 ("glib:bin" ,glib "bin") ; for glib-mkenums
91 ("intltool" ,intltool)
92 ("gobject-introspection" ,gobject-introspection)))
93 (arguments
94 `(#:configure-flags '("--sysconfdir=/etc"
95 "--enable-man-pages")
96 #:phases
97 (modify-phases %standard-phases
98 (add-after
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/"))))))
107 (replace
108 'install
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
112 ;; output directory.
113 (let ((out (assoc-ref outputs "out")))
114 (zero? (apply system*
115 "make" "install"
116 (string-append "sysconfdir=" out "/etc")
117 (string-append "polkit_actiondir="
118 out "/share/polkit-1/actions")
119 make-flags))))))))
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.")
127 (license lgpl2.0+)))
128
129 (define-public polkit-qt
130 (package
131 (name "polkit-qt")
132 (version "1-0.112.0")
133 (source (origin
134 (method url-fetch)
135 (uri (string-append
136 "http://download.kde.org/stable/apps/KDE4.x/admin/"
137 name "-" version ".tar.bz2"))
138 (sha256
139 (base32
140 "1ip78x20hjqvm08kxhp6gb8hf6k5n6sxyx6kk2yvvq53djzh7yv7"))))
141 (build-system cmake-build-system)
142 (inputs
143 `(("polkit" ,polkit)))
144 (propagated-inputs
145 `(("qtbase" ,qtbase)))
146 (native-inputs
147 `(("pkg-config" ,pkg-config)))
148 (arguments
149 `(#:configure-flags (list (string-append "-DCMAKE_INSTALL_RPATH="
150 (assoc-ref %outputs "out")
151 "/lib:"
152 (assoc-ref %outputs "out")
153 "/lib64"))
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.")
161 (license lgpl2.0+)))