electron-bin: place electron files in libexec/
This commit is contained in:
parent
f43d1572ec
commit
5d7c754943
8 changed files with 14 additions and 17 deletions
|
@ -56,7 +56,7 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
yarn --offline run electron-builder --dir \
|
yarn --offline run electron-builder --dir \
|
||||||
--config electron-builder-linux-mac.json \
|
--config electron-builder-linux-mac.json \
|
||||||
-c.electronDist=${electron}/lib/electron \
|
-c.electronDist=${electron}/libexec/electron \
|
||||||
-c.electronVersion=${electron.version}
|
-c.electronVersion=${electron.version}
|
||||||
|
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
|
|
|
@ -38,7 +38,7 @@ mkYarnPackage rec {
|
||||||
|
|
||||||
yarn --offline run electron-builder \
|
yarn --offline run electron-builder \
|
||||||
--dir \
|
--dir \
|
||||||
-c.electronDist=${electron}/lib/electron \
|
-c.electronDist=${electron}/libexec/electron \
|
||||||
-c.electronVersion=${electron.version}
|
-c.electronVersion=${electron.version}
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
|
@ -50,7 +50,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
|
|
||||||
yarn --offline electron-builder \
|
yarn --offline electron-builder \
|
||||||
--dir ${if stdenv.isDarwin then "--macos" else "--linux"} ${if stdenv.hostPlatform.isAarch64 then "--arm64" else "--x64"} \
|
--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}
|
-c.electronVersion=${electron.version}
|
||||||
|
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
|
|
|
@ -73,7 +73,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
yarn --offline run build
|
yarn --offline run build
|
||||||
yarn --offline run electron-builder --dir \
|
yarn --offline run electron-builder --dir \
|
||||||
--config .electron-builder.config.cjs \
|
--config .electron-builder.config.cjs \
|
||||||
-c.electronDist=${electron}/lib/electron \
|
-c.electronDist=${electron}/libexec/electron \
|
||||||
-c.electronVersion=${electron.version}
|
-c.electronVersion=${electron.version}
|
||||||
|
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
|
|
|
@ -61,7 +61,7 @@ let
|
||||||
patchShebangs node_modules
|
patchShebangs node_modules
|
||||||
|
|
||||||
mkdir -p ~/.cache/electron/${electronDummyHash}
|
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"
|
chmod -R u+w "$TMPDIR/electron"
|
||||||
(cd "$TMPDIR/electron" && zip -0Xr ~/.cache/electron/${electronDummyHash}/${electronDummyFilename} .)
|
(cd "$TMPDIR/electron" && zip -0Xr ~/.cache/electron/${electronDummyHash}/${electronDummyFilename} .)
|
||||||
|
|
||||||
|
|
|
@ -82,25 +82,22 @@ let
|
||||||
wrapGAppsHook
|
wrapGAppsHook
|
||||||
];
|
];
|
||||||
|
|
||||||
dontWrapGApps = true; # electron is in lib, we need to wrap it manually
|
|
||||||
|
|
||||||
dontUnpack = true;
|
dontUnpack = true;
|
||||||
dontBuild = true;
|
dontBuild = true;
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/lib/electron $out/bin
|
mkdir -p $out/libexec/electron $out/bin
|
||||||
unzip -d $out/lib/electron $src
|
unzip -d $out/libexec/electron $src
|
||||||
ln -s $out/lib/electron/electron $out/bin
|
ln -s $out/libexec/electron/electron $out/bin
|
||||||
|
chmod u-x $out/libexec/electron/*.so*
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postFixup = ''
|
postFixup = ''
|
||||||
patchelf \
|
patchelf \
|
||||||
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
||||||
--set-rpath "${atomEnv.libPath}:${electronLibPath}:$out/lib/electron" \
|
--set-rpath "${atomEnv.libPath}:${electronLibPath}:$out/libexec/electron" \
|
||||||
$out/lib/electron/electron \
|
$out/libexec/electron/.electron-wrapped \
|
||||||
${lib.optionalString (lib.versionAtLeast version "15.0.0") "$out/lib/electron/chrome_crashpad_handler" }
|
${lib.optionalString (lib.versionAtLeast version "15.0.0") "$out/libexec/electron/.chrome_crashpad_handler-wrapped" }
|
||||||
|
|
||||||
wrapProgram $out/lib/electron/electron "''${gappsWrapperArgs[@]}"
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
|
|
||||||
yarn --offline electron-builder \
|
yarn --offline electron-builder \
|
||||||
--dir ${if stdenv.isDarwin then "--macos" else "--linux"} ${if stdenv.hostPlatform.isAarch64 then "--arm64" else "--x64"} \
|
--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}
|
-c.electronVersion=${electron.version}
|
||||||
|
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
|
|
|
@ -122,7 +122,7 @@ buildNpmPackage' {
|
||||||
|
|
||||||
npm exec electron-builder -- \
|
npm exec electron-builder -- \
|
||||||
--dir \
|
--dir \
|
||||||
-c.electronDist=${electron}/lib/electron \
|
-c.electronDist=${electron}/libexec/electron \
|
||||||
-c.electronVersion=${electron.version}
|
-c.electronVersion=${electron.version}
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
Loading…
Reference in a new issue