intel_clc-9999.ebuild 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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..19} )
  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-util/spirv-tools
  24. llvm-core/libclc
  25. >=sys-libs/zlib-1.2.8:=
  26. x11-libs/libdrm
  27. $(llvm_gen_dep '
  28. dev-util/spirv-llvm-translator:${LLVM_SLOT}
  29. llvm-core/clang:${LLVM_SLOT}=
  30. llvm-core/llvm:${LLVM_SLOT}=
  31. ')
  32. "
  33. DEPEND="${RDEPEND}
  34. dev-libs/expat
  35. "
  36. BDEPEND="
  37. ${PYTHON_DEPS}
  38. $(python_gen_any_dep "
  39. >=dev-python/mako-0.8.0[\${PYTHON_USEDEP}]
  40. dev-python/packaging[\${PYTHON_USEDEP}]
  41. dev-python/pyyaml[\${PYTHON_USEDEP}]
  42. ")
  43. virtual/pkgconfig
  44. "
  45. python_check_deps() {
  46. python_has_version -b ">=dev-python/mako-0.8.0[${PYTHON_USEDEP}]" &&
  47. python_has_version -b "dev-python/packaging[${PYTHON_USEDEP}]" &&
  48. python_has_version -b "dev-python/pyyaml[${PYTHON_USEDEP}]" || return 1
  49. }
  50. pkg_setup() {
  51. llvm-r1_pkg_setup
  52. python-any-r1_pkg_setup
  53. }
  54. src_configure() {
  55. PKG_CONFIG_PATH="$(get_llvm_prefix)/$(get_libdir)/pkgconfig"
  56. use debug && EMESON_BUILDTYPE=debug
  57. local emesonargs=(
  58. -Dllvm=enabled
  59. -Dshared-llvm=enabled
  60. -Dintel-clc=enabled
  61. -Dgallium-drivers=''
  62. -Dvulkan-drivers=''
  63. # Set platforms empty to avoid the default "auto" setting. If
  64. # platforms is empty meson.build will add surfaceless.
  65. -Dplatforms=''
  66. -Dglx=disabled
  67. -Dlibunwind=disabled
  68. -Dzstd=disabled
  69. -Db_ndebug=$(usex debug false true)
  70. )
  71. meson_src_configure
  72. }
  73. src_install() {
  74. dobin "${BUILD_DIR}"/src/intel/compiler/intel_clc
  75. }