lol

Merge pull request #113657 from nh2/turbovnc

turbovnc: init at 2.2.5

authored by

Niklas Hambüchen and committed by
GitHub
53ffeb59 60031a1e

+126 -1
+10 -1
pkgs/development/libraries/libjpeg-turbo/default.nix
··· 1 1 { lib, stdenv, fetchFromGitHub, cmake, nasm 2 + , openjdk 3 + , enableJava ? false # whether to build the java wrapper 2 4 , enableStatic ? stdenv.hostPlatform.isStatic 3 5 , enableShared ? !stdenv.hostPlatform.isStatic 4 6 }: ··· 26 28 moveToOutput include/transupp.h $dev_private 27 29 ''; 28 30 29 - nativeBuildInputs = [ cmake nasm ]; 31 + nativeBuildInputs = [ 32 + cmake 33 + nasm 34 + ] ++ lib.optionals enableJava [ 35 + openjdk 36 + ]; 30 37 31 38 cmakeFlags = [ 32 39 "-DENABLE_STATIC=${if enableStatic then "1" else "0"}" 33 40 "-DENABLE_SHARED=${if enableShared then "1" else "0"}" 41 + ] ++ lib.optionals enableJava [ 42 + "-DWITH_JAVA=1" 34 43 ]; 35 44 36 45 doInstallCheck = true;
+111
pkgs/tools/admin/turbovnc/default.nix
··· 1 + { lib 2 + , stdenv 3 + , fetchFromGitHub 4 + 5 + # Dependencies 6 + , cmake 7 + , libjpeg_turbo 8 + , makeWrapper 9 + , mesa # for built-in 3D software rendering using swrast 10 + , openjdk # for the client with Java GUI 11 + , openjdk_headless # for the server 12 + , openssh 13 + , openssl 14 + , pam 15 + , perl 16 + , which 17 + , xkbcomp 18 + , xkeyboard_config 19 + , xorg 20 + }: 21 + 22 + stdenv.mkDerivation rec { 23 + pname = "turbovnc"; 24 + version = "2.2.5"; 25 + 26 + src = fetchFromGitHub { 27 + owner = "TurboVNC"; 28 + repo = "turbovnc"; 29 + rev = version; 30 + sha256 = "0r2lk5lza7a9h02g4z5j59d8qj0x1q1my665d1x1plny4g46vam0"; 31 + }; 32 + 33 + # TODO: 34 + # * Build outputs that are unclear: 35 + # * `-- FONT_ENCODINGS_DIRECTORY = /var/empty/share/X11/fonts/encodings` 36 + # Maybe relevant what the tigervnc and tightvnc derivations 37 + # do with their `fontDirectories`? 38 + # * `SERVER_MISC_CONFIG_PATH = /var/empty/lib64/xorg` 39 + # * The thing about xorg `protocol.txt` 40 + # * Does SSH support require `openssh` on PATH? 41 + # * Add `enableClient ? true` flag that disables the client GUI 42 + # so that the server can be built without openjdk dependency. 43 + # * Perhaps allow to build the client on non-Linux platforms. 44 + 45 + nativeBuildInputs = [ 46 + cmake 47 + makeWrapper 48 + openjdk_headless 49 + ]; 50 + 51 + buildInputs = [ 52 + libjpeg_turbo 53 + openssl 54 + pam 55 + perl 56 + ] ++ (with xorg; [ 57 + libSM 58 + libX11 59 + libXext 60 + libXi 61 + xorgproto 62 + ]); 63 + 64 + cmakeFlags = [ 65 + # For the 3D software rendering built into TurboVNC, pass the path 66 + # to the swrast dri driver in Mesa. 67 + # Can also be given at runtime to its `Xvnc` as: 68 + # -dridir /nix/store/...-mesa-20.1.10-drivers/lib/dri/ 69 + "-DDRI_DRIVER_PATH=${mesa.drivers}/lib/dri" 70 + # The build system doesn't find these files automatically. 71 + "-DTJPEG_JAR=${libjpeg_turbo.out}/share/java/turbojpeg.jar" 72 + "-DTJPEG_JNILIBRARY=${libjpeg_turbo.out}/lib/libturbojpeg.so" 73 + "-DXKB_BASE_DIRECTORY=${xkeyboard_config}/share/X11/xkb" 74 + "-DXKB_BIN_DIRECTORY=${xkbcomp}/bin" 75 + ]; 76 + 77 + postInstall = '' 78 + # turbovnc dlopen()s libssl.so depending on the requested encryption. 79 + wrapProgram $out/bin/Xvnc \ 80 + --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ openssl ]} 81 + 82 + # `twm` is the default window manager that `vncserver` tries to start, 83 + # and it has minimal dependencies (no non-Xorg). 84 + # (This default is written by `vncserver` to `~/.vnc/xstartup.turbovnc`, 85 + # see https://github.com/TurboVNC/turbovnc/blob/ffdb57d9/unix/vncserver.in#L201.) 86 + # It checks for it using `which twm`. 87 + wrapProgram $out/bin/vncserver \ 88 + --prefix PATH : ${lib.makeBinPath [ which xorg.twm ]} 89 + 90 + # Patch /usr/bin/perl 91 + patchShebangs $out/bin/vncserver 92 + 93 + # vncserver needs `xauth` 94 + wrapProgram $out/bin/vncserver \ 95 + --prefix PATH : ${lib.makeBinPath (with xorg; [ xauth ])} 96 + 97 + # The viewer is in Java and requires `JAVA_HOME`. 98 + # For SSH support, `ssh` is required on `PATH`. 99 + wrapProgram $out/bin/vncviewer \ 100 + --prefix JAVA_HOME : "${lib.makeLibraryPath [ openjdk ]}/openjdk" \ 101 + --prefix PATH : ${lib.makeBinPath [ openssh ]} 102 + ''; 103 + 104 + meta = { 105 + homepage = "https://turbovnc.org/"; 106 + license = lib.licenses.gpl2Plus; 107 + description = "High-speed version of VNC derived from TightVNC"; 108 + maintainers = with lib.maintainers; [ nh2 ]; 109 + platforms = with lib.platforms; linux; 110 + }; 111 + }
+5
pkgs/top-level/all-packages.nix
··· 8967 8967 8968 8968 ttwatch = callPackage ../tools/misc/ttwatch { }; 8969 8969 8970 + turbovnc = callPackage ../tools/admin/turbovnc { 8971 + # fontDirectories = [ xorg.fontadobe75dpi xorg.fontmiscmisc xorg.fontcursormisc xorg.fontbhlucidatypewriter75dpi ]; 8972 + libjpeg_turbo = libjpeg_turbo.override { enableJava = true; }; 8973 + }; 8974 + 8970 8975 udunits = callPackage ../development/libraries/udunits { }; 8971 8976 8972 8977 uftp = callPackage ../servers/uftp {};