From 3670ca87be9d68056b23456a621535649d9cc6ab Mon Sep 17 00:00:00 2001 From: emilylange Date: Thu, 20 Feb 2025 17:04:17 +0100 Subject: [PATCH 1/2] electron-bin: remove no longer needed version conditionals --- .../tools/electron/binary/generic.nix | 108 ++++++++---------- 1 file changed, 46 insertions(+), 62 deletions(-) diff --git a/pkgs/development/tools/electron/binary/generic.nix b/pkgs/development/tools/electron/binary/generic.nix index 6864efed6579..e42d819be768 100644 --- a/pkgs/development/tools/electron/binary/generic.nix +++ b/pkgs/development/tools/electron/binary/generic.nix @@ -1,7 +1,6 @@ { lib, stdenv, - libXScrnSaver, makeWrapper, fetchurl, wrapGAppsHook3, @@ -42,15 +41,13 @@ let yayayayaka teutat3s ]; - platforms = - [ - "x86_64-darwin" - "x86_64-linux" - "armv7l-linux" - "aarch64-linux" - ] - ++ optionals (versionAtLeast version "11.0.0") [ "aarch64-darwin" ] - ++ optionals (versionOlder version "19.0.0") [ "i686-linux" ]; + platforms = [ + "x86_64-darwin" + "x86_64-linux" + "armv7l-linux" + "aarch64-linux" + "aarch64-darwin" + ]; sourceProvenance = with sourceTypes; [ binaryNativeCode ]; # https://www.electronjs.org/docs/latest/tutorial/electron-timelines knownVulnerabilities = optional (versionOlder version "32.0.0") "Electron version ${version} is EOL"; @@ -70,19 +67,13 @@ let sha256 = hash; }; - tags = - { - x86_64-linux = "linux-x64"; - armv7l-linux = "linux-armv7l"; - aarch64-linux = "linux-arm64"; - x86_64-darwin = "darwin-x64"; - } - // lib.optionalAttrs (lib.versionAtLeast version "11.0.0") { - aarch64-darwin = "darwin-arm64"; - } - // lib.optionalAttrs (lib.versionOlder version "19.0.0") { - i686-linux = "linux-ia32"; - }; + tags = { + x86_64-linux = "linux-x64"; + armv7l-linux = "linux-armv7l"; + aarch64-linux = "linux-arm64"; + x86_64-darwin = "darwin-x64"; + aarch64-darwin = "darwin-arm64"; + }; get = as: platform: as.${platform.system} or (throw "Unsupported system: ${platform.system}"); @@ -92,44 +83,37 @@ let passthru.headers = headersFetcher version hashes.headers; }; - electronLibPath = lib.makeLibraryPath ( - [ - alsa-lib - at-spi2-atk - cairo - cups - dbus - expat - gdk-pixbuf - glib - gtk3 - nss - nspr - xorg.libX11 - xorg.libxcb - xorg.libXcomposite - xorg.libXdamage - xorg.libXext - xorg.libXfixes - xorg.libXrandr - xorg.libxkbfile - pango - pciutils - stdenv.cc.cc - systemd - ] - ++ lib.optionals (lib.versionAtLeast version "9.0.0") [ - libdrm - libgbm - ] - ++ lib.optionals (lib.versionOlder version "10.0.0") [ libXScrnSaver ] - ++ lib.optionals (lib.versionAtLeast version "11.0.0") [ libxkbcommon ] - ++ lib.optionals (lib.versionAtLeast version "12.0.0") [ libxshmfence ] - ++ lib.optionals (lib.versionAtLeast version "17.0.0") [ - libGL - vulkan-loader - ] - ); + electronLibPath = lib.makeLibraryPath [ + alsa-lib + at-spi2-atk + cairo + cups + dbus + expat + gdk-pixbuf + glib + gtk3 + nss + nspr + xorg.libX11 + xorg.libxcb + xorg.libXcomposite + xorg.libXdamage + xorg.libXext + xorg.libXfixes + xorg.libXrandr + xorg.libxkbfile + pango + pciutils + stdenv.cc.cc + systemd + libdrm + libgbm + libxkbcommon + libxshmfence + libGL + vulkan-loader + ]; # Fix read out of range on aarch64 16k pages builds # https://github.com/NixOS/nixpkgs/pull/365364 @@ -178,7 +162,7 @@ let --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ --set-rpath "${electronLibPath}:$out/libexec/electron" \ $out/libexec/electron/.electron-wrapped \ - ${lib.optionalString (lib.versionAtLeast version "15.0.0") "$out/libexec/electron/.chrome_crashpad_handler-wrapped"} + $out/libexec/electron/.chrome_crashpad_handler-wrapped # patch libANGLE patchelf \ From f17378b5064789c524b635ed25988f59dc1cf24c Mon Sep 17 00:00:00 2001 From: emilylange Date: Thu, 20 Feb 2025 17:56:23 +0100 Subject: [PATCH 2/2] electron-bin: copy over fixes from electron-source Ref: 461a23c756c31f0925159601e46b16072f9f8920 Ref: 044343966568b5a7ba61a84c61098521bb2c835a Ref: 6a0cf40cf4f06538bee3d040f2101348e1f8526f Ref: 280c094f629d24742cac23039ba8e5ded901e786 Ref: 92a452733de4e8b4457aeba14fd9dae67411ca57 Ref: 8e7a0982431b8ad99070695221bdb2d317e08030 Ref: 99515b5c5071b358062a382d8b455633e7bfc76d --- pkgs/development/tools/electron/binary/generic.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/development/tools/electron/binary/generic.nix b/pkgs/development/tools/electron/binary/generic.nix index e42d819be768..792ad818a20c 100644 --- a/pkgs/development/tools/electron/binary/generic.nix +++ b/pkgs/development/tools/electron/binary/generic.nix @@ -6,6 +6,7 @@ wrapGAppsHook3, glib, gtk3, + gtk4, unzip, at-spi2-atk, libdrm, @@ -26,6 +27,11 @@ pango, systemd, pciutils, + libnotify, + pipewire, + libsecret, + libpulseaudio, + speechd-minimal, }: version: hashes: @@ -93,6 +99,7 @@ let gdk-pixbuf glib gtk3 + gtk4 nss nspr xorg.libX11 @@ -107,6 +114,11 @@ let pciutils stdenv.cc.cc systemd + libnotify + pipewire + libsecret + libpulseaudio + speechd-minimal libdrm libgbm libxkbcommon @@ -126,6 +138,7 @@ let buildInputs = [ glib gtk3 + gtk4 ]; nativeBuildInputs = [