From 5111cf2da99481bf9f00b1f9bc9e996f01deb611 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Sun, 23 Feb 2020 14:45:18 +0100 Subject: [PATCH 1/3] neatvnc: init at 0.1.0 --- .../development/libraries/neatvnc/default.nix | 34 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 pkgs/development/libraries/neatvnc/default.nix diff --git a/pkgs/development/libraries/neatvnc/default.nix b/pkgs/development/libraries/neatvnc/default.nix new file mode 100644 index 00000000000..8dbcf92feed --- /dev/null +++ b/pkgs/development/libraries/neatvnc/default.nix @@ -0,0 +1,34 @@ +{ stdenv, fetchFromGitHub, meson, pkg-config, ninja +, pixman, libuv, gnutls, libdrm +# libjpeg_turbo: Optional, for tight encoding (disabled because experimental) +}: + +stdenv.mkDerivation rec { + pname = "neatvnc"; + version = "0.1.0"; + + src = fetchFromGitHub { + owner = "any1"; + repo = pname; + rev = "v${version}"; + sha256 = "04wcpwxlcf0bczcs97j21346mn6finfj7xgc2dsrwrw9xq8qa7wc"; + }; + + nativeBuildInputs = [ meson pkg-config ninja ]; + buildInputs = [ pixman libuv gnutls libdrm ]; + + meta = with stdenv.lib; { + description = "A VNC server library"; + longDescription = '' + This is a liberally licensed VNC server library that's intended to be + fast and neat. Goals: + - Speed + - Clean interface + - Interoperability with the Freedesktop.org ecosystem + ''; + inherit (src.meta) homepage; + license = licenses.isc; + platforms = platforms.linux; + maintainers = with maintainers; [ primeos ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 025c6a4631c..608300709ac 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13465,6 +13465,8 @@ in neardal = callPackage ../development/libraries/neardal { }; + neatvnc = callPackage ../development/libraries/neatvnc { }; + neon = callPackage ../development/libraries/neon { }; neon_0_29 = callPackage ../development/libraries/neon/0.29.nix { From f58a7349f92d830f1e496375f815452da3e5d192 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Sun, 23 Feb 2020 14:49:02 +0100 Subject: [PATCH 2/3] wayvnc: init at 0.1.0 --- .../networking/remote/wayvnc/default.nix | 33 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 35 insertions(+) create mode 100644 pkgs/applications/networking/remote/wayvnc/default.nix diff --git a/pkgs/applications/networking/remote/wayvnc/default.nix b/pkgs/applications/networking/remote/wayvnc/default.nix new file mode 100644 index 00000000000..b1498d0a9ce --- /dev/null +++ b/pkgs/applications/networking/remote/wayvnc/default.nix @@ -0,0 +1,33 @@ +{ stdenv, fetchFromGitHub, meson, pkg-config, ninja +, pixman, libuv, libGL, libxkbcommon, wayland, neatvnc, libdrm, libX11 +}: + +stdenv.mkDerivation rec { + pname = "wayvnc"; + version = "0.1.0"; + + src = fetchFromGitHub { + owner = "any1"; + repo = pname; + rev = "v${version}"; + sha256 = "17c30c33zzhhlqzc4a5dd1y74ch7c8gsm98wvcn4n1fv50fbmpbd"; + }; + + nativeBuildInputs = [ meson pkg-config ninja ]; + buildInputs = [ pixman libuv libGL libxkbcommon wayland neatvnc libdrm libX11 ]; + + meta = with stdenv.lib; { + description = "A VNC server for wlroots based Wayland compositors"; + longDescription = '' + This is a VNC server for wlroots based Wayland compositors. It attaches + to a running Wayland session, creates virtual input devices and exposes a + single display via the RFB protocol. The Wayland session may be a + headless one, so it is also possible to run wayvnc without a physical + display attached. + ''; + inherit (src.meta) homepage; + license = licenses.isc; + platforms = platforms.linux; + maintainers = with maintainers; [ primeos ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 608300709ac..cfb5369593b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -22166,6 +22166,8 @@ in wayv = callPackage ../tools/X11/wayv {}; + wayvnc = callPackage ../applications/networking/remote/wayvnc { }; + webmacs = libsForQt5.callPackage ../applications/networking/browsers/webmacs {}; webtorrent_desktop = callPackage ../applications/video/webtorrent_desktop {}; From c1e77269cf7975386c52b5bd9f54808ffd318d4f Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Sat, 29 Feb 2020 15:26:17 +0100 Subject: [PATCH 3/3] neatvnc: Disable the CPU acceleration by default For Nixpkgs it seems best to disable the usage of CPU extensions by default as older CPUs don't support them which will result in a crash at runtime (SIGILL: Illegal instruction) [0]. The performance on my old test system was more than enough anyway (usually ~10% CPU usage due to wayvnc). [0]: https://github.com/any1/neatvnc/issues/21 --- pkgs/development/libraries/neatvnc/default.nix | 3 +++ .../neatvnc/disable-cpu-acceleration.patch | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 pkgs/development/libraries/neatvnc/disable-cpu-acceleration.patch diff --git a/pkgs/development/libraries/neatvnc/default.nix b/pkgs/development/libraries/neatvnc/default.nix index 8dbcf92feed..127f25a50be 100644 --- a/pkgs/development/libraries/neatvnc/default.nix +++ b/pkgs/development/libraries/neatvnc/default.nix @@ -1,6 +1,7 @@ { stdenv, fetchFromGitHub, meson, pkg-config, ninja , pixman, libuv, gnutls, libdrm # libjpeg_turbo: Optional, for tight encoding (disabled because experimental) +, enableCpuAcceleration ? false # Whether to use CPU extensions (e.g. AVX) }: stdenv.mkDerivation rec { @@ -17,6 +18,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ meson pkg-config ninja ]; buildInputs = [ pixman libuv gnutls libdrm ]; + patches = stdenv.lib.optional (!enableCpuAcceleration) ./disable-cpu-acceleration.patch; + meta = with stdenv.lib; { description = "A VNC server library"; longDescription = '' diff --git a/pkgs/development/libraries/neatvnc/disable-cpu-acceleration.patch b/pkgs/development/libraries/neatvnc/disable-cpu-acceleration.patch new file mode 100644 index 00000000000..97b77c02df4 --- /dev/null +++ b/pkgs/development/libraries/neatvnc/disable-cpu-acceleration.patch @@ -0,0 +1,17 @@ +diff --git a/meson.build b/meson.build +index 31dd8b8..8761087 100644 +--- a/meson.build ++++ b/meson.build +@@ -21,12 +21,6 @@ endif + + cpu = host_machine.cpu_family() + +-if cpu == 'x86_64' +- c_args += '-mavx' +-elif cpu == 'arm' +- c_args += '-mfpu=neon' +-endif +- + add_project_arguments(c_args, language: 'c') + + cc = meson.get_compiler('c')