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