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 \
|
||||
--config electron-builder-linux-mac.json \
|
||||
-c.electronDist=${electron}/lib/electron \
|
||||
-c.electronDist=${electron}/libexec/electron \
|
||||
-c.electronVersion=${electron.version}
|
||||
|
||||
runHook postBuild
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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} .)
|
||||
|
||||
|
|
|
@ -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" }
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue