feishin: unify electron-builder logic
This commit is contained in:
@@ -74,20 +74,17 @@ buildNpmPackage {
|
||||
ln -s ${dart-sass}/bin/dart-sass "$dir"/sass
|
||||
'';
|
||||
|
||||
postBuild =
|
||||
lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||
# electron-builder appears to build directly on top of Electron.app, by overwriting the files in the bundle.
|
||||
cp -r ${electron.dist}/Electron.app ./
|
||||
find ./Electron.app -name 'Info.plist' | xargs -d '\n' chmod +rw
|
||||
''
|
||||
+ ''
|
||||
npm exec electron-builder -- \
|
||||
--dir \
|
||||
-c.electronDist=${if stdenv.hostPlatform.isDarwin then "./" else electron.dist} \
|
||||
-c.electronVersion=${electron.version} \
|
||||
-c.npmRebuild=false \
|
||||
${lib.optionalString stdenv.hostPlatform.isDarwin "-c.mac.identity=null"}
|
||||
'';
|
||||
postBuild = ''
|
||||
cp -r ${electron.dist} electron-dist
|
||||
chmod -R u+w electron-dist
|
||||
|
||||
npm exec electron-builder -- \
|
||||
--dir \
|
||||
-c.electronDist=electron-dist \
|
||||
-c.electronVersion=${electron.version} \
|
||||
-c.npmRebuild=false \
|
||||
${lib.optionalString stdenv.hostPlatform.isDarwin "-c.mac.identity=null"}
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
Reference in New Issue
Block a user