From ee6873bdbb902ce9ccd8dfb6a43baaa8eacb910f Mon Sep 17 00:00:00 2001 From: ChaosAttractor Date: Tue, 5 Dec 2023 15:33:54 +0800 Subject: [PATCH 1/4] qq: 3.2.2-18394 -> 3.2.3-19189 --- .../networking/instant-messengers/qq/sources.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/qq/sources.nix b/pkgs/applications/networking/instant-messengers/qq/sources.nix index b3ea2b3fe820..93bb928c28f3 100644 --- a/pkgs/applications/networking/instant-messengers/qq/sources.nix +++ b/pkgs/applications/networking/instant-messengers/qq/sources.nix @@ -1,8 +1,8 @@ # Generated by ./update.sh - do not update manually! -# Last updated: 2023-11-14 +# Last updated: 2023-12-05 { - version = "3.2.2-18394"; - urlhash = "fd2e886e"; - arm64_hash = "sha256-6E3h7Z4936YKZb+G0FoMb90T3EzH8z07mmGMnL4SDFk="; - amd64_hash = "sha256-L1M8O0FzVKLXNNYGGMPf1Nbh/DFxLHBlbzapr7uz5Sk="; + version = "3.2.3-19189"; + urlhash = "06d558c3"; + arm64_hash = "sha256-qNcw6P985F/JAB9roxaBR5hz2KcLiffUDKu/14nvvgE="; + amd64_hash = "sha256-37d7F1VB2puEFJC12x57aRj4NIYcCYyPCK06Z/OwNiM="; } From 4abe534795daece815600969c867fd9521099329 Mon Sep 17 00:00:00 2001 From: ChaosAttractor Date: Tue, 5 Dec 2023 20:40:29 +0800 Subject: [PATCH 2/4] qq: use makewrapper instead of setting gappsWrapperArgs --- .../networking/instant-messengers/qq/default.nix | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/qq/default.nix b/pkgs/applications/networking/instant-messengers/qq/default.nix index af5cf167a62c..b372d708eb75 100644 --- a/pkgs/applications/networking/instant-messengers/qq/default.nix +++ b/pkgs/applications/networking/instant-messengers/qq/default.nix @@ -19,7 +19,6 @@ , at-spi2-core , autoPatchelfHook , wrapGAppsHook -, makeWrapper }: let @@ -43,8 +42,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ autoPatchelfHook - # makeBinaryWrapper not support shell wrapper specifically for `NIXOS_OZONE_WL`. - (wrapGAppsHook.override { inherit makeWrapper; }) + wrapGAppsHook dpkg ]; @@ -76,7 +74,9 @@ stdenv.mkDerivation { substituteInPlace $out/share/applications/qq.desktop \ --replace "/opt/QQ/qq" "$out/bin/qq" \ --replace "/usr/share" "$out/share" - ln -s $out/opt/QQ/qq $out/bin/qq + makeWrapper $out/opt/QQ/qq $out/bin/qq \ + --prefix PATH : "${lib.makeBinPath [ gjs ]}" \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" # Remove bundled libraries rm -r $out/opt/QQ/resources/app/sharp-lib @@ -91,13 +91,6 @@ stdenv.mkDerivation { runHook postInstall ''; - preFixup = '' - gappsWrapperArgs+=( - --prefix PATH : "${lib.makeBinPath [ gjs ]}" - --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" - ) - ''; - passthru.updateScript = ./update.sh; meta = with lib; { From 7e3940735af718435c7f34cbc1f0f9c0105e8159 Mon Sep 17 00:00:00 2001 From: ChaosAttractor Date: Tue, 5 Dec 2023 20:41:14 +0800 Subject: [PATCH 3/4] qq: add libGL to runtime path `libEGL.so.1` is missing. Electron is using it by dlopen. This causes electron fallback to software rendering in X11 and crash directly under wayland. Beacuse it's a unfree software from a debian package. the path to `libEGL.so.1` is hard-coded so we should just wrapping it. --- pkgs/applications/networking/instant-messengers/qq/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/applications/networking/instant-messengers/qq/default.nix b/pkgs/applications/networking/instant-messengers/qq/default.nix index b372d708eb75..ea7f6e53fc7d 100644 --- a/pkgs/applications/networking/instant-messengers/qq/default.nix +++ b/pkgs/applications/networking/instant-messengers/qq/default.nix @@ -11,6 +11,7 @@ , libgcrypt , libkrb5 , mesa # for libgbm +, libGL , nss , xorg , systemd @@ -75,6 +76,7 @@ stdenv.mkDerivation { --replace "/opt/QQ/qq" "$out/bin/qq" \ --replace "/usr/share" "$out/share" makeWrapper $out/opt/QQ/qq $out/bin/qq \ + --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libGL ]}" \ --prefix PATH : "${lib.makeBinPath [ gjs ]}" \ --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" From f7034a98456e8dca2b57a653afef35c4c1df652a Mon Sep 17 00:00:00 2001 From: ChaosAttractor Date: Wed, 6 Dec 2023 15:51:10 +0800 Subject: [PATCH 4/4] qq: remove `gjs`, because qq does not depend on it at all --- pkgs/applications/networking/instant-messengers/qq/default.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/qq/default.nix b/pkgs/applications/networking/instant-messengers/qq/default.nix index ea7f6e53fc7d..e90526c0a6aa 100644 --- a/pkgs/applications/networking/instant-messengers/qq/default.nix +++ b/pkgs/applications/networking/instant-messengers/qq/default.nix @@ -2,7 +2,6 @@ , cups , dpkg , fetchurl -, gjs , glib , gtk3 , lib @@ -77,7 +76,6 @@ stdenv.mkDerivation { --replace "/usr/share" "$out/share" makeWrapper $out/opt/QQ/qq $out/bin/qq \ --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libGL ]}" \ - --prefix PATH : "${lib.makeBinPath [ gjs ]}" \ --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" # Remove bundled libraries