gnu: slepc: Set origin file-name.
[jackhill/guix/guix.git] / gnu / packages / polkit.scm
CommitLineData
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>
cff1c5c1
AE
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)
4923e06f 23 #:use-module ((guix licenses) #:select (lgpl2.0+))
cff1c5c1
AE
24 #:use-module (guix packages)
25 #:use-module (guix download)
054a3921 26 #:use-module (guix build-system cmake)
cff1c5c1 27 #:use-module (guix build-system gnu)
c4bd2aca 28 #:use-module (gnu packages)
7b6c5c5d 29 #:use-module (gnu packages freedesktop)
c4bd2aca 30 #:use-module (gnu packages glib)
4923e06f 31 #:use-module (gnu packages gnuzilla)
c4bd2aca 32 #:use-module (gnu packages linux)
cff1c5c1 33 #:use-module (gnu packages perl)
c4bd2aca
AE
34 #:use-module (gnu packages pkg-config)
35 #:use-module (gnu packages python)
054a3921 36 #:use-module (gnu packages qt)
c4bd2aca 37 #:use-module (gnu packages xml))
cff1c5c1 38
c4bd2aca
AE
39(define-public polkit
40 (package
41 (name "polkit")
c7bdc6bb 42 (version "0.113")
c4bd2aca
AE
43 (source (origin
44 (method url-fetch)
45 (uri (string-append
5cc3096c 46 "https://www.freedesktop.org/software/polkit/releases/"
c4bd2aca
AE
47 name "-" version ".tar.gz"))
48 (sha256
49 (base32
c7bdc6bb 50 "109w86kfqrgz83g9ivggplmgc77rz8kx8646izvm2jb57h4rbh71"))
7b6c5c5d
AW
51 (patches (list (search-patch "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"
3f130e42
AW
67 (("systemd") "elogind"))
68
222e3319
LC
69 ;; GuixSD's polkit service stores actions under
70 ;; /etc/polkit-1/actions.
3f130e42
AW
71 (substitute* "src/polkitbackend/polkitbackendinteractiveauthority.c"
72 (("PACKAGE_DATA_DIR \"/polkit-1/actions\"")
222e3319
LC
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\""))))))
c4bd2aca
AE
79 (build-system gnu-build-system)
80 (inputs
3f130e42
AW
81 `(("expat" ,expat)
82 ("linux-pam" ,linux-pam)
83 ("elogind" ,elogind)
84 ("mozjs" ,mozjs)
85 ("nspr" ,nspr)))
b118401f 86 (propagated-inputs
3f130e42 87 `(("glib" ,glib))) ; required by polkit-gobject-1.pc
c4bd2aca 88 (native-inputs
3f130e42
AW
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))))))))
c4bd2aca
AE
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
123handling the policy that allows unprivileged processes to speak to
124privileged processes. It is a framework for centralizing the decision
125making process with respect to granting access to privileged operations
126for unprivileged applications.")
127 (license lgpl2.0+)))
054a3921
AE
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
7fe8ad76 143 `(("polkit" ,polkit)))
054a3921 144 (propagated-inputs
7fe8ad76 145 `(("qt" ,qt))) ; qt-4 according to the pkg-config files
054a3921 146 (native-inputs
b3546174 147 `(("pkg-config" ,pkg-config)))
054a3921 148 (arguments
cb151c68
LC
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
054a3921
AE
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
158PolicyKit API through a Qt-styled API. It is mainly a wrapper around
159QAction and QAbstractButton that lets you integrate those two component
160easily with PolicyKit.")
161 (license lgpl2.0+)))