| 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 | ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr> |
| 8 | ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net> |
| 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) |
| 26 | #:use-module ((guix licenses) #:select (lgpl2.0+)) |
| 27 | #:use-module (guix packages) |
| 28 | #:use-module (guix download) |
| 29 | #:use-module (guix build-system cmake) |
| 30 | #:use-module (guix build-system gnu) |
| 31 | #:use-module (gnu packages) |
| 32 | #:use-module (gnu packages freedesktop) |
| 33 | #:use-module (gnu packages glib) |
| 34 | #:use-module (gnu packages gtk) |
| 35 | #:use-module (gnu packages gnuzilla) |
| 36 | #:use-module (gnu packages linux) |
| 37 | #:use-module (gnu packages nss) |
| 38 | #:use-module (gnu packages perl) |
| 39 | #:use-module (gnu packages pkg-config) |
| 40 | #:use-module (gnu packages qt) |
| 41 | #:use-module (gnu packages xml)) |
| 42 | |
| 43 | (define-public polkit |
| 44 | (package |
| 45 | (name "polkit") |
| 46 | (version "0.116") |
| 47 | (source (origin |
| 48 | (method url-fetch) |
| 49 | (uri (string-append |
| 50 | "https://www.freedesktop.org/software/polkit/releases/" |
| 51 | name "-" version ".tar.gz")) |
| 52 | (sha256 |
| 53 | (base32 |
| 54 | "1c9lbpndh5zis22f154vjrhnqw65z8s85nrgl42v738yf6g0q5w8")) |
| 55 | (modules '((guix build utils))) |
| 56 | (snippet |
| 57 | '(begin |
| 58 | (use-modules (guix build utils)) |
| 59 | ;; Disable broken test. |
| 60 | (substitute* "test/Makefile.in" |
| 61 | (("SUBDIRS = mocklibc . polkit polkitbackend") |
| 62 | "SUBDIRS = mocklibc . polkit")) |
| 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")) |
| 73 | (substitute* "src/polkitbackend/polkitbackendjsauthority.cpp" |
| 74 | (("systemd") "elogind")) |
| 75 | |
| 76 | ;; Guix System's polkit service stores actions under |
| 77 | ;; /etc/polkit-1/actions. |
| 78 | (substitute* "src/polkitbackend/polkitbackendinteractiveauthority.c" |
| 79 | (("PACKAGE_DATA_DIR \"/polkit-1/actions\"") |
| 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\"") |
| 85 | "\"/run/setuid-programs/polkit-agent-helper-1\"")) |
| 86 | #t)))) |
| 87 | (build-system gnu-build-system) |
| 88 | (inputs |
| 89 | `(("expat" ,expat) |
| 90 | ("linux-pam" ,linux-pam) |
| 91 | ("elogind" ,elogind) |
| 92 | ("mozjs" ,mozjs-60) |
| 93 | ("nspr" ,nspr))) |
| 94 | (propagated-inputs |
| 95 | `(("glib" ,glib))) ; required by polkit-gobject-1.pc |
| 96 | (native-inputs |
| 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@") |
| 114 | (string-append out "/lib/girepository-1.0/"))) |
| 115 | #t))) |
| 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"))) |
| 123 | (apply invoke "make" "install" |
| 124 | (string-append "sysconfdir=" out "/etc") |
| 125 | (string-append "polkit_actiondir=" |
| 126 | out "/share/polkit-1/actions") |
| 127 | make-flags) |
| 128 | #t)))))) |
| 129 | (home-page "https://www.freedesktop.org/wiki/Software/polkit/") |
| 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+))) |
| 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 |
| 145 | "mirror://kde//stable/apps/KDE4.x/admin/" |
| 146 | "polkit-qt-" version ".tar.bz2")) |
| 147 | (sha256 |
| 148 | (base32 |
| 149 | "1ip78x20hjqvm08kxhp6gb8hf6k5n6sxyx6kk2yvvq53djzh7yv7")))) |
| 150 | (build-system cmake-build-system) |
| 151 | (inputs |
| 152 | `(("polkit" ,polkit))) |
| 153 | (propagated-inputs |
| 154 | `(("qtbase" ,qtbase))) |
| 155 | (native-inputs |
| 156 | `(("pkg-config" ,pkg-config))) |
| 157 | (arguments |
| 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 |
| 164 | (home-page "https://api.kde.org/kdesupport-api/polkit-qt-1-apidocs/") |
| 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+))) |
| 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.") |
| 193 | (home-page "https://www.freedesktop.org/wiki/Software/polkit/") |
| 194 | (license lgpl2.0+))) |