| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 |
|
| 32 | (define-module (gnu packages polkit)
|
| 33 | #:use-module (guix download)
|
| 34 | #:use-module (guix git-download)
|
| 35 | #:use-module (guix gexp)
|
| 36 | #:use-module (guix memoization)
|
| 37 | #:use-module ((guix licenses) #:prefix license:)
|
| 38 | #:use-module (guix packages)
|
| 39 | #:use-module (guix utils)
|
| 40 | #:use-module (guix build utils)
|
| 41 | #:use-module (guix build-system cmake)
|
| 42 | #:use-module (guix build-system gnu)
|
| 43 | #:use-module (guix build-system meson)
|
| 44 | #:use-module (gnu packages)
|
| 45 | #:use-module (gnu packages cpp)
|
| 46 | #:use-module (gnu packages gettext)
|
| 47 | #:use-module (gnu packages freedesktop)
|
| 48 | #:use-module (gnu packages gcc)
|
| 49 | #:use-module (gnu packages glib)
|
| 50 | #:use-module (gnu packages gtk)
|
| 51 | #:use-module (gnu packages docbook)
|
| 52 | #:use-module (gnu packages javascript)
|
| 53 | #:use-module (gnu packages linux)
|
| 54 | #:use-module (gnu packages nss)
|
| 55 | #:use-module (gnu packages perl)
|
| 56 | #:use-module (gnu packages pkg-config)
|
| 57 | #:use-module (gnu packages python)
|
| 58 | #:use-module (gnu packages python-xyz)
|
| 59 | #:use-module (gnu packages qt)
|
| 60 | #:use-module (gnu packages xdisorg)
|
| 61 | #:use-module (gnu packages xml))
|
| 62 |
|
| 63 | (define-public hyprpolkitagent
|
| 64 | (package
|
| 65 | (name "hyprpolkitagent")
|
| 66 | (version "0.1.3")
|
| 67 | (source
|
| 68 | (origin
|
| 69 | (method git-fetch)
|
| 70 | (uri (git-reference
|
| 71 | (url "https://github.com/hyprwm/hyprpolkitagent")
|
| 72 | (commit (string-append "v" version))))
|
| 73 | (file-name (git-file-name name version))
|
| 74 | (sha256
|
| 75 | (base32 "021r0gjy2xip0jwsv0k823k156gsa7s3rylwai53ymxd53m51p6z"))))
|
| 76 | (build-system cmake-build-system)
|
| 77 | (arguments
|
| 78 | (list
|
| 79 | #:tests? #f)) |
| 80 | (native-inputs
|
| 81 | (list gcc-15
|
| 82 | pkg-config))
|
| 83 | (inputs
|
| 84 | (list hyprutils
|
| 85 | hyprland-qtutils
|
| 86 | polkit
|
| 87 | polkit-qt6
|
| 88 | qtwayland
|
| 89 | qtbase
|
| 90 | qtdeclarative
|
| 91 | libxkbcommon))
|
| 92 | (home-page "https://wiki.hypr.land/Hypr-Ecosystem/hyprpolkitagent/")
|
| 93 | (synopsis "Simple polkit authentication agent for Hyprland")
|
| 94 | (description
|
| 95 | "hyprpolkitagent is a polkit authentication daemon written in QT/QML.
|
| 96 | It is required for @acronym{GUI, Graphical User Interface} applications to be
|
| 97 | able to request elevated privileges.")
|
| 98 | (license license:bsd-3)))
|
| 99 |
|
| 100 | (define-public polkit
|
| 101 | (package
|
| 102 | (name "polkit")
|
| 103 | (version "121")
|
| 104 | (source (origin
|
| 105 | (method url-fetch)
|
| 106 | (uri (string-append
|
| 107 | "https://www.freedesktop.org/software/polkit/releases/"
|
| 108 | name "-" version ".tar.gz"))
|
| 109 | (patches (search-patches "polkit-disable-systemd.patch"))
|
| 110 | (sha256
|
| 111 | (base32
|
| 112 | "1apz3bh7nbpmlp1cr00pb8z8wp0c7yb23ninb959jz3r38saxiwx"))
|
| 113 | (modules '((guix build utils)))
|
| 114 | (snippet
|
| 115 | '(begin
|
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | (substitute* "src/polkitbackend/meson.build"
|
| 124 | (("'-DPACKAGE_SYSCONF_DIR=.*,")
|
| 125 | "'-DPACKAGE_SYSCONF_DIR=\"/etc\"',"))
|
| 126 | (substitute* "src/polkitbackend/polkitbackendinteractiveauthority.c"
|
| 127 | (("PACKAGE_DATA_DIR \"/polkit-1/actions\"")
|
| 128 | "PACKAGE_SYSCONF_DIR \"/polkit-1/actions\""))
|
| 129 | |
| 130 | (substitute* "meson.build"
|
| 131 | (("pk_sysconfdir = get_option\\('sysconfdir'\\)")
|
| 132 | "pk_sysconfdir = get_option('prefix') + '/etc'"))
|
| 133 | |
| 134 | (substitute* "src/polkitagent/polkitagentsession.c"
|
| 135 | (("PACKAGE_PREFIX \"/lib/polkit-1/polkit-agent-helper-1\"")
|
| 136 | "\"/run/setuid-programs/polkit-agent-helper-1\""))))))
|
| 137 | (build-system meson-build-system)
|
| 138 | (arguments
|
| 139 | (list
|
| 140 | #:modules '((guix build meson-build-system)
|
| 141 | (guix build utils)
|
| 142 | (ice-9 match))
|
| 143 | #:configure-flags
|
| 144 | #~(list "--sysconfdir=/etc"
|
| 145 | "-Dsession_tracking=libelogind"
|
| 146 | "-Dman=true"
|
| 147 | "-Dtests=true"
|
| 148 | |
| 149 | |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | #$@(if (%current-target-system)
|
| 155 | '("-Dintrospection=false")
|
| 156 | '()))
|
| 157 | #:phases
|
| 158 | #~(modify-phases %standard-phases
|
| 159 | (add-before 'configure 'relax-gcc-14-strictness
|
| 160 | (lambda _
|
| 161 | (setenv "CFLAGS"
|
| 162 | "-g -O2 -Wno-error=implicit-function-declaration")))
|
| 163 | (add-before 'check 'patch-bash
|
| 164 | (lambda _
|
| 165 | (substitute* (list "subprojects/mocklibc-1.0/bin/mocklibc"
|
| 166 | (string-append "../polkit-v." #$version
|
| 167 | "/test/data/etc/passwd")
|
| 168 | (string-append "../polkit-v." #$version
|
| 169 | "/test/data/etc/polkit-1"
|
| 170 | "/rules.d/10-testing.rules"))
|
| 171 | (("/bin/(bash|false|true)" _ command)
|
| 172 | (which command))))))))
|
| 173 | (inputs
|
| 174 | (list duktape expat elogind linux-pam nspr))
|
| 175 | (propagated-inputs
|
| 176 | (list glib)) |
| 177 | (native-inputs
|
| 178 | (list gettext-minimal
|
| 179 | `(,glib "bin") |
| 180 | docbook-xsl |
| 181 | gobject-introspection
|
| 182 | libxslt |
| 183 | perl
|
| 184 | pkg-config
|
| 185 | python
|
| 186 | python-dbusmock-for-tests))
|
| 187 | (home-page "https://www.freedesktop.org/wiki/Software/polkit/")
|
| 188 | (synopsis "Authorization API for privilege management")
|
| 189 | (description "Polkit is an application-level toolkit for defining and
|
| 190 | handling the policy that allows unprivileged processes to speak to
|
| 191 | privileged processes. It is a framework for centralizing the decision
|
| 192 | making process with respect to granting access to privileged operations
|
| 193 | for unprivileged applications.")
|
| 194 | (license license:lgpl2.0+)))
|
| 195 |
|
| 196 | (define-public polkit-qt
|
| 197 | (package
|
| 198 | (name "polkit-qt")
|
| 199 | (version "0.200.0")
|
| 200 | (source (origin
|
| 201 | (method url-fetch)
|
| 202 | (uri (string-append
|
| 203 | "mirror://kde/stable/polkit-qt-1/"
|
| 204 | name "-1-" version ".tar.xz"))
|
| 205 | (sha256
|
| 206 | (base32
|
| 207 | "1yvp2s72fgpn5kf1a2ldy0givlmz0z4i1fsh6ylpcard0qf62fsx"))))
|
| 208 | (build-system cmake-build-system)
|
| 209 | (inputs
|
| 210 | (list qtbase-5 polkit))
|
| 211 | (native-inputs
|
| 212 | (list pkg-config))
|
| 213 | (arguments
|
| 214 | (list #:configure-flags
|
| 215 | #~(list (string-append
|
| 216 | "-DQT_MAJOR_VERSION="
|
| 217 | #$(version-major
|
| 218 | (package-version (this-package-input "qtbase")))))
|
| 219 | #:tests? #f)) |
| 220 | (home-page "https://api.kde.org/kdesupport-api/polkit-qt-1-apidocs/")
|
| 221 | (properties `((upstream-name . "polkit-qt-1")))
|
| 222 | (synopsis "Qt frontend to the polkit library")
|
| 223 | (description "Polkit-qt is a library that lets developers use the
|
| 224 | PolicyKit API through a Qt-styled API. It is mainly a wrapper around
|
| 225 | QAction and QAbstractButton that lets you integrate those two component
|
| 226 | easily with PolicyKit.")
|
| 227 | (license license:lgpl2.0+)))
|
| 228 |
|
| 229 | (define-public polkit-qt6
|
| 230 | (package
|
| 231 | (inherit polkit-qt)
|
| 232 | (name "polkit-qt6")
|
| 233 | (inputs (modify-inputs inputs
|
| 234 | (replace "qtbase" qtbase)))))
|
| 235 |
|
| 236 | (define-public polkit-gnome
|
| 237 | (package
|
| 238 | (name "polkit-gnome")
|
| 239 | (version "0.105")
|
| 240 | (source (origin
|
| 241 | (method url-fetch)
|
| 242 | (uri (string-append "mirror://gnome/sources/"
|
| 243 | name "/" version "/"
|
| 244 | name "-" version ".tar.xz"))
|
| 245 | (sha256
|
| 246 | (base32
|
| 247 | "0sckmcbxyj6sbrnfc5p5lnw27ccghsid6v6wxq09mgxqcd4lk10p"))))
|
| 248 | (build-system gnu-build-system)
|
| 249 | (inputs (list gtk+ polkit))
|
| 250 | (native-inputs (list intltool pkg-config))
|
| 251 | (synopsis "Legacy polkit authentication agent for GNOME")
|
| 252 | (description "PolicyKit-gnome provides a D-Bus session bus service
|
| 253 | that is used to bring up authentication dialogs used for obtaining
|
| 254 | privileges.")
|
| 255 | (home-page "https://www.freedesktop.org/wiki/Software/polkit/")
|
| 256 | (license license:lgpl2.0+)))
|