foot-9999.ebuild 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # Copyright 1999-2024 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. inherit meson xdg systemd toolchain-funcs
  5. DESCRIPTION="Fast, lightweight and minimalistic Wayland terminal emulator"
  6. HOMEPAGE="https://codeberg.org/dnkl/foot"
  7. if [[ ${PV} == *9999* ]]; then
  8. inherit git-r3
  9. EGIT_REPO_URI="https://codeberg.org/dnkl/foot.git"
  10. KEYWORDS="-*"
  11. else
  12. SRC_URI="https://codeberg.org/dnkl/foot/archive/${PV}.tar.gz -> ${P}.tar.gz"
  13. S="${WORKDIR}"/${PN}-${MY_PV}
  14. KEYWORDS="~amd64 ~arm64 ~arm ~x86"
  15. fi
  16. S="${WORKDIR}/${PN}"
  17. LICENSE="MIT"
  18. SLOT="0"
  19. IUSE="doc +grapheme-clustering ime systemd test themes"
  20. RESTRICT="
  21. !test? ( test )
  22. mirror
  23. "
  24. COMMON_DEPEND="
  25. dev-libs/wayland
  26. media-libs/fcft
  27. media-libs/fontconfig
  28. x11-libs/libxkbcommon
  29. x11-libs/pixman
  30. systemd? ( sys-apps/systemd:= )
  31. grapheme-clustering? (
  32. dev-libs/libutf8proc:=
  33. media-libs/fcft[harfbuzz]
  34. )
  35. "
  36. DEPEND="
  37. ${COMMON_DEPEND}
  38. >=dev-libs/tllist-1.1.0
  39. >=dev-libs/wayland-protocols-1.32
  40. "
  41. RDEPEND="
  42. ${COMMON_DEPEND}
  43. || (
  44. >=sys-libs/ncurses-6.3[-minimal]
  45. ~gui-apps/foot-terminfo-${PV}
  46. )
  47. "
  48. BDEPEND="
  49. doc? ( app-text/scdoc )
  50. dev-util/wayland-scanner
  51. "
  52. src_prepare() {
  53. default
  54. # disable the systemd dep, we install the unit file manually
  55. sed -i "s/systemd', required: false)$/', required: false)/" "${S}"/meson.build || die
  56. tc-is-cross-compiler && ( sed "/find_program(wayland_scanner/s@native\: true@native\: false@" -i meson.build || die "Sed failed..." )
  57. }
  58. src_configure() {
  59. local emesonargs=(
  60. $(meson_feature doc docs)
  61. $(meson_feature grapheme-clustering)
  62. $(meson_use test tests)
  63. $(meson_use themes)
  64. $(meson_use ime)
  65. -Dterminfo=disabled
  66. )
  67. meson_src_configure
  68. sed 's|@bindir@|/usr/bin|g' "${S}"/foot-server.service.in > foot-server.service || die
  69. }
  70. src_install() {
  71. local DOCS=( CHANGELOG.md README.md LICENSE )
  72. meson_src_install
  73. # foot unconditionally installs CHANGELOG.md, README.md and LICENSE.
  74. # we handle this via DOCS and dodoc instead.
  75. use doc && ( rm -r "${ED}/usr/share/doc/${PN}" || die )
  76. systemd_douserunit foot-server.service "${S}"/foot-server.socket
  77. }