Skip to content

Commit 2cbcb08

Browse files
authored
element-desktop.keytar: build against electron's node headers (#384979)
fixes crash on startup of element-desktop
1 parent bd016c6 commit 2cbcb08

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

pkgs/by-name/el/element-desktop/keytar/default.nix

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,18 @@
1010
xcbuild,
1111
fetchNpmDeps,
1212
npmHooks,
13+
electron,
14+
runCommand,
1315
}:
1416

1517
let
1618
pinData = lib.importJSON ./pin.json;
1719

20+
electron-headers = runCommand "electron-headers" { } ''
21+
mkdir -p $out
22+
tar -C $out --strip-components=1 -xvf ${electron.headers}
23+
'';
24+
1825
in
1926
stdenv.mkDerivation rec {
2027
pname = "keytar";
@@ -48,8 +55,10 @@ stdenv.mkDerivation rec {
4855
export -f pkg-config
4956
'';
5057

51-
# https://nodejs.org/api/os.html#osarch
5258
npmFlags = [
59+
# Make sure the native modules are built against electron's ABI
60+
"--nodedir=${electron-headers}"
61+
# https://nodejs.org/api/os.html#osarch
5362
"--arch=${
5463
if stdenv.hostPlatform.parsed.cpu.name == "i686" then
5564
"ia32"

pkgs/by-name/el/element-desktop/package.nix

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ let
2323
pinData = import ./element-desktop-pin.nix;
2424
inherit (pinData.hashes) desktopSrcHash desktopYarnHash;
2525
executableName = "element-desktop";
26-
keytar = callPackage ./keytar { };
27-
seshat = callPackage ./seshat { };
2826
electron = electron_33;
27+
keytar = callPackage ./keytar {
28+
inherit electron;
29+
};
30+
seshat = callPackage ./seshat { };
2931
in
3032
stdenv.mkDerivation (
3133
finalAttrs:

0 commit comments

Comments
 (0)