projects/guix·blob java-team · refs

515 lines · 20.0 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2020 Oleg Pykhalov <[email protected]>
3;;; Copyright © 2020 Hartmut Goebel <[email protected]>
4;;; Copyright © 2020 Marius Bakke <[email protected]>
5;;; Copyright © 2020 Vincent Legoll <[email protected]>
6;;; Copyright © 2021, 2022, 2024 Tobias Geerinckx-Rice <[email protected]>
7;;; Copyright © 2022, 2024, 2026 Maxim Cournoyer <[email protected]>
8;;; Copyright © 2022 Mehmet Tekman <[email protected]>
9;;; Copyright @ 2022, Kitzman <[email protected]>
10;;;
11;;; This file is part of GNU Guix.
12;;;
13;;; GNU Guix is free software; you can redistribute it and/or modify it
14;;; under the terms of the GNU General Public License as published by
15;;; the Free Software Foundation; either version 3 of the License, or (at
16;;; your option) any later version.
17;;;
18;;; GNU Guix is distributed in the hope that it will be useful, but
19;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21;;; GNU General Public License for more details.
22;;;
23;;; You should have received a copy of the GNU General Public License
24;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25
26(define-module (gnu packages vnc)
27 #:use-module (guix build-system cmake)
28 #:use-module (guix build-system gnu)
29 #:use-module (guix build-system meson)
30 #:use-module (guix download)
31 #:use-module (guix gexp)
32 #:use-module (guix git-download)
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (guix gexp)
35 #:use-module (guix git-download)
36 #:use-module (guix packages)
37 #:use-module (guix utils)
38 #:use-module (gnu packages)
39 #:use-module (gnu packages autotools)
40 #:use-module (gnu packages base)
41 #:use-module (gnu packages bash)
42 #:use-module (gnu packages c)
43 #:use-module (gnu packages cmake)
44 #:use-module (gnu packages compression)
45 #:use-module (gnu packages crypto)
46 #:use-module (gnu packages cups)
47 #:use-module (gnu packages curl)
48 #:use-module (gnu packages dns)
49 #:use-module (gnu packages fltk)
50 #:use-module (gnu packages fontutils)
51 #:use-module (gnu packages freedesktop)
52 #:use-module (gnu packages gettext)
53 #:use-module (gnu packages gl)
54 #:use-module (gnu packages glib)
55 #:use-module (gnu packages gnome)
56 #:use-module (gnu packages gnupg)
57 #:use-module (gnu packages gtk)
58 #:use-module (gnu packages guile)
59 #:use-module (gnu packages image)
60 #:use-module (gnu packages java)
61 #:use-module (gnu packages libevent)
62 #:use-module (gnu packages linux)
63 #:use-module (gnu packages man)
64 #:use-module (gnu packages pcre)
65 #:use-module (gnu packages perl)
66 #:use-module (gnu packages pkg-config)
67 #:use-module (gnu packages python)
68 #:use-module (gnu packages rdesktop)
69 #:use-module (gnu packages sdl)
70 #:use-module (gnu packages spice)
71 #:use-module (gnu packages ssh)
72 #:use-module (gnu packages tls)
73 #:use-module (gnu packages video)
74 #:use-module (gnu packages web)
75 #:use-module (gnu packages webkit)
76 #:use-module (gnu packages xdisorg)
77 #:use-module (gnu packages xorg))
78
79(define-public remmina
80 (package
81 (name "remmina")
82 (version "1.4.43")
83 (source
84 (origin
85 (method git-fetch)
86 (uri
87 (git-reference
88 (url "https://gitlab.com/Remmina/Remmina.git")
89 (commit (string-append "v" version))))
90 (file-name (git-file-name name version))
91 (sha256
92 (base32 "1hk8g26z10illchjr59l5fm2vjps85nnm7ir9l2yx9sn34v3cxpf"))))
93 (build-system cmake-build-system)
94 (arguments
95 `(#:tests? #f ; No target
96 #:configure-flags
97 (list
98 "-DWITH_FREERDP3=ON"
99 "-DWITH_GVNC=ON" ;VNC plugin for GNOME
100 ;; Disable online version checking.
101 "-DWITH_NEWS=OFF")
102 #:imported-modules
103 ((guix build glib-or-gtk-build-system)
104 ,@%cmake-build-system-modules)
105 #:modules
106 (((guix build glib-or-gtk-build-system)
107 #:prefix glib-or-gtk:)
108 (guix build cmake-build-system)
109 (guix build utils))
110 #:phases
111 (modify-phases %standard-phases
112 (add-after 'install 'glib-or-gtk-compile-schemas
113 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-compile-schemas))
114 (add-after 'glib-or-gtk-compile-schemas 'glib-or-gtk-wrap
115 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))
116 (add-after 'glib-or-gtk-wrap 'wrap-typelibs
117 (lambda* (#:key outputs #:allow-other-keys)
118 (let ((out (assoc-ref outputs "out")))
119 (for-each
120 (lambda (name)
121 (let ((file (string-append out "/bin/" name))
122 (gi-typelib-path (getenv "GI_TYPELIB_PATH")))
123 (wrap-program file
124 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))))
125 '("remmina" "remmina-file-wrapper"))))))))
126 (native-inputs
127 (list gettext-minimal
128 `(,glib "bin")
129 gobject-introspection
130 `(,gtk+ "bin")
131 intltool
132 pkg-config))
133 (inputs
134 (list libappindicator
135 at-spi2-core
136 avahi
137 bash-minimal
138 cairo
139 cups
140 curl
141 ffmpeg
142 freerdp ; for rdp plugin
143 libgcrypt
144 (librsvg-for-system)
145 glib
146 gnome-keyring
147 gsettings-desktop-schemas
148 gtk+
149 gtk-vnc
150 harfbuzz
151 json-glib
152 libsecret ; for secret plugin
153 libsoup
154 libssh ; for ssh plugin
155 libvnc ; for vnc plugin
156 openssl
157 pango
158 pcre2 ; for exec plugin
159 python-minimal-wrapper ; for python wrapper plugin
160 shared-mime-info
161 libsodium
162 spice-gtk ; for spice plugin
163 telepathy-glib
164 vte/gtk+-3 ; for st plugin
165 wayland
166 webkitgtk-for-gtk3 ; for www plugin
167 libx11
168 libxext ; for xdmcp plugin
169 xdg-utils
170 libxkbfile)) ; for nx plugin
171 (propagated-inputs
172 (list dconf))
173 (home-page "https://remmina.org/")
174 (synopsis "Remote Desktop Client")
175 (description "Remmina is a client to use other desktops remotely.
176RDP, VNC, SPICE, NX, XDMCP, SSH and EXEC network protocols are supported.")
177 (license license:gpl2+)))
178
179(define-public turbovnc
180 (package
181 (name "turbovnc")
182 (version "3.3")
183 (source
184 (origin
185 (method git-fetch)
186 (uri (git-reference
187 (url "https://github.com/TurboVNC/turbovnc")
188 (commit version)))
189 (modules '((guix build utils)
190 (ice-9 ftw)
191 (srfi srfi-26)))
192 (snippet
193 #~(begin
194 ;; There are a few bundled Java libraries, such as jsch and jzlib,
195 ;; bundled under java/com/jcraft/ as well as mindrot and spf4j,
196 ;; bundled under java/org. These are used by the 'vncviewer'
197 ;; program. The jsch copy is modified and integrates changes from
198 ;; https://github.com/mwiede/jsch, so cannot easily be un-bundled.
199 (define (delete-all-but directory . preserve)
200 (with-directory-excursion directory
201 (let* ((pred (negate (cut member <>
202 (cons* "." ".." preserve))))
203 (items (scandir "." pred)))
204 (for-each (cut delete-file-recursively <>) items))))
205
206 ;; d3des, rfb (headers) and turbojpeg-jni are small and not
207 ;; packaged in Guix, so preserve them.
208 (delete-all-but "common" "d3des" "rfb" "turbojpeg-jni")
209 ;; Delete bundled headers which aren't used.
210 (delete-all-but "unix/Xvnc/include" "tvnc_version.h.in")
211 ;; This 243 lines of code C library is used by
212 ;; unix/Xvnc/programs/Xserver/os/xsha1.c.
213 (delete-all-but "unix/Xvnc/lib" "CMakeLists.txt" "libsha1")))
214 (sha256
215 (base32
216 "0q53r9j2sy77hgfbm4af1nbixwlhpdh5zz6as3wkk8wv1f27xqdk"))))
217 (build-system cmake-build-system)
218 (arguments
219 (list
220 #:tests? #f ;no test suite
221 #:configure-flags
222 ;; Use system libraries.
223 #~(list "-DTVNC_SYSTEMLIBS=ON"
224 "-DTVNC_SYSTEMX11=ON"
225 "-DTVNC_DLOPENSSL=OFF"
226 (string-append "-DXORG_DRI_DRIVER_PATH="
227 (search-input-directory %build-inputs "lib/dri"))
228 (string-append "-DXORG_FONT_PATH="
229 "/run/current-system/profile/share/fonts/X11,"
230 (string-append #$(this-package-input "font-alias")
231 "share/fonts/X11"))
232 (string-append "-DXORG_REGISTRY_PATH="
233 (dirname (search-input-file
234 %build-inputs "lib/xorg/protocol.txt")))
235 (string-append "-DXKB_BASE_DIRECTORY="
236 (search-input-directory %build-inputs
237 "share/X11/xkb"))
238 (string-append "-DXKB_BIN_DIRECTORY="
239 (dirname (search-input-file %build-inputs
240 "bin/xkbcomp")))
241 ;; The default rule is 'xorg', which doesn't match the 'base'
242 ;; rule file installed by our version of xkeyboard-config.
243 ;; Without this change, running Xvnc would fail with the error
244 ;; "XKB: Failed to compile keymap"
245 "-DXKB_DFLT_RULES=base"
246 ;; Mimic xorg-server's "--with-xkb-output=/tmp" configuration.
247 "-DCOMPILEDDEFAULTFONTPATH=/tmp"
248 "-DTVNC_STATIC_XORG_PATHS=ON"
249 "-DTVNC_ZLIBNG=OFF") ;avoid using the bundled zlib-ng source
250 #:phases
251 #~(modify-phases %standard-phases
252 (add-after 'unpack 'patch-vncviewer
253 (lambda* (#:key inputs #:allow-other-keys)
254 (define openjdk #$(this-package-input "openjdk"))
255 (substitute* "unix/vncviewer/vncviewer.in"
256 (("\\$BINDIR/../java/jre")
257 openjdk)
258 ;; Avoid resorting to grep and sed to locate libjawt.so.
259 (("^_TMP=.*")
260 (string-append "_TMP=" openjdk "/lib\n")))))
261 (add-after 'unpack 'patch-xstartup.turbovnc
262 (lambda* (#:key inputs #:allow-other-keys)
263 (substitute* "unix/xstartup.turbovnc"
264 (("DBUS_LAUNCH=[[:graph:]]+")
265 (format #f "DBUS_LAUNCH=~a"
266 (search-input-file inputs "bin/dbus-launch")))
267 (("XSESSIONSDIR=[[:graph:]]+")
268 (format #f "XSESSIONSDIR=~a"
269 "/run/current-system/profile/share/xsessions"))
270 (("GREP=[[:graph:]]+")
271 (format #f "GREP=~a"
272 (search-input-file inputs "bin/grep")))
273 (("SED=[[:graph:]]+")
274 (format #f "SED=~a"
275 (search-input-file inputs "bin/sed")))
276 (("TVNC_SSHAGENT=[[:graph:]]+")
277 (format #f "TVNC_SSHAGENT=~a"
278 (search-input-file inputs "bin/ssh-agent")))
279 (("TVNC_VGLRUN=\"vglrun" all)
280 (string-append "TVNC_VGLRUN="
281 (search-input-file inputs "bin/vglrun") all)))))
282 (add-after 'install 'wrap-vncserver
283 (lambda* (#:key inputs outputs #:allow-other-keys)
284 (wrap-script (search-input-file outputs "bin/vncserver")
285 (list "PATH" 'prefix
286 (map (lambda (p)
287 (dirname (search-input-file inputs p)))
288 '("bin/uname" ;coreutils
289 "bin/xauth"
290 "bin/xdpyinfo"))))))
291 (add-after 'install 'wrap-xstartup.turbovnc
292 (lambda* (#:key inputs outputs #:allow-other-keys)
293 (wrap-script (search-input-file outputs "bin/xstartup.turbovnc")
294 (list "PATH" 'prefix
295 (map (lambda (p)
296 (dirname (search-input-file inputs p)))
297 '("bin/uname" ;coreutils
298 ;; These are used as the fallback when no desktop
299 ;; session was found.
300 "bin/twm"
301 "bin/xsetroot"
302 "bin/xterm")))))))))
303 (native-inputs
304 (list `(,openjdk "jdk")
305 pkg-config
306 python))
307 (inputs
308 (list dbus
309 font-alias
310 freetype
311 guile-3.0
312 libfontenc
313 libjpeg-turbo
314 libx11
315 libxdamage
316 libxext
317 libxfont2
318 libxi
319 libxkbfile
320 linux-pam
321 mesa
322 openjdk
323 openssh
324 openssl
325 perl
326 pixman
327 twm
328 virtualgl
329 xauth
330 xdpyinfo
331 xkbcomp
332 xkeyboard-config
333 xorg-server
334 xorgproto
335 xsetroot
336 xterm
337 xtrans
338 zlib))
339 (home-page "https://turbovnc.org/")
340 (synopsis "Highly-optimized VNC remote desktop software")
341 (description "TurboVNC is a high-speed version of VNC derived from
342TightVNC, with which it remains compatible. It contains a variant of Tight
343encoding that is tuned to maximize performance for image-intensive
344applications (such as VirtualGL, video applications, and image editors) while
345still providing excellent performance for other types of applications. Some
346of its unique features are:
347@itemize
348@item a user-facing @command{vncserver} command;
349@item the ability to capture keyboard keys even when not in full screen mode;
350@item a full screen mode that is compatible with ratpoison*
351@end itemize
352*Although due to a quirk in Java, you'll want to set the
353@env{_JAVA_AWT_WM_NONREPARENTING} environment variable when using it with
354ratpoison.")
355 (license license:gpl2+)))
356
357(define-public x11vnc
358 ;; The release version of 0.9.16 requires patches to work, so we pin to the
359 ;; latest working commit
360 (let ((commit "3e4dc8ef2985a6e670e1d9649fe55395c2b31039")
361 (revision "0"))
362 (package
363 (name "x11vnc")
364 (version (git-version "0.9.16" revision commit))
365 (source (origin
366 (method git-fetch)
367 (uri (git-reference
368 (url "https://github.com/LibVNC/x11vnc")
369 (commit commit)))
370 (file-name (git-file-name name version))
371 (sha256
372 (base32
373 "0a120gv9h3whiznlddl0j3nz3400jjgl97znaincm5i2m5pnjifs"))))
374 (build-system gnu-build-system)
375 (arguments
376 (list #:phases #~(modify-phases %standard-phases
377 (add-before 'bootstrap 'delete-premature-configure
378 (lambda _
379 (substitute* "./autogen.sh"
380 ((".*/configure")
381 "")))))))
382 (native-inputs (list autoconf automake autobuild pkg-config))
383 (inputs (list avahi
384 libjpeg-turbo
385 libvnc
386 libx11
387 libxcomposite
388 libxdamage
389 libxext
390 libxfixes
391 libxi
392 libxinerama
393 libxrandr
394 libxtst
395 openssl
396 xdpyinfo
397 xf86-video-dummy
398 zlib))
399 (synopsis "VNC server for real X displays")
400 (home-page "https://github.com/LibVNC/x11vnc")
401 (description
402 "x11vnc allows one to view and interact with real remote X
403displays (i.e. a display corresponding to a physical monitor, keyboard, and
404mouse) with any VNC viewer.")
405 (license license:gpl2+))))
406
407(define-public libvnc
408 (package
409 (name "libvnc")
410 (version "0.9.15")
411 (source
412 (origin
413 (method git-fetch)
414 (uri (git-reference
415 (url "https://github.com/LibVNC/libvncserver")
416 (commit (string-append "LibVNCServer-" version))))
417 (file-name (git-file-name name version))
418 (sha256
419 (base32 "0b3ik1dbd9lyiiavv3zpyb3iycnfvjgsjym0ilyr1yac6899qxkb"))))
420 (build-system cmake-build-system)
421 (arguments
422 '(#:phases (modify-phases %standard-phases
423 (add-after 'unpack 'patch-cc-reference
424 (lambda _
425 (substitute* "test/includetest.sh"
426 (("^cc -I")
427 "gcc -I"))
428 #t)))))
429 (native-inputs
430 (list pkg-config))
431 (inputs
432 `(("gnutls" ,gnutls)
433 ("libgcrypt" ,libgcrypt)
434 ("libjpeg" ,libjpeg-turbo)
435 ("libpng" ,libpng)
436 ("lzo" ,lzo)
437 ("sdl2" ,sdl2)))
438 (home-page "https://libvnc.github.io/")
439 (synopsis "Cross-platform C libraries for implementing VNC server or
440client")
441 (description "This package provides @code{LibVNCServer} and
442@code{LibVNCClient}. These are cross-platform C libraries that allow you to
443easily implement VNC server or client functionality in your program.")
444 (license ;; GPL for programs, FDL for documentation
445 (list license:gpl2+ license:fdl1.2+))))
446
447(define-public neatvnc
448 (package
449 (name "neatvnc")
450 (version "1.0.1")
451 (source (origin
452 (method git-fetch)
453 (uri (git-reference
454 (url "https://github.com/any1/neatvnc")
455 (commit (string-append "v" version))))
456 (file-name (git-file-name name version))
457 (sha256
458 (base32
459 "1q7sqck7xvnxk0sr43z9hmph3q85b04vcxdip6jiy5p8vgf721v5"))))
460 (build-system meson-build-system)
461 (arguments (list #:phases
462 #~(modify-phases %standard-phases
463 (add-after 'install 'sanitize-pkg-config-files
464 (lambda _
465 (substitute* (find-files #$output "\\.pc$")
466 (("^Requires.private:.*") "")))))))
467 (native-inputs (list pkg-config))
468 (inputs
469 (list aml libdrm libglvnd libxkbcommon pixman aml gnutls libjpeg-turbo zlib))
470 (home-page "https://github.com/any1/neatvnc")
471 (synopsis "Lightweight VNC server library")
472 (description "NeatVNC is a lightweight VNC server library, supporting
473authentication, SSH tunneling, and ZRLE or Tight encoding.")
474 (license license:isc)))
475
476(define-public wayvnc
477 (package
478 (name "wayvnc")
479 (version "0.10.1")
480 (source
481 (origin
482 (method git-fetch)
483 (uri (git-reference
484 (url "https://github.com/any1/wayvnc")
485 (commit (string-append "v" version))))
486 (file-name (git-file-name name version))
487 (sha256
488 (base32 "082g6kfn66yqjr2qi3dx6m381ljk0zs1mr2qbq2ypsnf7srbwnsx"))))
489 (build-system meson-build-system)
490 (native-inputs
491 (append (if (%current-target-system)
492 ;; for wayland-scanner
493 (list wayland)
494 '())
495 (list pkg-config scdoc)))
496 (inputs (list aml
497 gnutls
498 jansson
499 libdrm
500 libglvnd
501 libjpeg-turbo
502 libxkbcommon
503 neatvnc
504 pixman
505 wayland
506 zlib))
507 (home-page "https://github.com/any1/wayvnc")
508 (synopsis "VNC server for wlroots-based Wayland compositors")
509 (description
510 "This is a VNC server for wlroots-based Wayland compositors.
511It attaches to a running Wayland session, creates virtual input devices, and
512exposes a single display via the RFB protocol. The Wayland session may be a
513headless one, so it is also possible to run wayvnc without a physical display
514attached.")
515 (license license:isc)))