projects/guix·blob java-team · refs

257 lines · 10.6 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014 Andreas Enge <[email protected]>
3;;; Copyright © 2015 Andy Wingo <[email protected]>
4;;; Copyright © 2015, 2021-2022 Ludovic Courtès <[email protected]>
5;;; Copyright © 2015 Mark H Weaver <[email protected]>
6;;; Copyright © 2016, 2022 Efraim Flashner <[email protected]>
7;;; Copyright © 2017 Huang Ying <[email protected]>
8;;; Copyright © 2018 Tobias Geerinckx-Rice <[email protected]>
9;;; Copyright © 2018 Ricardo Wurmus <[email protected]>
10;;; Copyright © 2021 Morgan Smith <[email protected]>
11;;; Copyright © 2022 Jean-Pierre De Jesus DIAZ <[email protected]>
12;;; Copyright © 2022 Marius Bakke <[email protected]>
13;;; Copyright © 2021, 2022 Maxim Cournoyer <[email protected]>
14;;; Copyright © 2025 Josep Bigorra <[email protected]>
15;;; Copyright © 2024 Janneke Nieuwenhuizen <[email protected]>
16;;;
17;;; This file is part of GNU Guix.
18;;;
19;;; GNU Guix is free software; you can redistribute it and/or modify it
20;;; under the terms of the GNU General Public License as published by
21;;; the Free Software Foundation; either version 3 of the License, or (at
22;;; your option) any later version.
23;;;
24;;; GNU Guix is distributed in the hope that it will be useful, but
25;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27;;; GNU General Public License for more details.
28;;;
29;;; You should have received a copy of the GNU General Public License
30;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
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 docker)
48 #:use-module (gnu packages freedesktop)
49 #:use-module (gnu packages gcc)
50 #:use-module (gnu packages glib)
51 #:use-module (gnu packages gtk)
52 #:use-module (gnu packages docbook)
53 #:use-module (gnu packages javascript)
54 #:use-module (gnu packages linux)
55 #:use-module (gnu packages nss)
56 #:use-module (gnu packages perl)
57 #:use-module (gnu packages pkg-config)
58 #:use-module (gnu packages python)
59 #:use-module (gnu packages python-xyz)
60 #:use-module (gnu packages qt)
61 #:use-module (gnu packages xdisorg)
62 #:use-module (gnu packages xml))
63
64(define-public hyprpolkitagent
65 (package
66 (name "hyprpolkitagent")
67 (version "0.1.3")
68 (source
69 (origin
70 (method git-fetch)
71 (uri (git-reference
72 (url "https://github.com/hyprwm/hyprpolkitagent")
73 (commit (string-append "v" version))))
74 (file-name (git-file-name name version))
75 (sha256
76 (base32 "021r0gjy2xip0jwsv0k823k156gsa7s3rylwai53ymxd53m51p6z"))))
77 (build-system cmake-build-system)
78 (arguments
79 (list
80 #:tests? #f)) ;; No tests yet.
81 (native-inputs
82 (list gcc-15
83 pkg-config))
84 (inputs
85 (list hyprutils
86 hyprland-qtutils
87 polkit
88 polkit-qt6
89 qtwayland
90 qtbase
91 qtdeclarative
92 libxkbcommon))
93 (home-page "https://wiki.hypr.land/Hypr-Ecosystem/hyprpolkitagent/")
94 (synopsis "Simple polkit authentication agent for Hyprland")
95 (description
96 "hyprpolkitagent is a polkit authentication daemon written in QT/QML.
97It is required for @acronym{GUI, Graphical User Interface} applications to be
98able to request elevated privileges.")
99 (license license:bsd-3)))
100
101(define-public polkit
102 (package
103 (name "polkit")
104 (version "121")
105 (source (origin
106 (method url-fetch)
107 (uri (string-append
108 "https://www.freedesktop.org/software/polkit/releases/"
109 name "-" version ".tar.gz"))
110 (patches (search-patches "polkit-disable-systemd.patch"))
111 (sha256
112 (base32
113 "1apz3bh7nbpmlp1cr00pb8z8wp0c7yb23ninb959jz3r38saxiwx"))
114 (modules '((guix build utils)))
115 (snippet
116 '(begin
117 ;; This is so that the default example rules files can be
118 ;; installed along the package; otherwise it would fail
119 ;; attempting to write to /etc. Unlike with GNU Autotools,
120 ;; Meson can't override the pkgsysconfdir value at install
121 ;; time; instead, we rewrite the pkgsysconfdir references
122 ;; in the build system to point to #$output/etc.
123 ;; Look up actions and rules from /etc/polkit ...
124 (substitute* "src/polkitbackend/meson.build"
125 (("'-DPACKAGE_SYSCONF_DIR=.*,")
126 "'-DPACKAGE_SYSCONF_DIR=\"/etc\"',"))
127 (substitute* "src/polkitbackend/polkitbackendinteractiveauthority.c"
128 (("PACKAGE_DATA_DIR \"/polkit-1/actions\"")
129 "PACKAGE_SYSCONF_DIR \"/polkit-1/actions\""))
130 ;; ... but install package files below the prefix.
131 (substitute* "meson.build"
132 (("pk_sysconfdir = get_option\\('sysconfdir'\\)")
133 "pk_sysconfdir = get_option('prefix') + '/etc'"))
134 ;; Set the setuid helper's real location.
135 (substitute* "src/polkitagent/polkitagentsession.c"
136 (("PACKAGE_PREFIX \"/lib/polkit-1/polkit-agent-helper-1\"")
137 "\"/run/setuid-programs/polkit-agent-helper-1\""))))))
138 (build-system meson-build-system)
139 (arguments
140 (list
141 #:modules '((guix build meson-build-system)
142 (guix build utils)
143 (ice-9 match))
144 #:configure-flags
145 #~(list "--sysconfdir=/etc"
146 "-Dsession_tracking=libelogind"
147 "-Dman=true"
148 "-Dtests=true"
149 ;; Work around cross-compilation failure. The build system
150 ;; probes for the _target_ gobject-introspection, but if we
151 ;; change it to native, Meson fails with:
152 ;; ERROR: Pkg-config binary for machine
153 ;; MachineChoice.BUILD not found, giving up.
154 ;; Just disable introspection for now.
155 #$@(if (%current-target-system)
156 '("-Dintrospection=false")
157 '()))
158 #:phases
159 #~(modify-phases %standard-phases
160 (add-before 'configure 'relax-gcc-14-strictness
161 (lambda _
162 (setenv "CFLAGS"
163 "-g -O2 -Wno-error=implicit-function-declaration")))
164 (add-before 'check 'patch-bash
165 (lambda _
166 (substitute* (list "subprojects/mocklibc-1.0/bin/mocklibc"
167 (string-append "../polkit-v." #$version
168 "/test/data/etc/passwd")
169 (string-append "../polkit-v." #$version
170 "/test/data/etc/polkit-1"
171 "/rules.d/10-testing.rules"))
172 (("/bin/(bash|false|true)" _ command)
173 (which command))))))))
174 (inputs
175 (list duktape expat elogind linux-pam nspr))
176 (propagated-inputs
177 (list glib)) ;required by polkit-gobject-1.pc
178 (native-inputs
179 (list gettext-minimal
180 `(,glib "bin") ;for glib-mkenums
181 docbook-xsl ;for man page generation
182 gobject-introspection
183 libxslt ;for man page generation
184 perl
185 pkg-config
186 python
187 python-dbusmock-for-tests))
188 (home-page "https://www.freedesktop.org/wiki/Software/polkit/")
189 (synopsis "Authorization API for privilege management")
190 (description "Polkit is an application-level toolkit for defining and
191handling the policy that allows unprivileged processes to speak to
192privileged processes. It is a framework for centralizing the decision
193making process with respect to granting access to privileged operations
194for unprivileged applications.")
195 (license license:lgpl2.0+)))
196
197(define-public polkit-qt
198 (package
199 (name "polkit-qt")
200 (version "0.200.0")
201 (source (origin
202 (method url-fetch)
203 (uri (string-append
204 "mirror://kde/stable/polkit-qt-1/"
205 name "-1-" version ".tar.xz"))
206 (sha256
207 (base32
208 "1yvp2s72fgpn5kf1a2ldy0givlmz0z4i1fsh6ylpcard0qf62fsx"))))
209 (build-system cmake-build-system)
210 (inputs
211 (list qtbase-5 polkit))
212 (native-inputs
213 (list pkg-config))
214 (arguments
215 (list #:configure-flags
216 #~(list (string-append
217 "-DQT_MAJOR_VERSION="
218 #$(version-major
219 (package-version (this-package-input "qtbase")))))
220 #:tests? #f)) ; there is a test subdirectory, but no test target
221 (home-page "https://api.kde.org/kdesupport-api/polkit-qt-1-apidocs/")
222 (properties `((upstream-name . "polkit-qt-1")))
223 (synopsis "Qt frontend to the polkit library")
224 (description "Polkit-qt is a library that lets developers use the
225PolicyKit API through a Qt-styled API. It is mainly a wrapper around
226QAction and QAbstractButton that lets you integrate those two component
227easily with PolicyKit.")
228 (license license:lgpl2.0+)))
229
230(define-public polkit-qt6
231 (package
232 (inherit polkit-qt)
233 (name "polkit-qt6")
234 (inputs (modify-inputs inputs
235 (replace "qtbase" qtbase)))))
236
237(define-public polkit-gnome
238 (package
239 (name "polkit-gnome")
240 (version "0.105")
241 (source (origin
242 (method url-fetch)
243 (uri (string-append "mirror://gnome/sources/"
244 name "/" version "/"
245 name "-" version ".tar.xz"))
246 (sha256
247 (base32
248 "0sckmcbxyj6sbrnfc5p5lnw27ccghsid6v6wxq09mgxqcd4lk10p"))))
249 (build-system gnu-build-system)
250 (inputs (list gtk+ polkit))
251 (native-inputs (list intltool pkg-config))
252 (synopsis "Legacy polkit authentication agent for GNOME")
253 (description "PolicyKit-gnome provides a D-Bus session bus service
254that is used to bring up authentication dialogs used for obtaining
255privileges.")
256 (home-page "https://www.freedesktop.org/wiki/Software/polkit/")
257 (license license:lgpl2.0+)))