From 891df4eec98d7330246c24d79d579113da964367 Mon Sep 17 00:00:00 2001 From: "Markus S. Wamser" Date: Tue, 17 May 2022 11:35:05 +0200 Subject: [PATCH] turbovnc: 2.2.7 -> 3.0, unvendor libs --- pkgs/tools/admin/turbovnc/default.nix | 40 ++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/pkgs/tools/admin/turbovnc/default.nix b/pkgs/tools/admin/turbovnc/default.nix index 26916cc5598c..c1e1bf441e57 100644 --- a/pkgs/tools/admin/turbovnc/default.nix +++ b/pkgs/tools/admin/turbovnc/default.nix @@ -4,7 +4,10 @@ , nixosTests # Dependencies +, bzip2 , cmake +, freetype +, libGL , libjpeg_turbo , makeWrapper , mesa # for built-in 3D software rendering using swrast @@ -14,21 +17,24 @@ , openssl , pam , perl +, python3 , which , xkbcomp , xkeyboard_config , xorg +, xterm +, zlib }: stdenv.mkDerivation rec { pname = "turbovnc"; - version = "2.2.7"; + version = "3.0"; src = fetchFromGitHub { owner = "TurboVNC"; repo = "turbovnc"; rev = version; - sha256 = "sha256-mEdatfTBx4nNmMTgv1Z+xefPFEiE2rCrsxyB7Dd03rg="; + sha256 = "sha256-4/pfKb89ld32LvqTXjVpIJUCCDA+D7CLYMNFYytKVIE="; }; # TODO: @@ -47,21 +53,40 @@ stdenv.mkDerivation rec { cmake makeWrapper openjdk_headless + python3 ]; buildInputs = [ + bzip2 + freetype + libGL # for -DTVNC_SYSTEMX11=1 libjpeg_turbo openssl pam perl + zlib ] ++ (with xorg; [ + libfontenc # for -DTVNC_SYSTEMX11=1 libSM libX11 + libXdamage # for -DTVNC_SYSTEMX11=1 + libXdmcp # for -DTVNC_SYSTEMX11=1 libXext + libXfont2 # for -DTVNC_SYSTEMX11=1 + libxkbfile # for -DTVNC_SYSTEMX11=1 libXi + mesa # for -DTVNC_SYSTEMX11=1 + pixman # for -DTVNC_SYSTEMX11=1 xorgproto + xtrans # for -DTVNC_SYSTEMX11=1 ]); + postPatch = '' + substituteInPlace unix/Xvnc/CMakeLists.txt --replace 'string(REGEX REPLACE "X11" "Xfont2" X11_Xfont2_LIB' 'set(X11_Xfont2_LIB ${xorg.libXfont2}/lib/libXfont2.so) #' + substituteInPlace unix/Xvnc/CMakeLists.txt --replace 'string(REGEX REPLACE "X11" "fontenc" X11_Fontenc_LIB' 'set(X11_Fontenc_LIB ${xorg.libfontenc}/lib/libfontenc.so) #' + substituteInPlace unix/Xvnc/CMakeLists.txt --replace 'string(REGEX REPLACE "X11" "pixman-1" X11_Pixman_LIB' 'set(X11_Pixman_LIB ${xorg.pixman}/lib/libpixman-1.so) #' + ''; + cmakeFlags = [ # For the 3D software rendering built into TurboVNC, pass the path # to the swrast dri driver in Mesa. @@ -73,6 +98,10 @@ stdenv.mkDerivation rec { "-DTJPEG_JNILIBRARY=${libjpeg_turbo.out}/lib/libturbojpeg.so" "-DXKB_BASE_DIRECTORY=${xkeyboard_config}/share/X11/xkb" "-DXKB_BIN_DIRECTORY=${xkbcomp}/bin" + # use system libs + "-DTVNC_SYSTEMLIBS=1" + "-DTVNC_SYSTEMX11=1" + "-DTVNC_DLOPENSSL=0" ]; postInstall = '' @@ -85,16 +114,13 @@ stdenv.mkDerivation rec { # (This default is written by `vncserver` to `~/.vnc/xstartup.turbovnc`, # see https://github.com/TurboVNC/turbovnc/blob/ffdb57d9/unix/vncserver.in#L201.) # It checks for it using `which twm`. + # vncserver needs also needs `xauth` and we add in `xterm` for convenience wrapProgram $out/bin/vncserver \ - --prefix PATH : ${lib.makeBinPath [ which xorg.twm ]} + --prefix PATH : ${lib.makeBinPath [ which xorg.twm xorg.xauth xterm ]} # Patch /usr/bin/perl patchShebangs $out/bin/vncserver - # vncserver needs `xauth` - wrapProgram $out/bin/vncserver \ - --prefix PATH : ${lib.makeBinPath (with xorg; [ xauth ])} - # The viewer is in Java and requires `JAVA_HOME` (which is a single # path, cannot be multiple separated paths). # For SSH support, `ssh` is required on `PATH`.