2021-03-21 22:52:17 +00:00
|
|
|
{ symlinkJoin, lib, rofi-unwrapped, makeWrapper, wrapGAppsHook, gdk-pixbuf, hicolor-icon-theme, theme ? null, plugins ? [], symlink-dmenu ? false }:
|
2018-03-11 01:37:59 +00:00
|
|
|
|
2020-03-29 23:18:56 +00:00
|
|
|
symlinkJoin {
|
|
|
|
name = "rofi-${rofi-unwrapped.version}";
|
|
|
|
|
|
|
|
paths = [
|
|
|
|
rofi-unwrapped.out
|
|
|
|
] ++ (lib.forEach plugins (p: p.out));
|
2019-07-08 14:22:13 +00:00
|
|
|
|
2021-01-25 17:14:43 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper wrapGAppsHook ];
|
|
|
|
buildInputs = [ gdk-pixbuf ];
|
|
|
|
|
2018-03-11 01:37:59 +00:00
|
|
|
preferLocalBuild = true;
|
2018-06-11 19:30:36 +00:00
|
|
|
passthru.unwrapped = rofi-unwrapped;
|
2021-01-25 17:14:43 +00:00
|
|
|
|
|
|
|
dontWrapGApps = true;
|
|
|
|
|
2020-03-29 23:18:56 +00:00
|
|
|
postBuild = ''
|
|
|
|
rm -rf $out/bin
|
2018-06-11 19:30:36 +00:00
|
|
|
mkdir $out/bin
|
|
|
|
ln -s ${rofi-unwrapped}/bin/* $out/bin
|
|
|
|
rm $out/bin/rofi
|
2021-01-25 17:14:43 +00:00
|
|
|
|
|
|
|
gappsWrapperArgsHook
|
2019-12-23 02:37:08 +00:00
|
|
|
makeWrapper ${rofi-unwrapped}/bin/rofi $out/bin/rofi \
|
2021-01-25 17:14:43 +00:00
|
|
|
''${gappsWrapperArgs[@]} \
|
2019-12-23 02:37:08 +00:00
|
|
|
--prefix XDG_DATA_DIRS : ${hicolor-icon-theme}/share \
|
2020-03-31 19:01:47 +00:00
|
|
|
${lib.optionalString (plugins != []) ''--prefix XDG_DATA_DIRS : ${lib.concatStringsSep ":" (lib.forEach plugins (p: "${p.out}/share"))}''} \
|
2020-03-29 23:18:56 +00:00
|
|
|
${lib.optionalString (theme != null) ''--add-flags "-theme ${theme}"''} \
|
|
|
|
${lib.optionalString (plugins != []) ''--add-flags "-plugin-path $out/lib/rofi"''}
|
2019-12-23 02:37:08 +00:00
|
|
|
|
2021-03-21 22:52:17 +00:00
|
|
|
${lib.optionalString symlink-dmenu "ln -s ${rofi-unwrapped}/bin/rofi $out/bin/dmenu"}
|
|
|
|
|
2019-12-23 02:37:08 +00:00
|
|
|
rm $out/bin/rofi-theme-selector
|
|
|
|
makeWrapper ${rofi-unwrapped}/bin/rofi-theme-selector $out/bin/rofi-theme-selector \
|
|
|
|
--prefix XDG_DATA_DIRS : $out/share
|
2018-03-11 01:37:59 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = rofi-unwrapped.meta // {
|
|
|
|
priority = (rofi-unwrapped.meta.priority or 0) - 1;
|
|
|
|
};
|
|
|
|
}
|