nvrhi-9999.ebuild 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # Copyright 2019-2023 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. inherit cmake
  5. DESCRIPTION="A Library that implements a common abstraction layer over multiple graphics APIs"
  6. HOMEPAGE="https://github.com/NVIDIAGameWorks/nvrhi"
  7. inherit git-r3
  8. EGIT_REPO_URI="https://github.com/NVIDIAGameWorks/nvrhi"
  9. EGIT_BRANCH="main"
  10. EGIT_SUBMODULES=( )
  11. KEYWORDS="amd64"
  12. IUSE="dxc nvapi rtxmu video_cards_d3d11 video_cards_d3d12 vulkan"
  13. LICENSE="MIT"
  14. SLOT="0"
  15. BDEPEND="
  16. dev-util/glslang
  17. dev-libs/cxxopts
  18. rtxmu? ( dev-libs/rtxmu )
  19. dxc? ( dev-util/DirectXShaderCompiler )
  20. sys-devel/llvm[llvm_targets_DirectX]
  21. vulkan? ( dev-util/vulkan-headers )
  22. "
  23. RDEPEND="
  24. media-libs/vulkan-loader
  25. "
  26. RESTRICT="mirror"
  27. PATCHES=(
  28. ${FILESDIR}/nvrhi-unbundle-libs.patch
  29. )
  30. src_prepare() {
  31. cmake_src_prepare
  32. sed -i "s|LIBRARY DESTINATION lib|LIBRARY DESTINATION $(get_libdir)|" CMakeLists.txt || die
  33. }
  34. src_configure() {
  35. CMAKE_BUILD_TYPE=Release
  36. CMAKE_CXX_STANDARD=17
  37. local mycmakeargs=(
  38. -DCMAKE_INSTALL_PREFIX=/usr
  39. -DNVRHI_BUILD_SHARED=ON
  40. -DNVRHI_WITH_SHADER_COMPILER=$(usex dxc ON OFF)
  41. -DNVRHI_WITH_NVAPI=$(usex nvapi ON OFF)
  42. -DNVRHI_WITH_VULKAN=$(usex vulkan ON OFF)
  43. -DNVRHI_WITH_RTXMU=$(usex rtxmu ON OFF)
  44. -DNVRHI_WITH_DX12=$(usex video_cards_d3d12 ON OFF)
  45. -DNVRHI_WITH_DX11=$(usex video_cards_d3d11 ON OFF)
  46. )
  47. cmake_src_configure
  48. }