gnu: python-pandas: Fix build on 32-bit.
[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 ;;; Copyright © 2017 Huang Ying <huang.ying.caritas@gmail.com>
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)
24 #:use-module ((guix licenses) #:select (lgpl2.0+))
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix build-system cmake)
28 #:use-module (guix build-system gnu)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages freedesktop)
31 #:use-module (gnu packages glib)
32 #:use-module (gnu packages gtk)
33 #:use-module (gnu packages gnuzilla)
34 #:use-module (gnu packages linux)
35 #:use-module (gnu packages perl)
36 #:use-module (gnu packages pkg-config)
37 #:use-module (gnu packages python)
38 #:use-module (gnu packages qt)
39 #:use-module (gnu packages xml))
40
41 (define-public polkit
42 (package
43 (name "polkit")
44 (version "0.113")
45 (source (origin
46 (method url-fetch)
47 (uri (string-append
48 "https://www.freedesktop.org/software/polkit/releases/"
49 name "-" version ".tar.gz"))
50 (sha256
51 (base32
52 "109w86kfqrgz83g9ivggplmgc77rz8kx8646izvm2jb57h4rbh71"))
53 (patches (search-patches "polkit-drop-test.patch"))
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"
69 (("systemd") "elogind"))
70
71 ;; GuixSD's polkit service stores actions under
72 ;; /etc/polkit-1/actions.
73 (substitute* "src/polkitbackend/polkitbackendinteractiveauthority.c"
74 (("PACKAGE_DATA_DIR \"/polkit-1/actions\"")
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\""))))))
81 (build-system gnu-build-system)
82 (inputs
83 `(("expat" ,expat)
84 ("linux-pam" ,linux-pam)
85 ("elogind" ,elogind)
86 ("mozjs" ,mozjs)
87 ("nspr" ,nspr)))
88 (propagated-inputs
89 `(("glib" ,glib))) ; required by polkit-gobject-1.pc
90 (native-inputs
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))))))))
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+)))
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
145 `(("polkit" ,polkit)))
146 (propagated-inputs
147 `(("qtbase" ,qtbase)))
148 (native-inputs
149 `(("pkg-config" ,pkg-config)))
150 (arguments
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
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+)))
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+)))