rofi-9999.ebuild 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # Copyright 1999-2024 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. inherit meson toolchain-funcs xdg-utils
  5. DESCRIPTION="A window switcher, run dialog and dmenu replacement (fork with Wayland support)"
  6. HOMEPAGE="https://github.com/lbonn/rofi"
  7. if [[ ${PV} = *9999 ]]; then
  8. inherit git-r3
  9. EGIT_REPO_URI="https://github.com/lbonn/rofi"
  10. #EGIT_SUBMODULES=()
  11. EGIT_BRANCH="wayland"
  12. KEYWORDS=""
  13. else
  14. MY_PV="${PV}+wayland3"
  15. SRC_URI="https://github.com/lbonn/rofi/releases/download/${MY_PV}/${PN}-${MY_PV}.tar.xz"
  16. KEYWORDS="~amd64 ~x86 ~arm ~arm64"
  17. S=${WORKDIR}/${PN}-${MY_PV}
  18. fi
  19. LICENSE="MIT"
  20. SLOT="0"
  21. IUSE="X +drun examples imdkit man test wayland +windowmode"
  22. RESTRICT="!test? ( test )"
  23. BDEPEND="
  24. dev-build/meson
  25. app-alternatives/ninja
  26. virtual/pkgconfig
  27. virtual/libc
  28. man? (
  29. >=dev-go/go-md2man-2.0.3
  30. app-text/doxygen[dot]
  31. )
  32. wayland? ( >=dev-libs/wayland-protocols-1.17 )
  33. "
  34. RDEPEND="
  35. dev-libs/glib:2
  36. x11-libs/gdk-pixbuf:2
  37. x11-libs/cairo[X?]
  38. x11-libs/libxkbcommon[X?]
  39. x11-libs/pango[X?]
  40. X? (
  41. x11-libs/startup-notification
  42. x11-libs/xcb-util
  43. x11-libs/xcb-util-cursor
  44. x11-libs/xcb-util-wm
  45. x11-misc/xkeyboard-config
  46. )
  47. imdkit? ( x11-libs/xcb-imdkit )
  48. wayland? (
  49. >=dev-libs/wayland-protocols-1.17
  50. >=dev-libs/wayland-1.17.0
  51. )
  52. !x11-misc/rofi
  53. "
  54. DEPEND="
  55. ${RDEPEND}
  56. X? ( x11-base/xorg-proto )
  57. test? (
  58. >=dev-libs/check-0.11
  59. dev-util/cppcheck
  60. )
  61. "
  62. RESTRICT="mirror"
  63. src_prepare() {
  64. use man || ( sed -i -e '/install_man(/{:1;/)/!{N;b1};d}' -e "/subdir('doc')/d" meson.build || die )
  65. use test || ( sed -i -e '/test(/{:1;/))/!{N;b1};d}' meson.build || die )
  66. default
  67. }
  68. src_configure() {
  69. tc-export CC CXX LD
  70. local emesonargs=(
  71. $(meson_use drun)
  72. $(meson_use windowmode window)
  73. $(meson_feature X xcb)
  74. $(meson_feature wayland)
  75. $(meson_feature test check)
  76. $(meson_use imdkit imdkit)
  77. )
  78. meson_src_configure
  79. }
  80. src_install() {
  81. meson_src_install
  82. use examples && ( insinto /usr/share/rofi/examples/; doins Examples/*.sh || die "Examples install failed.")
  83. use man && ( doman doc/${PN}*.1 doc/${PN}*.5 || die "Manpages install failed.")
  84. cp "${FILESDIR}/rofi.svg" "${D}/usr/share/icons/hicolor/scalable/apps/" || die "Rofi default icon install failed."
  85. }
  86. src_test() {
  87. meson_src_test
  88. }
  89. pkg_postinst() {
  90. for v in ${REPLACING_VERSIONS}; do
  91. if ver_test "${v}" -lt 1.7.0; then
  92. elog "Rofi 1.7.0 removed the (deprecated) xresources based configuration setup."
  93. elog "If you are still using old configuration setup, please convert it to new format manually."
  94. elog "The new format configuration can be generated by 'rofi -dump-config > ~/.config/rofi/config.rasi'."
  95. elog "For more information, please see https://github.com/davatorium/rofi/releases/tag/1.7.0"
  96. fi
  97. done
  98. xdg_icon_cache_update
  99. }
  100. pkg_postrm() {
  101. xdg_icon_cache_update
  102. }