about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMasum Reza <50095635+JohnRTitor@users.noreply.github.com>2024-06-25 11:08:02 +0530
committerGitHub <noreply@github.com>2024-06-25 11:08:02 +0530
commit5a4d916a63f6314c1b40fa8c1045d4bf21d19227 (patch)
tree0ce77da24b4df34e9074915ab28da38ac71e8340
parente6e4cd92ad886b91a6de120ce61c81b7e6072530 (diff)
parentaed8340530b2fd5749275a88d6f6d8bd2e79e1c3 (diff)
Merge pull request #321075 from Aleksanaa/emote
emote: 4.0.1 -> 4.1.0
-rw-r--r--pkgs/by-name/em/emote/package.nix85
-rw-r--r--pkgs/tools/inputmethods/emote/default.nix62
-rw-r--r--pkgs/top-level/all-packages.nix2
3 files changed, 85 insertions, 64 deletions
diff --git a/pkgs/by-name/em/emote/package.nix b/pkgs/by-name/em/emote/package.nix
new file mode 100644
index 0000000000000..1854bc1b1bcc3
--- /dev/null
+++ b/pkgs/by-name/em/emote/package.nix
@@ -0,0 +1,85 @@
+{
+  lib,
+  fetchFromGitHub,
+  python3Packages,
+  meson,
+  ninja,
+  pkg-config,
+  wrapGAppsHook3,
+  gobject-introspection,
+  keybinder3,
+  xdotool,
+  wl-clipboard,
+}:
+
+python3Packages.buildPythonApplication rec {
+  pname = "emote";
+  version = "4.1.0";
+  pyproject = false; # Built with meson
+
+  src = fetchFromGitHub {
+    owner = "tom-james-watson";
+    repo = "Emote";
+    rev = "v${version}";
+    hash = "sha256-c5EY1Cc3oD8EG1oTChbl10jJlNeAETQbAFGoA9Lw5PY=";
+  };
+
+  postPatch = ''
+    substituteInPlace emote/picker.py \
+      --replace-fail 'os.environ.get("SNAP_VERSION", "dev build")' "'$version'"
+    substituteInPlace emote/config.py \
+      --replace-fail 'is_flatpak = os.environ.get("FLATPAK") is not None' 'is_flatpak = False' \
+      --replace-fail 'os.environ.get("SNAP")' "'$out/share/emote'"
+  '';
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    wrapGAppsHook3
+    gobject-introspection
+  ];
+
+  buildInputs = [
+    # used by gobject-introspection's setup-hook and only detected at runtime
+    keybinder3
+  ];
+
+  dependencies = with python3Packages; [
+    dbus-python.out # don't propagate dev output
+    manimpango
+    pygobject3.out # don't propagate dev output
+    setproctitle
+  ];
+
+  postInstall = ''
+    rm $out/share/emote/emote/{emote.in,meson.build}
+    rm $out/share/emote/static/{meson.build,com.tomjwatson.Emote.desktop,prepare-launch}
+  '';
+
+  dontWrapGApps = true;
+  preFixup = ''
+    makeWrapperArgs+=(
+      "''${gappsWrapperArgs[@]}"
+      --prefix PATH : ${
+        lib.makeBinPath [
+          xdotool
+          wl-clipboard
+        ]
+      }
+    )
+  '';
+
+  meta = with lib; {
+    description = "Modern emoji picker for Linux";
+    mainProgram = "emote";
+    homepage = "https://github.com/tom-james-watson/emote";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [
+      emilytrau
+      SuperSandro2000
+      aleksana
+    ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/tools/inputmethods/emote/default.nix b/pkgs/tools/inputmethods/emote/default.nix
deleted file mode 100644
index 10e66f1d33b3c..0000000000000
--- a/pkgs/tools/inputmethods/emote/default.nix
+++ /dev/null
@@ -1,62 +0,0 @@
-{ lib, fetchFromGitHub, python3Packages, wrapGAppsHook3, gobject-introspection, keybinder3, xdotool }:
-
-python3Packages.buildPythonApplication rec {
-  pname = "emote";
-  version = "4.0.1";
-
-  src = fetchFromGitHub {
-    owner = "tom-james-watson";
-    repo = "Emote";
-    rev = "v${version}";
-    sha256 = "sha256-+GpL4Rp0ECsxXGP9dWZbVNkH7H2GF1brDTLsB+TQY5A=";
-  };
-
-  postPatch = ''
-    sed -i setup.py -e '/==.*/d'
-    substituteInPlace emote/config.py --replace 'os.environ.get("SNAP")' "'$out/share/emote'"
-    substituteInPlace emote/picker.py --replace 'os.environ.get("SNAP_VERSION", "dev build")' "'$version'"
-    substituteInPlace snap/gui/emote.desktop --replace "Icon=\''${SNAP}/usr/share/icons/emote.svg" "Icon=emote.svg"
-  '';
-
-  nativeBuildInputs = [
-    wrapGAppsHook3
-    gobject-introspection
-  ];
-
-  buildInputs = [
-    # used by gobject-introspection's setup-hook and only detected at runtime
-    keybinder3
-  ];
-
-  propagatedBuildInputs = with python3Packages; [
-    dbus-python.out # don't propagate dev output
-    manimpango
-    pygobject3.out # not listed in setup.py, don't propagate dev output
-    setproctitle
-  ];
-
-  postInstall = ''
-    install -D snap/gui/emote.desktop $out/share/applications/emote.desktop
-    install -D snap/gui/emote.svg $out/share/pixmaps/emote.svg
-    install -D -t $out/share/emote/static static/{emojis.csv,logo.svg,style.css}
-  '';
-
-  dontWrapGApps = true;
-  preFixup = ''
-    makeWrapperArgs+=(
-      "''${gappsWrapperArgs[@]}"
-      --prefix PATH : ${lib.makeBinPath [ xdotool ]}
-    )
-  '';
-
-  doCheck = false;
-
-  meta = with lib; {
-    description = "Modern emoji picker for Linux";
-    mainProgram = "emote";
-    homepage = "https://github.com/tom-james-watson/emote";
-    license = licenses.gpl3Plus;
-    maintainers = with maintainers; [ emilytrau SuperSandro2000 ];
-    platforms = platforms.linux;
-  };
-}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 0c0a7ef9da360..258041b586ff2 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -7468,8 +7468,6 @@ with pkgs;
     autoreconfHook = buildPackages.autoreconfHook269;
   };
 
-  emote = callPackage ../tools/inputmethods/emote { };
-
   engauge-digitizer = libsForQt5.callPackage ../applications/science/math/engauge-digitizer { };
 
   epub2txt2 = callPackage ../tools/text/epub2txt2 { };