nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchFromGitHub,
4 python3Packages,
5 meson,
6 ninja,
7 pkg-config,
8 wrapGAppsHook3,
9 gobject-introspection,
10 keybinder3,
11 xdotool,
12 wl-clipboard,
13}:
14
15python3Packages.buildPythonApplication rec {
16 pname = "emote";
17 version = "4.1.0";
18 pyproject = false; # Built with meson
19
20 src = fetchFromGitHub {
21 owner = "tom-james-watson";
22 repo = "Emote";
23 rev = "v${version}";
24 hash = "sha256-c5EY1Cc3oD8EG1oTChbl10jJlNeAETQbAFGoA9Lw5PY=";
25 };
26
27 postPatch = ''
28 substituteInPlace emote/picker.py \
29 --replace-fail 'os.environ.get("SNAP_VERSION", "dev build")' "'$version'"
30 substituteInPlace emote/config.py \
31 --replace-fail 'is_flatpak = os.environ.get("FLATPAK") is not None' 'is_flatpak = False' \
32 --replace-fail 'os.environ.get("SNAP")' "'$out/share/emote'"
33 '';
34
35 nativeBuildInputs = [
36 meson
37 ninja
38 pkg-config
39 wrapGAppsHook3
40 gobject-introspection
41 ];
42
43 buildInputs = [
44 # used by gobject-introspection's setup-hook and only detected at runtime
45 keybinder3
46 ];
47
48 dependencies = with python3Packages; [
49 dbus-python.out # don't propagate dev output
50 manimpango
51 pygobject3.out # don't propagate dev output
52 setproctitle
53 ];
54
55 postInstall = ''
56 rm $out/share/emote/emote/{emote.in,meson.build}
57 rm $out/share/emote/static/{meson.build,com.tomjwatson.Emote.desktop,prepare-launch}
58 '';
59
60 dontWrapGApps = true;
61 preFixup = ''
62 makeWrapperArgs+=(
63 "''${gappsWrapperArgs[@]}"
64 --prefix PATH : ${
65 lib.makeBinPath [
66 xdotool
67 wl-clipboard
68 ]
69 }
70 )
71 '';
72
73 meta = {
74 description = "Modern emoji picker for Linux";
75 mainProgram = "emote";
76 homepage = "https://github.com/tom-james-watson/emote";
77 license = lib.licenses.gpl3Plus;
78 maintainers = with lib.maintainers; [
79 emilytrau
80 SuperSandro2000
81 aleksana
82 ];
83 platforms = lib.platforms.linux;
84 };
85}