2022-12-17 10:02:37 +00:00
|
|
|
{ lib, symlinkJoin, makeWrapper, fcitx5, fcitx5-configtool, fcitx5-qt, fcitx5-gtk, addons ? [ ] }:
|
2021-01-15 22:18:51 +00:00
|
|
|
|
|
|
|
symlinkJoin {
|
|
|
|
name = "fcitx5-with-addons-${fcitx5.version}";
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
paths = [ fcitx5 fcitx5-configtool fcitx5-qt fcitx5-gtk ] ++ addons;
|
2021-01-15 22:18:51 +00:00
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2021-01-15 22:18:51 +00:00
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
wrapProgram $out/bin/fcitx5 \
|
|
|
|
--prefix FCITX_ADDON_DIRS : "$out/lib/fcitx5" \
|
|
|
|
--suffix XDG_DATA_DIRS : "$out/share" \
|
2022-12-17 10:02:37 +00:00
|
|
|
--suffix PATH : "$out/bin" \
|
|
|
|
--suffix LD_LIBRARY_PATH : ${lib.makeLibraryPath (lib.flatten (map (x: x.extraLdLibraries or []) addons))}
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
desktop=share/applications/org.fcitx.Fcitx5.desktop
|
|
|
|
autostart=etc/xdg/autostart/org.fcitx.Fcitx5.desktop
|
|
|
|
rm $out/$desktop
|
|
|
|
rm $out/$autostart
|
|
|
|
cp ${fcitx5}/$desktop $out/$desktop
|
|
|
|
sed -i $out/$desktop -e "s|^Exec=.*|Exec=$out/bin/fcitx5|g"
|
|
|
|
ln -s $out/$desktop $out/$autostart
|
2021-01-15 22:18:51 +00:00
|
|
|
'';
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
inherit (fcitx5) meta;
|
2021-01-15 22:18:51 +00:00
|
|
|
}
|