Skip to content

Commit

Permalink
bruno: fix darwin builds
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpolzin committed Jan 13, 2024
1 parent 12a82c9 commit 65507ad
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion pkgs/by-name/br/bruno/package.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ lib

, stdenv
, fetchFromGitHub
, buildNpmPackage
, nix-update-script
Expand Down Expand Up @@ -34,9 +35,10 @@ buildNpmPackage rec {

nativeBuildInputs = [
(writeShellScriptBin "phantomjs" "echo 2.1.1")
pkg-config
] ++ lib.optionals (! stdenv.isDarwin) [
makeWrapper
copyDesktopItems
pkg-config
];

buildInputs = [
Expand Down Expand Up @@ -74,11 +76,27 @@ buildNpmPackage rec {
pushd packages/bruno-electron
${if stdenv.isDarwin then ''
cp -r ${electron}/Applications/Electron.app ./
find ./Electron.app -name 'Info.plist' | xargs -d '\n' chmod +rw
substituteInPlace electron-builder-config.js \
--replace "identity: 'Anoop MD (W7LPPWA48L)'" 'identity: null' \
--replace "afterSign: 'notarize.js'," ""
npm exec electron-builder -- \
--dir \
--config electron-builder-config.js \
-c.electronDist=./ \
-c.electronVersion=${electron.version} \
-c.npmRebuild=false
'' else ''
npm exec electron-builder -- \
--dir \
-c.electronDist=${electron}/libexec/electron \
-c.electronVersion=${electron.version} \
-c.npmRebuild=false
''}
popd
'';
Expand All @@ -88,6 +106,12 @@ buildNpmPackage rec {
installPhase = ''
runHook preInstall
${if stdenv.isDarwin then ''
mkdir -p $out/Applications
cp -R packages/bruno-electron/out/**/Bruno.app $out/Applications/
'' else ''
mkdir -p $out/opt/bruno $out/bin
cp -r packages/bruno-electron/dist/linux-unpacked/{locales,resources{,.pak}} $out/opt/bruno
Expand All @@ -102,6 +126,7 @@ buildNpmPackage rec {
size=${"$"}{s}x$s
install -Dm644 $src/packages/bruno-electron/resources/icons/png/$size.png $out/share/icons/hicolor/$size/apps/bruno.png
done
''}
runHook postInstall
'';
Expand Down

0 comments on commit 65507ad

Please sign in to comment.