about summary refs log tree commit diff
path: root/pkgs/applications/office/espanso/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/office/espanso/default.nix')
-rw-r--r--pkgs/applications/office/espanso/default.nix67
1 files changed, 36 insertions, 31 deletions
diff --git a/pkgs/applications/office/espanso/default.nix b/pkgs/applications/office/espanso/default.nix
index 1b02f3be80eca..c8883f36339e4 100644
--- a/pkgs/applications/office/espanso/default.nix
+++ b/pkgs/applications/office/espanso/default.nix
@@ -28,6 +28,7 @@
 , QTKit
 , AVKit
 , WebKit
+, System
 , waylandSupport ? false
 , x11Support ? stdenv.isLinux
 , testers
@@ -39,13 +40,13 @@ assert stdenv.isDarwin -> !x11Support;
 assert stdenv.isDarwin -> !waylandSupport;
 rustPlatform.buildRustPackage rec {
   pname = "espanso";
-  version = "2.1.8";
+  version = "2.2-unstable-2024-05-14";
 
   src = fetchFromGitHub {
     owner = "espanso";
     repo = "espanso";
-    rev = "v${version}";
-    hash = "sha256-5TUo5B1UZZARgTHbK2+520e3mGZkZ5tTez1qvZvMnxs=";
+    rev = "8daadcc949c35a7b7aa20b7f544fdcff83e2c5f7";
+    hash = "sha256-4MArENBmX6tDVLZE1O8cuJe7A0R+sLZoxBkDvIwIVZ4=";
   };
 
   cargoLock = {
@@ -55,10 +56,6 @@ rustPlatform.buildRustPackage rec {
     };
   };
 
-  cargoPatches = lib.optionals stdenv.isDarwin [
-    ./inject-wx-on-darwin.patch
-  ];
-
   nativeBuildInputs = [
     extra-cmake-modules
     pkg-config
@@ -70,7 +67,7 @@ rustPlatform.buildRustPackage rec {
   buildNoDefaultFeatures = true;
   buildFeatures = [
     "modulo"
-  ] ++ lib.optionals waylandSupport[
+  ] ++ lib.optionals waylandSupport [
     "wayland"
   ] ++ lib.optionals stdenv.isLinux [
     "vendored-tls"
@@ -96,6 +93,7 @@ rustPlatform.buildRustPackage rec {
     QTKit
     AVKit
     WebKit
+    System
   ] ++ lib.optionals waylandSupport [
     wl-clipboard
   ] ++ lib.optionals x11Support [
@@ -108,39 +106,39 @@ rustPlatform.buildRustPackage rec {
 
   postPatch = lib.optionalString stdenv.isDarwin ''
     substituteInPlace scripts/create_bundle.sh \
-      --replace target/mac/ $out/Applications/ \
-      --replace /bin/echo ${coreutils}/bin/echo
+      --replace-fail target/mac/ $out/Applications/ \
+      --replace-fail /bin/echo ${coreutils}/bin/echo
     patchShebangs scripts/create_bundle.sh
     substituteInPlace espanso/src/res/macos/Info.plist \
-      --replace "<string>espanso</string>" "<string>${placeholder "out"}/Applications/Espanso.app/Contents/MacOS/espanso</string>"
-    substituteInPlace espanso/src/res/macos/com.federicoterzi.espanso.plist \
-      --replace "<string>/Applications/Espanso.app/Contents/MacOS/espanso</string>" "<string>${placeholder "out"}/Applications/Espanso.app/Contents/MacOS/espanso</string>" \
-      --replace "<string>/usr/bin" "<string>${placeholder "out"}/bin:/usr/bin"
+      --replace-fail "<string>espanso</string>" "<string>${placeholder "out"}/Applications/Espanso.app/Contents/MacOS/espanso</string>"
     substituteInPlace espanso/src/path/macos.rs  espanso/src/path/linux.rs \
-      --replace '"/usr/local/bin/espanso"' '"${placeholder "out"}/bin/espanso"'
+      --replace-fail '"/usr/local/bin/espanso"' '"${placeholder "out"}/bin/espanso"'
   '';
 
   # Some tests require networking
   doCheck = false;
 
-  postInstall = if stdenv.isDarwin then ''
-    EXEC_PATH=$out/bin/espanso BUILD_ARCH=current ${stdenv.shell} ./scripts/create_bundle.sh
-  '' else ''
-    wrapProgram $out/bin/espanso \
-      --prefix PATH : ${lib.makeBinPath (
-        lib.optionals stdenv.isLinux [
-          libnotify
-          setxkbmap
-        ] ++ lib.optionals waylandSupport [
-          wl-clipboard
-        ] ++ lib.optionals x11Support [
-          xclip
-        ]
-      )}
-  '';
+  postInstall =
+    if stdenv.isDarwin then ''
+      EXEC_PATH=$out/bin/espanso BUILD_ARCH=current ${stdenv.shell} ./scripts/create_bundle.sh
+    '' else ''
+      wrapProgram $out/bin/espanso \
+        --prefix PATH : ${lib.makeBinPath (
+          lib.optionals stdenv.isLinux [
+            libnotify
+            setxkbmap
+          ] ++ lib.optionals waylandSupport [
+            wl-clipboard
+          ] ++ lib.optionals x11Support [
+            xclip
+          ]
+        )}
+    '';
 
   passthru.tests.version = testers.testVersion {
     package = espanso;
+    # remove when updating to a release version
+    version = "2.2.1";
   };
 
   meta = with lib; {
@@ -148,8 +146,15 @@ rustPlatform.buildRustPackage rec {
     mainProgram = "espanso";
     homepage = "https://espanso.org";
     license = licenses.gpl3Plus;
-    maintainers = with maintainers; [ kimat thehedgeh0g ];
+    maintainers = with maintainers; [ kimat pyrox0 n8henrie ];
     platforms = platforms.unix;
+    # With apple_sdk_10_12,
+    # kCFURLVolumeAvailableCapacityForImportantUsageKey
+    # is undefined.
+    # With apple_sdk_11_0, there is an issue with
+    # kColorSyncGenericGrayProfile.
+    broken = stdenv.hostPlatform.system == "x86_64-darwin";
+
 
     longDescription = ''
       Espanso detects when you type a keyword and replaces it while you're typing.