nvidia-vaapi-driver-0.0.12.ebuild 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # Copyright 1999-2024 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. inherit meson-multilib
  5. NV_VER="560.35.03"
  6. COMMIT_HASH="68efa33131745f1b2d530c64f6692f3993f3d53c"
  7. DESCRIPTION="A VA-API implemention using NVIDIA's NVDEC, specifically designed to be used by Firefox"
  8. HOMEPAGE="https://github.com/elFarto/nvidia-vaapi-driver"
  9. #SRC_URI="https://github.com/elFarto/nvidia-vaapi-driver/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
  10. SRC_URI="
  11. https://github.com/elFarto/nvidia-vaapi-driver/archive/${COMMIT_HASH}.tar.gz -> ${P}-${COMMIT_HASH}.tar.gz
  12. kernel-open? ( https://github.com/NVIDIA/open-gpu-kernel-modules/archive/refs/tags/${NV_VER}.tar.gz -> open-gpu-kernel-modules-${NV_VER}.tar.gz )
  13. "
  14. LICENSE="MIT"
  15. SLOT="0"
  16. KEYWORDS="~amd64"
  17. IUSE="kernel-open"
  18. RDEPEND="
  19. >=x11-drivers/nvidia-drivers-${NV_VER}:=[kernel-open?]
  20. >=media-libs/libva-2.20
  21. media-libs/libglvnd
  22. >=x11-libs/libdrm-2.4.60
  23. "
  24. BDEPEND="
  25. dev-build/meson
  26. >=media-libs/nv-codec-headers-12.1.14:=
  27. >=media-video/ffmpeg-6.1:=[nvenc]
  28. virtual/pkgconfig
  29. "
  30. RESTRICT="mirror"
  31. PATCHES=( "${FILESDIR}/${PN}-wayland-fix.patch" )
  32. S=${WORKDIR}/${PN}-${COMMIT_HASH}
  33. src_prepare() {
  34. default
  35. if use kernel-open; then
  36. echo "Enabeling direct access.."
  37. "./${S}/extract_headers.sh" "${WORKDIR}/open-gpu-kernel-modules-${NV_VER}"
  38. fi
  39. }
  40. pkg_postinst() {
  41. elog "This library requires special configuration! See "
  42. elog "${HOMEPAGE}"
  43. # Source: https://github.com/elFarto/nvidia-vaapi-driver/blob/v0.0.12/src/backend-common.c#L13
  44. elog "If vaapi drivers fail to load, then make sure that you are"
  45. elog "passing the correct parameters to the kernel."
  46. elog "nvidia_drm.modeset should be set to 1."
  47. elog "Check the wiki page for more information: "
  48. elog "https://wiki.gentoo.org/wiki/VAAPI"
  49. }