element-desktop.keytar: build against electron's node headers (#384979)
fixes crash on startup of element-desktop
This commit is contained in:
@@ -10,11 +10,18 @@
|
||||
xcbuild,
|
||||
fetchNpmDeps,
|
||||
npmHooks,
|
||||
electron,
|
||||
runCommand,
|
||||
}:
|
||||
|
||||
let
|
||||
pinData = lib.importJSON ./pin.json;
|
||||
|
||||
electron-headers = runCommand "electron-headers" { } ''
|
||||
mkdir -p $out
|
||||
tar -C $out --strip-components=1 -xvf ${electron.headers}
|
||||
'';
|
||||
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "keytar";
|
||||
@@ -48,8 +55,10 @@ stdenv.mkDerivation rec {
|
||||
export -f pkg-config
|
||||
'';
|
||||
|
||||
# https://nodejs.org/api/os.html#osarch
|
||||
npmFlags = [
|
||||
# Make sure the native modules are built against electron's ABI
|
||||
"--nodedir=${electron-headers}"
|
||||
# https://nodejs.org/api/os.html#osarch
|
||||
"--arch=${
|
||||
if stdenv.hostPlatform.parsed.cpu.name == "i686" then
|
||||
"ia32"
|
||||
|
||||
@@ -23,9 +23,11 @@ let
|
||||
pinData = import ./element-desktop-pin.nix;
|
||||
inherit (pinData.hashes) desktopSrcHash desktopYarnHash;
|
||||
executableName = "element-desktop";
|
||||
keytar = callPackage ./keytar { };
|
||||
seshat = callPackage ./seshat { };
|
||||
electron = electron_33;
|
||||
keytar = callPackage ./keytar {
|
||||
inherit electron;
|
||||
};
|
||||
seshat = callPackage ./seshat { };
|
||||
in
|
||||
stdenv.mkDerivation (
|
||||
finalAttrs:
|
||||
|
||||
Reference in New Issue
Block a user