2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch,
|
2020-04-24 23:36:52 +00:00
|
|
|
openssl, zlib, libjpeg, xorg, coreutils, libvncserver,
|
2021-02-05 17:12:51 +00:00
|
|
|
autoreconfHook, pkg-config }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "x11vnc";
|
|
|
|
version = "0.9.16";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "LibVNC";
|
|
|
|
repo = "x11vnc";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "1g652mmi79pfq4p5p7spaswa164rpzjhc5rn2phy5pm71lm0vib1";
|
|
|
|
};
|
|
|
|
|
2020-11-30 08:33:03 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "CVE-2020-29074.patch";
|
|
|
|
url = "https://github.com/LibVNC/x11vnc/commit/69eeb9f7baa14ca03b16c9de821f9876def7a36a.patch";
|
|
|
|
sha256 = "0hdhp32g2i5m0ihmaxkxhsn3d5f2qasadvwpgxify4xnzabmyb2d";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs =
|
|
|
|
[ xorg.libXfixes xorg.xorgproto openssl xorg.libXdamage
|
|
|
|
zlib xorg.libX11 libjpeg
|
|
|
|
xorg.libXtst xorg.libXinerama xorg.libXrandr
|
|
|
|
xorg.libXext
|
|
|
|
xorg.libXi xorg.libXrender
|
|
|
|
libvncserver
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/unixpw.c \
|
|
|
|
--replace '"/bin/su"' '"/run/wrappers/bin/su"' \
|
|
|
|
--replace '"/bin/true"' '"${coreutils}/bin/true"'
|
|
|
|
|
|
|
|
sed -i -e '/#!\/bin\/sh/a"PATH=${xorg.xdpyinfo}\/bin:${xorg.xauth}\/bin:$PATH\\n"' -e 's|/bin/su|/run/wrappers/bin/su|g' src/ssltools.h
|
|
|
|
|
|
|
|
# Xdummy script is currently broken, so we avoid building it. This removes everything Xdummy-related from the affected Makefile
|
|
|
|
sed -i -e '/^\tXdummy.c\ \\$/,$d' -e 's/\tx11vnc_loop\ \\/\tx11vnc_loop/' misc/Makefile.am
|
|
|
|
'';
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
configureFlags="--mandir=$out/share/man"
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A VNC server connected to a real X11 screen";
|
|
|
|
homepage = "https://github.com/LibVNC/x11vnc/";
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = with maintainers; [ OPNA2608 ];
|
|
|
|
};
|
|
|
|
}
|