libva-utils-2.20.1.ebuild 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. # Copyright 1999-2024 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. inherit meson
  5. DESCRIPTION="Collection of utilities and tests for VA-API"
  6. HOMEPAGE="https://01.org/linuxmedia/vaapi"
  7. if [[ ${PV} = *9999 ]] ; then
  8. inherit git-r3
  9. EGIT_REPO_URI="https://github.com/intel/libva-utils"
  10. else
  11. SRC_URI="https://github.com/intel/libva-utils/archive/${PV}.tar.gz -> ${P}.tar.gz"
  12. KEYWORDS="amd64 arm arm64 ppc64 ~riscv x86 ~amd64-linux ~x86-linux"
  13. fi
  14. LICENSE="MIT"
  15. SLOT="0"
  16. IUSE="examples putsurface test +vainfo wayland X"
  17. RESTRICT="test" # Tests must be run manually
  18. REQUIRED_USE="
  19. putsurface? ( || ( wayland X ) )
  20. || ( examples putsurface test vainfo )
  21. "
  22. DEPEND="
  23. x11-libs/libdrm
  24. wayland? ( >=dev-libs/wayland-1.0.6 )
  25. X? ( >=x11-libs/libX11-1.6.2 )
  26. "
  27. if [[ ${PV} = *9999 ]] ; then
  28. DEPEND+="~media-libs/libva-${PV}:=[wayland?,X?]"
  29. else
  30. DEPEND+=">=media-libs/libva-$(ver_cut 1-2).0:=[wayland?,X?]"
  31. fi
  32. RDEPEND="${DEPEND}"
  33. BDEPEND="virtual/pkgconfig"
  34. src_prepare() {
  35. default
  36. local sed_args=()
  37. if ! use examples ; then
  38. sed_args+=(
  39. -e "/^ subdir('decode')$/d"
  40. -e "/^ subdir('encode')$/d"
  41. -e "/^ subdir('videoprocess')$/d"
  42. -e "/^ subdir('vendor\/intel')$/d"
  43. -e "/^ subdir('vendor\/intel\/sfcsample')$/d"
  44. )
  45. fi
  46. if ! use putsurface ; then
  47. sed_args+=(-e "/^ subdir('putsurface')$/d")
  48. fi
  49. if ! use vainfo ; then
  50. sed_args+=(-e "/^subdir('vainfo')$/d")
  51. fi
  52. if [[ ${#sed_args[@]} -gt 0 ]] ; then
  53. sed "${sed_args[@]}" -i meson.build || die
  54. fi
  55. }
  56. src_configure() {
  57. local emesonargs=(
  58. -Ddrm=true
  59. $(meson_use X x11)
  60. $(meson_use wayland)
  61. $(meson_use test tests)
  62. )
  63. meson_src_configure
  64. }
  65. src_install() {
  66. meson_src_install
  67. if ! use test ; then
  68. rm -f "${ED}"/usr/bin/test_va_api || die
  69. fi
  70. }
  71. pkg_postinst() {
  72. if use test ; then
  73. elog "Tests must be run manually with the test_va_api binary"
  74. fi
  75. }