From 49e2fb7aaefe9f37c86d46d9e1c56edde3f4e2cc Mon Sep 17 00:00:00 2001 From: huantian Date: Sat, 1 Jul 2023 13:50:25 -0700 Subject: [PATCH 1/2] webcord: 4.2.0 -> 4.3.0, add updateScript --- .../instant-messengers/webcord/default.nix | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/webcord/default.nix b/pkgs/applications/networking/instant-messengers/webcord/default.nix index 67e99f540b1d..00361a7e368a 100644 --- a/pkgs/applications/networking/instant-messengers/webcord/default.nix +++ b/pkgs/applications/networking/instant-messengers/webcord/default.nix @@ -1,18 +1,28 @@ -{ lib, stdenv, buildNpmPackage, fetchFromGitHub, copyDesktopItems -, python3, pipewire, libpulseaudio, xdg-utils, electron_24, makeDesktopItem }: +{ lib +, buildNpmPackage +, fetchFromGitHub +, copyDesktopItems +, python3 +, pipewire +, libpulseaudio +, xdg-utils +, electron_25 +, makeDesktopItem +, nix-update-script +}: buildNpmPackage rec { pname = "webcord"; - version = "4.2.0"; + version = "4.3.0"; src = fetchFromGitHub { owner = "SpacingBat3"; repo = "WebCord"; rev = "v${version}"; - sha256 = "sha256-530iWNvehImwSYt5HnZaqa4TAslrwxAOZi3gRm1K2/w="; + hash = "sha256-E/WXAVSCNTDEDaz71LXOHUf/APFO2uSpkTRhlZfQp0E="; }; - npmDepsHash = "sha256-YguZtGn8CT4EqOQWS0GeNGBdZSC3Lj1gFR0ZiegWTJU="; + npmDepsHash = "sha256-vGaYjM13seVmRbVPyDIM+qhGTCj6rw/el6Dq3KMzDks="; nativeBuildInputs = [ copyDesktopItems @@ -46,7 +56,7 @@ buildNpmPackage rec { install -Dm644 sources/assets/icons/app.png $out/share/icons/hicolor/256x256/apps/webcord.png # Add xdg-utils to path via suffix, per PR #181171 - makeWrapper '${electron_24}/bin/electron' $out/bin/webcord \ + makeWrapper '${electron_25}/bin/electron' $out/bin/webcord \ --prefix LD_LIBRARY_PATH : ${libPath}:$out/opt/webcord \ --suffix PATH : "${lib.makeBinPath [ xdg-utils ]}" \ --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland}}" \ @@ -66,6 +76,8 @@ buildNpmPackage rec { }) ]; + passthru.updateScript = nix-update-script { }; + meta = with lib; { description = "A Discord and Fosscord electron-based client implemented without Discord API"; homepage = "https://github.com/SpacingBat3/WebCord"; @@ -73,6 +85,6 @@ buildNpmPackage rec { changelog = "https://github.com/SpacingBat3/WebCord/releases/tag/v${version}"; license = licenses.mit; maintainers = with maintainers; [ huantian ]; - platforms = electron_24.meta.platforms; + platforms = electron_25.meta.platforms; }; } From d08c422dfb907036a9c2ab3dd5845ae0b12d2c92 Mon Sep 17 00:00:00 2001 From: huantian Date: Mon, 3 Jul 2023 20:33:53 -0700 Subject: [PATCH 2/2] webcord-vencord: override electron to use electron_24 Webcord has updated to electron 25, but that causes a segfault when launching webcord-vencord on wayland, so downgrade it for now. Co-authored-by: FlafyDev --- .../webcord/webcord-vencord/default.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/webcord/webcord-vencord/default.nix b/pkgs/applications/networking/instant-messengers/webcord/webcord-vencord/default.nix index 1bac19630fc0..d55af49f1154 100644 --- a/pkgs/applications/networking/instant-messengers/webcord/webcord-vencord/default.nix +++ b/pkgs/applications/networking/instant-messengers/webcord/webcord-vencord/default.nix @@ -2,8 +2,10 @@ , substituteAll , lib , vencord-web-extension +, electron_24 }: -webcord.overrideAttrs (old: { + +(webcord.overrideAttrs (old: { patches = (old.patches or [ ]) ++ [ (substituteAll { src = ./add-extension.patch; @@ -15,4 +17,8 @@ webcord.overrideAttrs (old: { description = "Webcord with Vencord web extension"; maintainers = with maintainers; [ FlafyDev NotAShelf ]; }; -}) +})).override { + # Webcord has updated to electron 25, but that causes a segfault + # when launching webcord-vencord on wayland, so downgrade it for now. + electron_25 = electron_24; +}