nixpkgs/pkgs/applications/misc/rofi-emoji/default.nix
Julien DIOT 899b1ed417 rofi-emoji: fix missing dependencies xdotools wtype
When trying to insert an emoji, and error notification raises:
`Could not find any tool to handle insertion. Please install xdotool or wtype.`

This commit add those missing dependencies.
To control which of these tools should be installed (one is for x11 and the
other for wayland) 2 derivations arguments have been created: `x11Support` and
`waylandSupport` defaulting to `true`.
2024-03-27 07:16:43 -07:00

76 lines
1.4 KiB
Nix

{ stdenv
, lib
, fetchFromGitHub
, makeWrapper
, autoreconfHook
, pkg-config
, waylandSupport ? true
, x11Support ? true
, cairo
, glib
, libnotify
, rofi-unwrapped
, wl-clipboard
, xclip
, xsel
, xdotool
, wtype
}:
stdenv.mkDerivation rec {
pname = "rofi-emoji";
version = "3.3.0";
src = fetchFromGitHub {
owner = "Mange";
repo = pname;
rev = "v${version}";
sha256 = "sha256-Y+E5TViKFVtqXMLVEcq1VMLPzG04vfZyThUM7a/fFGM=";
};
patches = [
# Look for plugin-related files in $out/lib/rofi
./0001-Patch-plugindir-to-output.patch
];
postPatch = ''
patchShebangs clipboard-adapter.sh
'';
postFixup = ''
chmod +x $out/share/rofi-emoji/clipboard-adapter.sh
wrapProgram $out/share/rofi-emoji/clipboard-adapter.sh \
--prefix PATH ":" ${lib.makeBinPath ([ libnotify wl-clipboard xclip xsel ]
++ lib.optionals waylandSupport [ wtype ]
++ lib.optionals x11Support [ xdotool ])}
'';
nativeBuildInputs = [
autoreconfHook
pkg-config
makeWrapper
];
buildInputs = [
cairo
glib
libnotify
rofi-unwrapped
wl-clipboard
xclip
xsel
];
meta = with lib; {
description = "An emoji selector plugin for Rofi";
homepage = "https://github.com/Mange/rofi-emoji";
license = licenses.mit;
maintainers = with maintainers; [ cole-h ];
platforms = platforms.linux;
};
}