diff --git a/pkgs/development/tools/electron/binary/generic.nix b/pkgs/development/tools/electron/binary/generic.nix index 6864efed6579..792ad818a20c 100644 --- a/pkgs/development/tools/electron/binary/generic.nix +++ b/pkgs/development/tools/electron/binary/generic.nix @@ -1,12 +1,12 @@ { lib, stdenv, - libXScrnSaver, makeWrapper, fetchurl, wrapGAppsHook3, glib, gtk3, + gtk4, unzip, at-spi2-atk, libdrm, @@ -27,6 +27,11 @@ pango, systemd, pciutils, + libnotify, + pipewire, + libsecret, + libpulseaudio, + speechd-minimal, }: version: hashes: @@ -42,15 +47,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 +73,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 +89,43 @@ 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 + gtk4 + nss + nspr + xorg.libX11 + xorg.libxcb + xorg.libXcomposite + xorg.libXdamage + xorg.libXext + xorg.libXfixes + xorg.libXrandr + xorg.libxkbfile + pango + pciutils + stdenv.cc.cc + systemd + libnotify + pipewire + libsecret + libpulseaudio + speechd-minimal + libdrm + libgbm + libxkbcommon + libxshmfence + libGL + vulkan-loader + ]; # Fix read out of range on aarch64 16k pages builds # https://github.com/NixOS/nixpkgs/pull/365364 @@ -142,6 +138,7 @@ let buildInputs = [ glib gtk3 + gtk4 ]; nativeBuildInputs = [ @@ -178,7 +175,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 \