Skip to content

Commit

Permalink
en-croissant: use cargo-tauri.hook
Browse files Browse the repository at this point in the history
  • Loading branch information
getchoo committed Sep 27, 2024
1 parent 3ea00b9 commit e73a4d4
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions pkgs/by-name/en/en-croissant/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ buildRustPackage rec {
[
pnpm_9.configHook
nodejs
cargo-tauri
cargo-tauri.hook
pkg-config
]
++ lib.optionals stdenv.hostPlatform.isLinux [ wrapGAppsHook3 ]
Expand All @@ -77,35 +77,8 @@ buildRustPackage rec {
darwin.apple_sdk_11_0.frameworks.WebKit
];

# remove once cargo-tauri.hook becomes available
# https://github.com/NixOS/nixpkgs/pull/335751
buildPhase = ''
runHook preBuild
cargo tauri build --bundles ${if stdenv.hostPlatform.isDarwin then "app" else "deb"}
runHook postBuild
'';

doCheck = false; # many scoring tests fail

# remove once cargo-tauri.hook becomes available
installPhase = ''
runHook preInstall
${lib.optionalString stdenv.hostPlatform.isDarwin ''
mkdir -p "$out"/Applications
cp -r src-tauri/target/release/bundle/macos/* "$out"/Applications
''}
${lib.optionalString stdenv.hostPlatform.isLinux ''
mkdir -p "$out"
cp -r src-tauri/target/release/bundle/deb/*/data/usr/* "$out"
''}
runHook postInstall
'';

postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
makeWrapper "$out"/Applications/en-croissant.app/Contents/MacOS/en-croissant $out/bin/en-croissant
'';
Expand Down

0 comments on commit e73a4d4

Please sign in to comment.