mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
vesktop: unify electron-builder logic
(cherry picked from commit 6f40fa913d)
This commit is contained in:
parent
5e1ed45091
commit
04ae381c0d
1 changed files with 3 additions and 8 deletions
|
|
@ -87,7 +87,6 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
ELECTRON_SKIP_BINARY_DOWNLOAD = 1;
|
||||
};
|
||||
|
||||
# electron builds must be writable
|
||||
preBuild = ''
|
||||
# Validate electron version matches upstream package.json
|
||||
if [ "`jq -r '.devDependencies.electron' < package.json | cut -d. -f1 | tr -d '^'`" != "${lib.versions.major electron.version}" ]
|
||||
|
|
@ -95,12 +94,8 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
echo "ERROR: electron version mismatch between package.json and nixpkgs"
|
||||
exit 1
|
||||
fi
|
||||
''
|
||||
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||
cp -r ${electron.dist}/Electron.app .
|
||||
chmod -R u+w Electron.app
|
||||
''
|
||||
+ lib.optionalString stdenv.hostPlatform.isLinux ''
|
||||
|
||||
# electron builds must be writable
|
||||
cp -r ${electron.dist} electron-dist
|
||||
chmod -R u+w electron-dist
|
||||
'';
|
||||
|
|
@ -112,7 +107,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
pnpm exec electron-builder \
|
||||
--dir \
|
||||
-c.asarUnpack="**/*.node" \
|
||||
-c.electronDist=${if stdenv.hostPlatform.isDarwin then "." else "electron-dist"} \
|
||||
-c.electronDist=electron-dist \
|
||||
-c.electronVersion=${electron.version} \
|
||||
${lib.optionalString stdenv.hostPlatform.isDarwin "-c.mac.identity=null"} # disable code signing on macos, https://github.com/electron-userland/electron-builder/blob/77f977435c99247d5db395895618b150f5006e8f/docs/code-signing.md#how-to-disable-code-signing-during-the-build-process-on-macos
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue