2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch,
|
2018-10-16 09:40:27 +00:00
|
|
|
openssl, zlib, libjpeg, xorg, coreutils, libvncserver,
|
2021-01-17 09:17:16 +00:00
|
|
|
autoreconfHook, pkg-config }:
|
2008-02-22 03:06:12 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "x11vnc";
|
2019-01-16 08:22:03 +00:00
|
|
|
version = "0.9.16";
|
2010-07-29 18:55:16 +00:00
|
|
|
|
2018-10-16 09:40:27 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "LibVNC";
|
|
|
|
repo = "x11vnc";
|
|
|
|
rev = version;
|
2019-01-16 08:22:03 +00:00
|
|
|
sha256 = "1g652mmi79pfq4p5p7spaswa164rpzjhc5rn2phy5pm71lm0vib1";
|
2010-07-29 18:55:16 +00:00
|
|
|
};
|
|
|
|
|
2020-11-28 14:58:55 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "CVE-2020-29074.patch";
|
|
|
|
url = "https://github.com/LibVNC/x11vnc/commit/69eeb9f7baa14ca03b16c9de821f9876def7a36a.patch";
|
|
|
|
sha256 = "0hdhp32g2i5m0ihmaxkxhsn3d5f2qasadvwpgxify4xnzabmyb2d";
|
|
|
|
})
|
2022-06-03 07:12:05 +00:00
|
|
|
|
|
|
|
# Pull upstream fix for -fno-common toolchains:
|
|
|
|
# https://github.com/LibVNC/x11vnc/pull/121
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fno-common.patch";
|
|
|
|
url = "https://github.com/LibVNC/x11vnc/commit/a48b0b1cd887d7f3ae67f525d7d334bd2feffe60.patch";
|
|
|
|
sha256 = "046gjsmg0vm0m4y9ny17y2jayc4ba7vib2whw71l5x1hjp6pksjs";
|
|
|
|
})
|
2020-11-28 14:58:55 +00:00
|
|
|
];
|
|
|
|
|
2021-01-17 09:17:16 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkg-config ];
|
2018-10-16 09:40:27 +00:00
|
|
|
|
2010-07-29 18:55:16 +00:00
|
|
|
buildInputs =
|
2018-12-31 03:40:47 +00:00
|
|
|
[ xorg.libXfixes xorg.xorgproto openssl xorg.libXdamage
|
|
|
|
zlib xorg.libX11 libjpeg
|
|
|
|
xorg.libXtst xorg.libXinerama xorg.libXrandr
|
|
|
|
xorg.libXext
|
|
|
|
xorg.libXi xorg.libXrender
|
2018-10-16 09:40:27 +00:00
|
|
|
libvncserver
|
2010-07-29 18:55:16 +00:00
|
|
|
];
|
|
|
|
|
2018-10-17 18:13:07 +00:00
|
|
|
postPatch = ''
|
2018-10-16 09:40:27 +00:00
|
|
|
substituteInPlace src/unixpw.c \
|
2017-01-29 10:11:01 +00:00
|
|
|
--replace '"/bin/su"' '"/run/wrappers/bin/su"' \
|
2011-11-10 19:06:02 +00:00
|
|
|
--replace '"/bin/true"' '"${coreutils}/bin/true"'
|
2013-11-08 15:37:10 +00:00
|
|
|
|
2018-10-16 09:40:27 +00:00
|
|
|
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
|
2018-10-17 18:13:07 +00:00
|
|
|
|
|
|
|
# Xdummy script is currently broken, so we avoid building it. This removes everything Xdummy-related from the affected Makefile
|
2018-10-17 08:09:16 +00:00
|
|
|
sed -i -e '/^\tXdummy.c\ \\$/,$d' -e 's/\tx11vnc_loop\ \\/\tx11vnc_loop/' misc/Makefile.am
|
2010-12-06 18:01:46 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2009-03-03 13:27:40 +00:00
|
|
|
description = "A VNC server connected to a real X11 screen";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/LibVNC/x11vnc/";
|
2018-09-12 19:47:25 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.gpl2;
|
2018-10-16 09:43:48 +00:00
|
|
|
maintainers = with maintainers; [ OPNA2608 ];
|
2023-11-23 21:09:35 +00:00
|
|
|
mainProgram = "x11vnc";
|
2008-02-22 03:06:12 +00:00
|
|
|
};
|
|
|
|
}
|