about summary refs log tree commit diff
path: root/pkgs/by-name/en/en-croissant/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/en/en-croissant/package.nix')
-rw-r--r--pkgs/by-name/en/en-croissant/package.nix58
1 files changed, 11 insertions, 47 deletions
diff --git a/pkgs/by-name/en/en-croissant/package.nix b/pkgs/by-name/en/en-croissant/package.nix
index b21364ed9e46..e29246d2a5d5 100644
--- a/pkgs/by-name/en/en-croissant/package.nix
+++ b/pkgs/by-name/en/en-croissant/package.nix
@@ -1,7 +1,6 @@
 {
   lib,
   stdenv,
-  overrideSDK,
   rustPlatform,
   fetchFromGitHub,
 
@@ -14,17 +13,12 @@
 
   openssl,
   libsoup,
-  webkitgtk,
+  webkitgtk_4_0,
   gst_all_1,
-  darwin,
+  apple-sdk_11,
 }:
 
-let
-  buildRustPackage = rustPlatform.buildRustPackage.override {
-    stdenv = if stdenv.isDarwin then overrideSDK stdenv "11.0" else stdenv;
-  };
-in
-buildRustPackage rec {
+rustPlatform.buildRustPackage rec {
   pname = "en-croissant";
   version = "0.11.1";
 
@@ -37,7 +31,7 @@ buildRustPackage rec {
 
   pnpmDeps = pnpm_9.fetchDeps {
     inherit pname version src;
-    hash = "sha256-hjSioKpvrGyo5UKvBrwln0S3aIpnJZ2PUdzBfbT7IC4=";
+    hash = "sha256-hvWXSegUWJvwCU5NLb2vqnl+FIWpCLxw96s9NUIgJTI=";
   };
 
   cargoLock = {
@@ -56,57 +50,27 @@ buildRustPackage rec {
     [
       pnpm_9.configHook
       nodejs
-      cargo-tauri
+      cargo-tauri.hook
       pkg-config
     ]
-    ++ lib.optionals stdenv.isLinux [ wrapGAppsHook3 ]
-    ++ lib.optionals stdenv.isDarwin [ makeBinaryWrapper ];
+    ++ lib.optionals stdenv.hostPlatform.isLinux [ wrapGAppsHook3 ]
+    ++ lib.optionals stdenv.hostPlatform.isDarwin [ makeBinaryWrapper ];
 
   buildInputs =
-    lib.optionals stdenv.isLinux [
+    lib.optionals stdenv.hostPlatform.isLinux [
       openssl
       libsoup
-      webkitgtk
+      webkitgtk_4_0
       gst_all_1.gstreamer
       gst_all_1.gst-plugins-base
       gst_all_1.gst-plugins-bad
       gst_all_1.gst-plugins-good
     ]
-    ++ lib.optionals stdenv.isDarwin [
-      darwin.apple_sdk_11_0.frameworks.Cocoa
-      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.isDarwin then "app" else "deb"}
-
-    runHook postBuild
-  '';
+    ++ lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk_11 ];
 
   doCheck = false; # many scoring tests fail
 
-  # remove once cargo-tauri.hook becomes available
-  installPhase = ''
-    runHook preInstall
-
-    ${lib.optionalString stdenv.isDarwin ''
-      mkdir -p "$out"/Applications
-      cp -r src-tauri/target/release/bundle/macos/* "$out"/Applications
-    ''}
-
-    ${lib.optionalString stdenv.isLinux ''
-      mkdir -p "$out"
-      cp -r src-tauri/target/release/bundle/deb/*/data/usr/* "$out"
-    ''}
-
-    runHook postInstall
-  '';
-
-  postInstall = lib.optionalString stdenv.isDarwin ''
+  postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
     makeWrapper "$out"/Applications/en-croissant.app/Contents/MacOS/en-croissant $out/bin/en-croissant
   '';