From 5d7c754943c8e28dc631748128906161b62f4e96 Mon Sep 17 00:00:00 2001 From: Yureka Date: Sun, 30 Jul 2023 21:42:50 +0200 Subject: [PATCH 1/2] electron-bin: place electron files in libexec/ --- pkgs/applications/graphics/drawio/default.nix | 2 +- pkgs/applications/misc/kuro/default.nix | 2 +- .../teams-for-linux/default.nix | 2 +- .../virtualization/podman-desktop/default.nix | 2 +- .../tools/electron-fiddle/default.nix | 2 +- .../tools/electron/binary/generic.nix | 17 +++++++---------- pkgs/development/tools/redisinsight/default.nix | 2 +- pkgs/tools/security/bitwarden/default.nix | 2 +- 8 files changed, 14 insertions(+), 17 deletions(-) diff --git a/pkgs/applications/graphics/drawio/default.nix b/pkgs/applications/graphics/drawio/default.nix index 94ed3d87ba8..9c69a4bebff 100644 --- a/pkgs/applications/graphics/drawio/default.nix +++ b/pkgs/applications/graphics/drawio/default.nix @@ -56,7 +56,7 @@ stdenv.mkDerivation rec { yarn --offline run electron-builder --dir \ --config electron-builder-linux-mac.json \ - -c.electronDist=${electron}/lib/electron \ + -c.electronDist=${electron}/libexec/electron \ -c.electronVersion=${electron.version} runHook postBuild diff --git a/pkgs/applications/misc/kuro/default.nix b/pkgs/applications/misc/kuro/default.nix index 26c8d6bbf11..50a773b5c51 100644 --- a/pkgs/applications/misc/kuro/default.nix +++ b/pkgs/applications/misc/kuro/default.nix @@ -38,7 +38,7 @@ mkYarnPackage rec { yarn --offline run electron-builder \ --dir \ - -c.electronDist=${electron}/lib/electron \ + -c.electronDist=${electron}/libexec/electron \ -c.electronVersion=${electron.version} popd diff --git a/pkgs/applications/networking/instant-messengers/teams-for-linux/default.nix b/pkgs/applications/networking/instant-messengers/teams-for-linux/default.nix index ec318aa3e18..c0697612381 100644 --- a/pkgs/applications/networking/instant-messengers/teams-for-linux/default.nix +++ b/pkgs/applications/networking/instant-messengers/teams-for-linux/default.nix @@ -50,7 +50,7 @@ stdenv.mkDerivation (finalAttrs: { yarn --offline electron-builder \ --dir ${if stdenv.isDarwin then "--macos" else "--linux"} ${if stdenv.hostPlatform.isAarch64 then "--arm64" else "--x64"} \ - -c.electronDist=${electron}/lib/electron \ + -c.electronDist=${electron}/libexec/electron \ -c.electronVersion=${electron.version} runHook postBuild diff --git a/pkgs/applications/virtualization/podman-desktop/default.nix b/pkgs/applications/virtualization/podman-desktop/default.nix index 30dd54ba85c..412db059eac 100644 --- a/pkgs/applications/virtualization/podman-desktop/default.nix +++ b/pkgs/applications/virtualization/podman-desktop/default.nix @@ -73,7 +73,7 @@ stdenv.mkDerivation (finalAttrs: { yarn --offline run build yarn --offline run electron-builder --dir \ --config .electron-builder.config.cjs \ - -c.electronDist=${electron}/lib/electron \ + -c.electronDist=${electron}/libexec/electron \ -c.electronVersion=${electron.version} runHook postBuild diff --git a/pkgs/development/tools/electron-fiddle/default.nix b/pkgs/development/tools/electron-fiddle/default.nix index eb4874750fa..5fe0a88f252 100644 --- a/pkgs/development/tools/electron-fiddle/default.nix +++ b/pkgs/development/tools/electron-fiddle/default.nix @@ -61,7 +61,7 @@ let patchShebangs node_modules mkdir -p ~/.cache/electron/${electronDummyHash} - cp -ra '${electron}/lib/electron' "$TMPDIR/electron" + cp -ra '${electron}/libexec/electron' "$TMPDIR/electron" chmod -R u+w "$TMPDIR/electron" (cd "$TMPDIR/electron" && zip -0Xr ~/.cache/electron/${electronDummyHash}/${electronDummyFilename} .) diff --git a/pkgs/development/tools/electron/binary/generic.nix b/pkgs/development/tools/electron/binary/generic.nix index 34b7f239ecf..615ec9243bb 100644 --- a/pkgs/development/tools/electron/binary/generic.nix +++ b/pkgs/development/tools/electron/binary/generic.nix @@ -82,25 +82,22 @@ let wrapGAppsHook ]; - dontWrapGApps = true; # electron is in lib, we need to wrap it manually - dontUnpack = true; dontBuild = true; installPhase = '' - mkdir -p $out/lib/electron $out/bin - unzip -d $out/lib/electron $src - ln -s $out/lib/electron/electron $out/bin + mkdir -p $out/libexec/electron $out/bin + unzip -d $out/libexec/electron $src + ln -s $out/libexec/electron/electron $out/bin + chmod u-x $out/libexec/electron/*.so* ''; postFixup = '' patchelf \ --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ - --set-rpath "${atomEnv.libPath}:${electronLibPath}:$out/lib/electron" \ - $out/lib/electron/electron \ - ${lib.optionalString (lib.versionAtLeast version "15.0.0") "$out/lib/electron/chrome_crashpad_handler" } - - wrapProgram $out/lib/electron/electron "''${gappsWrapperArgs[@]}" + --set-rpath "${atomEnv.libPath}:${electronLibPath}:$out/libexec/electron" \ + $out/libexec/electron/.electron-wrapped \ + ${lib.optionalString (lib.versionAtLeast version "15.0.0") "$out/libexec/electron/.chrome_crashpad_handler-wrapped" } ''; }; diff --git a/pkgs/development/tools/redisinsight/default.nix b/pkgs/development/tools/redisinsight/default.nix index bb96df683e2..5c4609e248d 100644 --- a/pkgs/development/tools/redisinsight/default.nix +++ b/pkgs/development/tools/redisinsight/default.nix @@ -99,7 +99,7 @@ stdenv.mkDerivation (finalAttrs: { yarn --offline electron-builder \ --dir ${if stdenv.isDarwin then "--macos" else "--linux"} ${if stdenv.hostPlatform.isAarch64 then "--arm64" else "--x64"} \ - -c.electronDist=${electron}/lib/electron \ + -c.electronDist=${electron}/libexec/electron \ -c.electronVersion=${electron.version} runHook postBuild diff --git a/pkgs/tools/security/bitwarden/default.nix b/pkgs/tools/security/bitwarden/default.nix index a9b902f80d3..b962b06e48c 100644 --- a/pkgs/tools/security/bitwarden/default.nix +++ b/pkgs/tools/security/bitwarden/default.nix @@ -122,7 +122,7 @@ buildNpmPackage' { npm exec electron-builder -- \ --dir \ - -c.electronDist=${electron}/lib/electron \ + -c.electronDist=${electron}/libexec/electron \ -c.electronVersion=${electron.version} popd From 0ec0e829a52fd2d9693e021faa078f054fbdc5bc Mon Sep 17 00:00:00 2001 From: Yureka Date: Sun, 10 Sep 2023 14:05:07 +0200 Subject: [PATCH 2/2] rl-2311: add note about electron path change --- nixos/doc/manual/release-notes/rl-2311.section.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/doc/manual/release-notes/rl-2311.section.md b/nixos/doc/manual/release-notes/rl-2311.section.md index 921fe3c5cb7..b7cbe4b1323 100644 --- a/nixos/doc/manual/release-notes/rl-2311.section.md +++ b/nixos/doc/manual/release-notes/rl-2311.section.md @@ -290,3 +290,5 @@ The module update takes care of the new config syntax and the data itself (user ./common/auto-format-root-device.nix ];` When you use the systemd initrd, you can automatically format the root device by setting `virtualisation.fileSystems."/".autoFormat = true;`. + +- The `electron` packages now places its application files in `$out/libexec/electron` instead of `$out/lib/electron`. Packages using electron-builder will fail to build and need to be adjusted by changing `lib` to `libexec`.