From fcfd8d87882e924479ba3395c02c701c041511c9 Mon Sep 17 00:00:00 2001 From: Rouven Czerwinski Date: Fri, 27 May 2022 14:26:03 +0200 Subject: [PATCH 01/15] xwayland: 22.1.1 -> 22.1.3 Version bump: 22.1.3: - fix two XKB security vulnerabilities 22.1.2: - fix an invalid pointer access in drm_lease_handle_device - Add and set RANDR emulation (cherry picked from commit 21a1bff4638b812d74c9bb125b57ed2b1d2f27c4) --- pkgs/servers/x11/xorg/xwayland.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/x11/xorg/xwayland.nix b/pkgs/servers/x11/xorg/xwayland.nix index 97414481a915..50210a791029 100644 --- a/pkgs/servers/x11/xorg/xwayland.nix +++ b/pkgs/servers/x11/xorg/xwayland.nix @@ -44,10 +44,10 @@ stdenv.mkDerivation rec { pname = "xwayland"; - version = "22.1.1"; + version = "22.1.3"; src = fetchurl { url = "mirror://xorg/individual/xserver/${pname}-${version}.tar.xz"; - sha256 = "sha256-9dDgujfhm7h8YvYdpZcL0gSTnyEgYglkvtTMhJW6plc="; + sha256 = "sha256-pxLre84yzZNN82gUtd0EaqZwiZwW/pjyr7ADV4+GocU="; }; depsBuildBuild = [ From 81f1dcb03494592134fbc5e97a77c8f59dc7e23c Mon Sep 17 00:00:00 2001 From: Sandro Date: Sat, 23 Jul 2022 21:21:13 +0200 Subject: [PATCH 02/15] Apply suggestions from code review (cherry picked from commit 5061ccd1c2bee119b6896e0ef2a59ddd498b6a61) --- pkgs/servers/x11/xorg/xwayland.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/servers/x11/xorg/xwayland.nix b/pkgs/servers/x11/xorg/xwayland.nix index 50210a791029..134e992a56c8 100644 --- a/pkgs/servers/x11/xorg/xwayland.nix +++ b/pkgs/servers/x11/xorg/xwayland.nix @@ -42,9 +42,9 @@ , defaultFontPath ? "" }: stdenv.mkDerivation rec { - pname = "xwayland"; version = "22.1.3"; + src = fetchurl { url = "mirror://xorg/individual/xserver/${pname}-${version}.tar.xz"; sha256 = "sha256-pxLre84yzZNN82gUtd0EaqZwiZwW/pjyr7ADV4+GocU="; From bdd4d8f08aa38dfcec88267c417a204e37284d9a Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Tue, 9 Aug 2022 17:53:35 -0400 Subject: [PATCH 03/15] electron: use wrapper instead of symlink for bin on darwin electron fails to run through a symlink: ``` GPU process isn't usable. Goodbye. ``` (cherry picked from commit 4c476e1c70636614637a4c8fc0a1a90c4dee46f4) --- pkgs/development/tools/electron/generic.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/electron/generic.nix b/pkgs/development/tools/electron/generic.nix index a4a234215a2e..7c3bcbe637d5 100644 --- a/pkgs/development/tools/electron/generic.nix +++ b/pkgs/development/tools/electron/generic.nix @@ -103,14 +103,17 @@ let }; darwin = { - nativeBuildInputs = [ unzip ]; + nativeBuildInputs = [ + makeWrapper + unzip + ]; buildCommand = '' mkdir -p $out/Applications unzip $src mv Electron.app $out/Applications mkdir -p $out/bin - ln -s $out/Applications/Electron.app/Contents/MacOS/Electron $out/bin/electron + makeWrapper $out/Applications/Electron.app/Contents/MacOS/Electron $out/bin/electron ''; }; in From d497eb5af3f1448acc70f197292df21cd78a1d45 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Tue, 26 Jul 2022 22:34:45 -0400 Subject: [PATCH 04/15] deltachat-desktop: remove special case for electron on darwin (cherry picked from commit 45a58291de50d9587fcfaa2e75a3f162282bad9f) --- .../instant-messengers/deltachat-desktop/default.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/deltachat-desktop/default.nix b/pkgs/applications/networking/instant-messengers/deltachat-desktop/default.nix index 009ece90b4c6..42946ba80595 100644 --- a/pkgs/applications/networking/instant-messengers/deltachat-desktop/default.nix +++ b/pkgs/applications/networking/instant-messengers/deltachat-desktop/default.nix @@ -33,10 +33,6 @@ let }; patches = [ ./libdeltachat-darwin-dylib.patch ] ++ old.patches; }); - electronExec = if stdenv.isDarwin then - "${electron_16}/Applications/Electron.app/Contents/MacOS/Electron" - else - "${electron_16}/bin/electron"; esbuild' = esbuild.overrideAttrs (old: rec { version = "0.12.29"; src = fetchFromGitHub { @@ -95,7 +91,7 @@ in nodejs-14_x.pkgs.deltachat-desktop.override rec { $out/lib/node_modules/deltachat-desktop/html-dist/fonts done - makeWrapper ${electronExec} $out/bin/deltachat \ + makeWrapper ${electron_16}/bin/electron $out/bin/deltachat \ --set LD_PRELOAD ${sqlcipher}/lib/libsqlcipher${stdenv.hostPlatform.extensions.sharedLibrary} \ --add-flags $out/lib/node_modules/deltachat-desktop ''; From ed7a3086db3c26b9a1ba50f6f0440267004a8bf5 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Tue, 26 Jul 2022 22:35:39 -0400 Subject: [PATCH 05/15] element-desktop: remove special case for electron on darwin (cherry picked from commit 2c035ca89fa444e8ef492976678de84ac189241d) --- .../networking/instant-messengers/element/element-desktop.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/element/element-desktop.nix b/pkgs/applications/networking/instant-messengers/element/element-desktop.nix index 2ad5d8c4654f..e2370c357c06 100644 --- a/pkgs/applications/networking/instant-messengers/element/element-desktop.nix +++ b/pkgs/applications/networking/instant-messengers/element/element-desktop.nix @@ -19,7 +19,6 @@ let pinData = lib.importJSON ./pin.json; executableName = "element-desktop"; - electron_exec = if stdenv.isDarwin then "${electron}/Applications/Electron.app/Contents/MacOS/Electron" else "${electron}/bin/electron"; keytar = callPackage ./keytar { inherit Security AppKit; }; seshat = callPackage ./seshat { inherit CoreServices; }; in @@ -83,7 +82,7 @@ mkYarnPackage rec { # executable wrapper # LD_PRELOAD workaround for sqlcipher not found: https://github.com/matrix-org/seshat/issues/102 - makeWrapper '${electron_exec}' "$out/bin/${executableName}" \ + makeWrapper '${electron}/bin/electron' "$out/bin/${executableName}" \ --set LD_PRELOAD ${sqlcipher}/lib/libsqlcipher.so \ --add-flags "$out/share/element/electron" \ --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}" From 666ad6481bd70f0d667f878ed992289bcba09de5 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Tue, 26 Jul 2022 22:35:53 -0400 Subject: [PATCH 06/15] schildichat-desktop: remove special case for electron on darwin (cherry picked from commit 6877e896fc728e0a09c26954a5ea56e4bfc2a0f6) --- .../instant-messengers/schildichat/schildichat-desktop.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/schildichat/schildichat-desktop.nix b/pkgs/applications/networking/instant-messengers/schildichat/schildichat-desktop.nix index e2b4cafe9936..d1a1c8d64690 100644 --- a/pkgs/applications/networking/instant-messengers/schildichat/schildichat-desktop.nix +++ b/pkgs/applications/networking/instant-messengers/schildichat/schildichat-desktop.nix @@ -19,7 +19,6 @@ let pinData = lib.importJSON ./pin.json; executableName = "schildichat-desktop"; - electron_exec = if stdenv.isDarwin then "${electron}/Applications/Electron.app/Contents/MacOS/Electron" else "${electron}/bin/electron"; in stdenv.mkDerivation rec { pname = "schildichat-desktop"; @@ -88,7 +87,7 @@ stdenv.mkDerivation rec { done # executable wrapper - makeWrapper '${electron_exec}' "$out/bin/${executableName}" \ + makeWrapper '${electron}/bin/electron' "$out/bin/${executableName}" \ --add-flags "$out/share/element/electron" \ --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}" From b64bc65dcb8c9182a8bcaa442d305fe023771502 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Tue, 26 Jul 2022 22:37:34 -0400 Subject: [PATCH 07/15] micropad: remove special case for electron on darwin (cherry picked from commit 263b0365db9d78025bbd387c485ab42bfeb2e800) --- pkgs/applications/office/micropad/default.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkgs/applications/office/micropad/default.nix b/pkgs/applications/office/micropad/default.nix index a4ac00b3b6d0..0cf9ed342668 100644 --- a/pkgs/applications/office/micropad/default.nix +++ b/pkgs/applications/office/micropad/default.nix @@ -11,10 +11,6 @@ }: let executableName = "micropad"; - electron_exec = - if stdenv.isDarwin - then "${electron}/Applications/Electron.app/Contents/MacOS/Electron" - else "${electron}/bin/electron"; in mkYarnPackage rec { pname = "micropad"; @@ -64,7 +60,7 @@ in done # executable wrapper - makeWrapper '${electron_exec}' "$out/bin/${executableName}" \ + makeWrapper '${electron}/bin/electron' "$out/bin/${executableName}" \ --add-flags "$out/share/micropad" \ --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}" From fa005d50ae08f0c6bba0c92011a5d104c2c22183 Mon Sep 17 00:00:00 2001 From: Timothy DeHerrera Date: Sat, 16 Jul 2022 19:23:16 -0700 Subject: [PATCH 08/15] gamescope init at 3.11.33-jupiter-3.3-2 (cherry picked from commit a3f954f99146a2502083cb7b2a72461556af58c7) --- .../window-managers/gamescope/default.nix | 91 +++++++++++++++++++ .../gamescope/use-pkgconfig.patch | 11 +++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 104 insertions(+) create mode 100644 pkgs/applications/window-managers/gamescope/default.nix create mode 100644 pkgs/applications/window-managers/gamescope/use-pkgconfig.patch diff --git a/pkgs/applications/window-managers/gamescope/default.nix b/pkgs/applications/window-managers/gamescope/default.nix new file mode 100644 index 000000000000..2d271893b842 --- /dev/null +++ b/pkgs/applications/window-managers/gamescope/default.nix @@ -0,0 +1,91 @@ +{ stdenv +, fetchFromGitHub +, meson +, pkg-config +, ninja +, xorg +, libdrm +, vulkan-loader +, wayland +, wayland-protocols +, libxkbcommon +, libcap +, SDL2 +, pipewire +, udev +, pixman +, libinput +, libseat +, xwayland +, glslang +, stb +, wlroots +, libliftoff +, lib +, makeBinaryWrapper +}: +let + pname = "gamescope"; + version = "3.11.33-jupiter-3.3-2"; +in +stdenv.mkDerivation { + inherit pname version; + + src = fetchFromGitHub { + owner = "Plagman"; + repo = "gamescope"; + rev = "refs/tags/${version}"; + hash = "sha256-6/gTsQGZDQPCdmXe5EI9QcT/MkdTf6odsI2/+g/W7Qc="; + }; + + patches = [ ./use-pkgconfig.patch ]; + + nativeBuildInputs = [ + meson + pkg-config + ninja + makeBinaryWrapper + ]; + + buildInputs = [ + xorg.libXdamage + xorg.libXcomposite + xorg.libXrender + xorg.libXext + xorg.libXxf86vm + xorg.libXtst + xorg.libXres + xorg.libXi + libdrm + libliftoff + vulkan-loader + glslang + SDL2 + wayland + wayland-protocols + wlroots + xwayland + libseat + libinput + libxkbcommon + udev + pixman + pipewire + libcap + stb + ]; + + # --debug-layers flag expects these in the path + postInstall = '' + wrapProgram "$out/bin/gamescope" \ + --prefix PATH : ${with xorg; lib.makeBinPath [xprop xwininfo]} + ''; + + meta = with lib; { + description = "SteamOS session compositing window manager"; + homepage = "https://github.com/Plagman/gamescope"; + license = licenses.bsd2; + maintainers = with maintainers; [ nrdxp ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/applications/window-managers/gamescope/use-pkgconfig.patch b/pkgs/applications/window-managers/gamescope/use-pkgconfig.patch new file mode 100644 index 000000000000..29345952433e --- /dev/null +++ b/pkgs/applications/window-managers/gamescope/use-pkgconfig.patch @@ -0,0 +1,11 @@ +diff --git a/meson.build b/meson.build +index 1311784..77043ac 100644 +--- a/meson.build ++++ b/meson.build +@@ -6,7 +6,6 @@ project( + default_options: [ + 'cpp_std=c++14', + 'warning_level=2', +- 'force_fallback_for=wlroots,libliftoff', + ], + ) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ae51b848e102..b756dee71578 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1122,6 +1122,8 @@ with pkgs; libgamemode32 = pkgsi686Linux.gamemode.lib; }; + gamescope = callPackage ../applications/window-managers/gamescope { }; + gay = callPackage ../tools/misc/gay { }; elkhound = callPackage ../development/tools/elkhound { }; From 768025a4dd4b3df9f00721958d1f758f1f314a8d Mon Sep 17 00:00:00 2001 From: Bobby Rong Date: Fri, 12 Aug 2022 19:36:45 +0800 Subject: [PATCH 09/15] pantheon.elementary-terminal: 6.0.2 -> 6.1.0 (cherry picked from commit 5965f1b44c7d5d08120275e9d9c0b8e440c8a9d2) --- .../desktops/pantheon/apps/elementary-terminal/default.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pkgs/desktops/pantheon/apps/elementary-terminal/default.nix b/pkgs/desktops/pantheon/apps/elementary-terminal/default.nix index aa3d9981998c..4ec5518da21e 100644 --- a/pkgs/desktops/pantheon/apps/elementary-terminal/default.nix +++ b/pkgs/desktops/pantheon/apps/elementary-terminal/default.nix @@ -20,13 +20,13 @@ stdenv.mkDerivation rec { pname = "elementary-terminal"; - version = "6.0.2"; + version = "6.1.0"; src = fetchFromGitHub { owner = "elementary"; repo = "terminal"; rev = version; - sha256 = "sha256-glcY47E9bGVI6k9gakItN6srzMtmA4hCEz/JVD5UUmI="; + sha256 = "sha256-qxjHrlpdJcfXEUan/JgU7HqBRdB36gxAb5xmd/ySsj0="; }; nativeBuildInputs = [ @@ -49,9 +49,6 @@ stdenv.mkDerivation rec { vte ]; - # See https://github.com/elementary/terminal/commit/914d4b0e2d0a137f12276d748ae07072b95eff80 - mesonFlags = [ "-Dubuntu-bionic-patched-vte=false" ]; - postPatch = '' chmod +x meson/post_install.py patchShebangs meson/post_install.py From f39c6d996d30b86aa6060575d5d03166b3af0156 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sat, 13 Aug 2022 22:05:38 +0000 Subject: [PATCH 10/15] shellhub-agent: 0.9.4 -> 0.9.5 (cherry picked from commit f2ee0cc4658e3ebaf22ea476a6cdd6541407b84e) --- pkgs/applications/networking/shellhub-agent/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/shellhub-agent/default.nix b/pkgs/applications/networking/shellhub-agent/default.nix index da0e03a272b9..d1458745774f 100644 --- a/pkgs/applications/networking/shellhub-agent/default.nix +++ b/pkgs/applications/networking/shellhub-agent/default.nix @@ -8,13 +8,13 @@ buildGoModule rec { pname = "shellhub-agent"; - version = "0.9.4"; + version = "0.9.5"; src = fetchFromGitHub { owner = "shellhub-io"; repo = "shellhub"; rev = "v${version}"; - sha256 = "WcxRVup7wjA9YNyL6UpFoMfkCmXixfbYatcrmA4OHh4="; + sha256 = "EBtQOli8jh5Ful39tR4U/H3KH517LmoYfqVyydQQTpA="; }; modRoot = "./agent"; From 677306263bef3009af06c57eb070a5b6645ea9a2 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 14 Aug 2022 12:42:49 +0100 Subject: [PATCH 11/15] strace: 5.18 -> 5.19 While at it added trivial updater. Changes: https://github.com/strace/strace/releases/tag/v5.19 (cherry picked from commit e3f61ba99275acab18d716f3b39119a24c92a549) --- pkgs/development/tools/misc/strace/default.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/misc/strace/default.nix b/pkgs/development/tools/misc/strace/default.nix index bee5d227f4d6..63a24bac8354 100644 --- a/pkgs/development/tools/misc/strace/default.nix +++ b/pkgs/development/tools/misc/strace/default.nix @@ -1,12 +1,12 @@ -{ lib, stdenv, fetchurl, perl, libunwind, buildPackages }: +{ lib, stdenv, fetchurl, perl, libunwind, buildPackages, gitUpdater }: stdenv.mkDerivation rec { pname = "strace"; - version = "5.18"; + version = "5.19"; src = fetchurl { url = "https://strace.io/files/${version}/${pname}-${version}.tar.xz"; - sha256 = "sha256-YCk+p5rJJT1gDNyb4HetKYjKIihKQ5yeZr5RUNs9EYc="; + sha256 = "sha256-qj3ByOYOT2/z05ZRSqJH88e/cZ2KjcTdT6eTvnhr7KM="; }; depsBuildBuild = [ buildPackages.stdenv.cc ]; @@ -18,6 +18,13 @@ stdenv.mkDerivation rec { configureFlags = [ "--enable-mpers=check" ]; + passthru.updateScript = gitUpdater { + inherit pname version; + # No nicer place to find latest release. + url = "https://github.com/strace/strace.git"; + rev-prefix = "v"; + }; + meta = with lib; { homepage = "https://strace.io/"; description = "A system call tracer for Linux"; From 363b6a1ee45bc0461386d4a7bf30e1de7722d756 Mon Sep 17 00:00:00 2001 From: tpdcl <77207249+tpdcl@users.noreply.github.com> Date: Mon, 15 Aug 2022 18:41:49 +0300 Subject: [PATCH 12/15] FAHClient: 7.6.13 -> 7.6.21 (#186780) --- pkgs/applications/science/misc/foldingathome/client.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/science/misc/foldingathome/client.nix b/pkgs/applications/science/misc/foldingathome/client.nix index cc3d5445b594..4aa92b278cc4 100644 --- a/pkgs/applications/science/misc/foldingathome/client.nix +++ b/pkgs/applications/science/misc/foldingathome/client.nix @@ -10,7 +10,7 @@ }: let majMin = lib.versions.majorMinor version; - version = "7.6.13"; + version = "7.6.21"; fahclient = stdenv.mkDerivation rec { inherit version; @@ -18,7 +18,7 @@ let src = fetchurl { url = "https://download.foldingathome.org/releases/public/release/fahclient/debian-stable-64bit/v${majMin}/fahclient_${version}_amd64.deb"; - sha256 = "1j2cnsyassvifp6ymwd9kxwqw09hks24834gf7nljfncyy9g4g0i"; + sha256 = "2827f05f1c311ee6c7eca294e4ffb856c81957e8f5bfc3113a0ed27bb463b094"; }; nativeBuildInputs = [ From 15edd9ac4adf5f046cf99d3b9440e362d91fa4dd Mon Sep 17 00:00:00 2001 From: superherointj <5861043+superherointj@users.noreply.github.com> Date: Thu, 11 Aug 2022 09:43:27 -0300 Subject: [PATCH 13/15] gamescope: rename libseat to seatd (cherry picked from commit 8dd1594d04bd0e208241ce44c78109f3b2a10cb1) --- pkgs/applications/window-managers/gamescope/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/window-managers/gamescope/default.nix b/pkgs/applications/window-managers/gamescope/default.nix index 2d271893b842..237a33d5ca3e 100644 --- a/pkgs/applications/window-managers/gamescope/default.nix +++ b/pkgs/applications/window-managers/gamescope/default.nix @@ -15,7 +15,7 @@ , udev , pixman , libinput -, libseat +, seatd , xwayland , glslang , stb @@ -65,7 +65,7 @@ stdenv.mkDerivation { wayland-protocols wlroots xwayland - libseat + seatd libinput libxkbcommon udev From 0df91aa122f4cb1543b7db598a83daddc39d5e95 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Mon, 18 Jul 2022 03:57:37 -0700 Subject: [PATCH 14/15] mangohud: Build mangoapp and mangohudctl for gamescope integration (cherry picked from commit 3705020d970627dbb3fc312cf834e2277973bfd6) --- pkgs/tools/graphics/mangohud/default.nix | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pkgs/tools/graphics/mangohud/default.nix b/pkgs/tools/graphics/mangohud/default.nix index 80d7c1e9d08a..26c1b99216c6 100644 --- a/pkgs/tools/graphics/mangohud/default.nix +++ b/pkgs/tools/graphics/mangohud/default.nix @@ -26,7 +26,12 @@ , libXNVCtrl , wayland , spdlog +, glew +, glfw +, nlohmann_json +, xorg , addOpenGLRunpath +, gamescopeSupport ? true # build mangoapp and mangohudctl }: let @@ -102,6 +107,10 @@ in stdenv.mkDerivation rec { "-Dvulkan_datadir=${vulkan-headers}/share" "-Dwith_wayland=enabled" "-Duse_system_spdlog=enabled" + ] ++ lib.optionals gamescopeSupport [ + "-Dmangoapp_layer=true" + "-Dmangoapp=true" + "-Dmangohudctl=true" ]; nativeBuildInputs = [ @@ -122,6 +131,12 @@ in stdenv.mkDerivation rec { libXNVCtrl wayland spdlog + ] ++ lib.optionals gamescopeSupport [ + glew + glfw + nlohmann_json + vulkan-headers + xorg.libXrandr ]; # Support 32bit Vulkan applications by linking in 32bit Vulkan layer @@ -137,6 +152,12 @@ in stdenv.mkDerivation rec { wrapProgram "$out/bin/mangohud" \ --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ addOpenGLRunpath.driverLink ]} \ --prefix XDG_DATA_DIRS : "$out/share" + '' + lib.optionalString (gamescopeSupport) '' + if [[ -e "$out/bin/mangoapp" ]]; then + wrapProgram "$out/bin/mangoapp" \ + --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ addOpenGLRunpath.driverLink ]} \ + --prefix XDG_DATA_DIRS : "$out/share" + fi ''; meta = with lib; { From 0740bdaa9f939fb88e42ad2ded06fe0f03ed7d27 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Wed, 3 Aug 2022 09:11:51 -0400 Subject: [PATCH 15/15] mangohud: statically link spdlog Works around bug in pressure-vessel where it wasn't including necessary vulkan layer dependencies defined through DT_RUNPATH in the sandbox. https://github.com/ValveSoftware/steam-runtime/issues/511 (cherry picked from commit 2d6481a4fd35069c271bbb2967a4c59989b010fc) --- pkgs/tools/graphics/mangohud/default.nix | 32 +++++++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/graphics/mangohud/default.nix b/pkgs/tools/graphics/mangohud/default.nix index 26c1b99216c6..7202f9f8b562 100644 --- a/pkgs/tools/graphics/mangohud/default.nix +++ b/pkgs/tools/graphics/mangohud/default.nix @@ -25,7 +25,6 @@ , vulkan-loader , libXNVCtrl , wayland -, spdlog , glew , glfw , nlohmann_json @@ -49,6 +48,27 @@ let sha256 = "sha256-bQC0QmkLalxdj4mDEdqvvOFtNwz2T1MpTDuMXGYeQ18="; }; }; + + # Derived from subprojects/spdlog.wrap + # + # NOTE: We only statically link spdlog due to a bug in pressure-vessel: + # https://github.com/ValveSoftware/steam-runtime/issues/511 + # + # Once this fix is released upstream, we should switch back to using + # the system provided spdlog + spdlog = rec { + version = "1.8.5"; + src = fetchFromGitHub { + owner = "gabime"; + repo = "spdlog"; + rev = "refs/tags/v${version}"; + sha256 = "sha256-D29jvDZQhPscaOHlrzGN1s7/mXlcsovjbqYpXd7OM50="; + }; + patch = fetchurl { + url = "https://wrapdb.mesonbuild.com/v2/spdlog_${version}-1/get_patch"; + sha256 = "sha256-PDjyddV5KxKGORECWUMp6YsXc3kks0T5gxKrCZKbdL4="; + }; + }; in stdenv.mkDerivation rec { pname = "mangohud"; version = "0.6.8"; @@ -67,7 +87,7 @@ in stdenv.mkDerivation rec { postUnpack = ''( cd "$sourceRoot/subprojects" cp -R --no-preserve=mode,ownership ${imgui.src} imgui-${imgui.version} - unzip ${imgui.patch} + cp -R --no-preserve=mode,ownership ${spdlog.src} spdlog-${spdlog.version} )''; patches = [ @@ -102,11 +122,16 @@ in stdenv.mkDerivation rec { }) ]; + postPatch = ''( + cd subprojects + unzip ${imgui.patch} + unzip ${spdlog.patch} + )''; + mesonFlags = [ "-Duse_system_vulkan=enabled" "-Dvulkan_datadir=${vulkan-headers}/share" "-Dwith_wayland=enabled" - "-Duse_system_spdlog=enabled" ] ++ lib.optionals gamescopeSupport [ "-Dmangoapp_layer=true" "-Dmangoapp=true" @@ -130,7 +155,6 @@ in stdenv.mkDerivation rec { libX11 libXNVCtrl wayland - spdlog ] ++ lib.optionals gamescopeSupport [ glew glfw