intel_clc-9999.ebuild 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. # Copyright 2023-2024 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. LLVM_COMPAT=( 17 18 )
  5. PYTHON_COMPAT=( python3_{11..12} )
  6. inherit llvm-r1 meson python-any-r1
  7. MY_PV="${PV/_/-}"
  8. DESCRIPTION="intel_clc tool used for building OpenCL C to SPIR-V"
  9. HOMEPAGE="https://mesa3d.org/"
  10. if [[ ${PV} == 9999 ]]; then
  11. S="${WORKDIR}/intel_clc-${MY_PV}"
  12. EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git"
  13. inherit git-r3
  14. else
  15. S="${WORKDIR}/mesa-${MY_PV}"
  16. SRC_URI="https://archive.mesa3d.org/mesa-${MY_PV}.tar.xz"
  17. KEYWORDS="~amd64 ~x86"
  18. fi
  19. LICENSE="MIT SGI-B-2.0"
  20. SLOT="0"
  21. IUSE="debug"
  22. RDEPEND="
  23. dev-libs/libclc
  24. dev-util/spirv-tools
  25. >=sys-libs/zlib-1.2.8:=
  26. x11-libs/libdrm
  27. $(llvm_gen_dep '
  28. dev-util/spirv-llvm-translator:${LLVM_SLOT}
  29. sys-devel/clang:${LLVM_SLOT}
  30. sys-devel/llvm:${LLVM_SLOT}
  31. ')
  32. "
  33. DEPEND="${RDEPEND}
  34. dev-libs/expat
  35. "
  36. BDEPEND="
  37. ${PYTHON_DEPS}
  38. $(python_gen_any_dep ">=dev-python/mako-0.8.0[\${PYTHON_USEDEP}]")
  39. virtual/pkgconfig
  40. "
  41. python_check_deps() {
  42. python_has_version -b ">=dev-python/mako-0.8.0[${PYTHON_USEDEP}]"
  43. }
  44. pkg_setup() {
  45. llvm-r1_pkg_setup
  46. python-any-r1_pkg_setup
  47. }
  48. src_configure() {
  49. PKG_CONFIG_PATH="$(get_llvm_prefix)/$(get_libdir)/pkgconfig"
  50. use debug && EMESON_BUILDTYPE=debug
  51. local emesonargs=(
  52. -Dllvm=enabled
  53. -Dshared-llvm=enabled
  54. -Dintel-clc=enabled
  55. -Dgallium-drivers=''
  56. -Dvulkan-drivers=''
  57. # Set platforms empty to avoid the default "auto" setting. If
  58. # platforms is empty meson.build will add surfaceless.
  59. -Dplatforms=''
  60. -Dglx=disabled
  61. -Dlibunwind=disabled
  62. -Dzstd=disabled
  63. -Db_ndebug=$(usex debug false true)
  64. )
  65. meson_src_configure
  66. }
  67. src_install() {
  68. dobin "${BUILD_DIR}"/src/intel/compiler/intel_clc
  69. }