12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- # Copyright 2023-2024 Gentoo Authors
- # Distributed under the terms of the GNU General Public License v2
- EAPI=8
- LLVM_COMPAT=( {17..19} )
- PYTHON_COMPAT=( python3_{11..12} )
- inherit llvm-r1 meson python-any-r1
- MY_PV="${PV/_/-}"
- DESCRIPTION="intel_clc tool used for building OpenCL C to SPIR-V"
- HOMEPAGE="https://mesa3d.org/"
- if [[ ${PV} == 9999 ]]; then
- S="${WORKDIR}/intel_clc-${MY_PV}"
- EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/mesa.git"
- inherit git-r3
- else
- S="${WORKDIR}/mesa-${MY_PV}"
- SRC_URI="https://archive.mesa3d.org/mesa-${MY_PV}.tar.xz"
- KEYWORDS="~amd64 ~x86"
- fi
- LICENSE="MIT SGI-B-2.0"
- SLOT="0"
- IUSE="debug"
- RDEPEND="
- dev-util/spirv-tools
- llvm-core/libclc
- >=sys-libs/zlib-1.2.8:=
- x11-libs/libdrm
- $(llvm_gen_dep '
- dev-util/spirv-llvm-translator:${LLVM_SLOT}
- llvm-core/clang:${LLVM_SLOT}=
- llvm-core/llvm:${LLVM_SLOT}=
- ')
- "
- DEPEND="${RDEPEND}
- dev-libs/expat
- "
- BDEPEND="
- ${PYTHON_DEPS}
- $(python_gen_any_dep "
- >=dev-python/mako-0.8.0[\${PYTHON_USEDEP}]
- dev-python/packaging[\${PYTHON_USEDEP}]
- dev-python/pyyaml[\${PYTHON_USEDEP}]
- ")
- virtual/pkgconfig
- "
- python_check_deps() {
- python_has_version -b ">=dev-python/mako-0.8.0[${PYTHON_USEDEP}]" &&
- python_has_version -b "dev-python/packaging[${PYTHON_USEDEP}]" &&
- python_has_version -b "dev-python/pyyaml[${PYTHON_USEDEP}]" || return 1
- }
- pkg_setup() {
- llvm-r1_pkg_setup
- python-any-r1_pkg_setup
- }
- src_configure() {
- PKG_CONFIG_PATH="$(get_llvm_prefix)/$(get_libdir)/pkgconfig"
- use debug && EMESON_BUILDTYPE=debug
- local emesonargs=(
- -Dllvm=enabled
- -Dshared-llvm=enabled
- -Dintel-clc=enabled
- -Dgallium-drivers=''
- -Dvulkan-drivers=''
- # Set platforms empty to avoid the default "auto" setting. If
- # platforms is empty meson.build will add surfaceless.
- -Dplatforms=''
- -Dglx=disabled
- -Dlibunwind=disabled
- -Dzstd=disabled
- -Db_ndebug=$(usex debug false true)
- )
- meson_src_configure
- }
- src_install() {
- dobin "${BUILD_DIR}"/src/intel/compiler/intel_clc
- }
|