fcft-3.1.9.ebuild 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # Copyright 2020-2024 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. PYTHON_COMPAT=( python3_{10..12} )
  5. inherit meson python-any-r1
  6. DESCRIPTION="Simple library for font loading and glyph rasterization"
  7. HOMEPAGE="https://codeberg.org/dnkl/fcft"
  8. SRC_URI="https://codeberg.org/dnkl/fcft/archive/${PV}.tar.gz -> ${P}.tar.gz"
  9. S="${WORKDIR}/${PN}"
  10. # MIT for fcft
  11. # ZLIB for nanosvg
  12. LICENSE="MIT ZLIB"
  13. SLOT="0"
  14. KEYWORDS="~amd64 ~arm64 ~arm ~ppc64 ~riscv ~x86"
  15. IUSE="examples +harfbuzz +libutf8proc man test"
  16. REQUIRED_USE="
  17. libutf8proc? ( harfbuzz )
  18. examples? ( libutf8proc )
  19. "
  20. RESTRICT="!test? ( test )"
  21. RDEPEND="
  22. media-libs/fontconfig
  23. media-libs/freetype
  24. x11-libs/pixman
  25. examples? (
  26. dev-libs/libutf8proc:=
  27. dev-libs/wayland
  28. )
  29. harfbuzz? (
  30. media-libs/harfbuzz:=[truetype]
  31. )
  32. libutf8proc? (
  33. dev-libs/libutf8proc:=
  34. )
  35. "
  36. DEPEND="
  37. ${RDEPEND}
  38. app-i18n/unicode-data
  39. dev-libs/tllist
  40. examples? (
  41. dev-libs/wayland-protocols
  42. )
  43. test? (
  44. dev-libs/check
  45. harfbuzz? ( media-fonts/noto-emoji )
  46. )
  47. "
  48. BDEPEND="
  49. ${PYTHON_DEPS}
  50. man? ( app-text/scdoc )
  51. virtual/pkgconfig
  52. examples? (
  53. dev-util/wayland-scanner
  54. )
  55. "
  56. src_prepare() {
  57. default
  58. rm -r unicode || die "Failed removing vendored unicode-data"
  59. sed -i "s;unicode/UnicodeData.txt;${EPREFIX}/usr/share/unicode-data/UnicodeData.txt;" \
  60. meson.build || die "Failed changing UnicodeData.txt to system's copy"
  61. sed -i "s;unicode/emoji-data.txt;${EPREFIX}/usr/share/unicode-data/emoji/emoji-data.txt;" \
  62. meson.build || die "Failed changing emoji-data.txt to system's copy"
  63. if use examples; then
  64. tc-is-cross-compiler && ( sed "/wscanner\./s@native\: true@native\: false@" -i meson.build || die "Sed failed..." )
  65. fi
  66. }
  67. src_configure() {
  68. local emesonargs=(
  69. $(meson_feature harfbuzz grapheme-shaping)
  70. $(meson_feature libutf8proc run-shaping)
  71. $(meson_feature man docs)
  72. $(meson_use examples)
  73. $(use test && meson_use harfbuzz test-text-shaping)
  74. # bundled, tiny, I believe this means we should always include it
  75. -Dsvg-backend=nanosvg
  76. )
  77. meson_src_configure
  78. }
  79. src_install() {
  80. local DOCS=( CHANGELOG.md README.md )
  81. meson_src_install
  82. rm -r "${ED}"/usr/share/doc/${PN}
  83. use examples && newbin "${BUILD_DIR}/example/example" fcft-example
  84. }