feishin: unify electron-builder logic

This commit is contained in:
TomaSajt
2026-05-25 17:47:21 +02:00
parent b36a12f7e7
commit a58a02b18e
+11 -14
View File
@@ -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