diff options
author | Marek Szuba <marecki@gentoo.org> | 2016-10-10 17:55:33 -0700 |
---|---|---|
committer | Marek Szuba <marecki@gentoo.org> | 2016-10-10 17:56:26 -0700 |
commit | 45383ff8ce6e52da70b4e5d0c604f4dfbd6eb4e9 (patch) | |
tree | e759175a7a8fa22cbf721df641c788aee4fa4bce /dev-libs/beignet | |
parent | sys-cluster/nova: bup (diff) | |
download | gentoo-45383ff8ce6e52da70b4e5d0c604f4dfbd6eb4e9.tar.gz gentoo-45383ff8ce6e52da70b4e5d0c604f4dfbd6eb4e9.tar.bz2 gentoo-45383ff8ce6e52da70b4e5d0c604f4dfbd6eb4e9.zip |
dev-libs/beignet: support x11-libs/libdrm-2.4.71
This backports the upstream patch which made it to Git earlier on today to
1.2.0. This allows Beignet to link against both stable libdrm-2.4.70 and
unstable libdrm-2.4.71; I haven't tested earlier versions so the ebuild now
requires >=2.4.70.
Package-Manager: portage-2.3.1
Diffstat (limited to 'dev-libs/beignet')
-rw-r--r-- | dev-libs/beignet/beignet-1.2.0-r1.ebuild | 101 | ||||
-rw-r--r-- | dev-libs/beignet/files/beignet-1.2.0-drm_intel_get_pooled_eu.patch | 23 |
2 files changed, 124 insertions, 0 deletions
diff --git a/dev-libs/beignet/beignet-1.2.0-r1.ebuild b/dev-libs/beignet/beignet-1.2.0-r1.ebuild new file mode 100644 index 000000000000..67c4cb11e6c9 --- /dev/null +++ b/dev-libs/beignet/beignet-1.2.0-r1.ebuild @@ -0,0 +1,101 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +PYTHON_COMPAT=( python2_7 ) +CMAKE_BUILD_TYPE="Release" + +inherit python-any-r1 cmake-multilib flag-o-matic toolchain-funcs + +DESCRIPTION="OpenCL implementation for Intel GPUs" +HOMEPAGE="https://01.org/beignet" + +LICENSE="LGPL-2.1+" +SLOT="0" + +if [[ "${PV}" == "9999" ]]; then + inherit git-r3 + EGIT_REPO_URI="git://anongit.freedesktop.org/beignet" + KEYWORDS="" +else + KEYWORDS="~amd64" + SRC_URI="https://01.org/sites/default/files/${P}-source.tar.gz" + S=${WORKDIR}/Beignet-${PV}-Source +fi + +COMMON="${PYTHON_DEPS} + media-libs/mesa + sys-devel/clang + >=sys-devel/llvm-3.5 + <sys-devel/llvm-3.9 + >=x11-libs/libdrm-2.4.70[video_cards_intel] + x11-libs/libXext + x11-libs/libXfixes" +RDEPEND="${COMMON} + app-eselect/eselect-opencl" +DEPEND="${COMMON} + ${PYTHON_DEPS} + virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}"/no-debian-multiarch.patch + "${FILESDIR}"/${P}_no-hardcoded-cflags.patch + "${FILESDIR}"/llvm-terminfo.patch + "${FILESDIR}"/${P}-drm_intel_get_pooled_eu.patch +) + +DOCS=( + docs/. +) + +pkg_pretend() { + if [[ ${MERGE_TYPE} != "binary" ]]; then + if tc-is-gcc; then + if [[ $(gcc-major-version) -eq 4 ]] && [[ $(gcc-minor-version) -lt 6 ]]; then + eerror "Compilation with gcc older than 4.6 is not supported" + die "Too old gcc found." + fi + fi + fi +} + +pkg_setup() { + python_setup +} + +src_prepare() { + # See Bug #593968 + append-flags -fPIC + + cmake-utils_src_prepare + # We cannot run tests because they require permissions to access + # the hardware, and building them is very time-consuming. + cmake_comment_add_subdirectory utests +} + +multilib_src_configure() { + VENDOR_DIR="/usr/$(get_libdir)/OpenCL/vendors/${PN}" + + local mycmakeargs=( + -DCMAKE_INSTALL_PREFIX="${VENDOR_DIR}" + ) + + cmake-utils_src_configure +} + +multilib_src_install() { + VENDOR_DIR="/usr/$(get_libdir)/OpenCL/vendors/${PN}" + + cmake-utils_src_install + + insinto /etc/OpenCL/vendors/ + echo "${VENDOR_DIR}/lib/${PN}/libcl.so" > "${PN}-${ABI}.icd" || die "Failed to generate ICD file" + doins "${PN}-${ABI}.icd" + + dosym "lib/${PN}/libcl.so" "${VENDOR_DIR}"/libOpenCL.so.1 + dosym "lib/${PN}/libcl.so" "${VENDOR_DIR}"/libOpenCL.so + dosym "lib/${PN}/libcl.so" "${VENDOR_DIR}"/libcl.so.1 + dosym "lib/${PN}/libcl.so" "${VENDOR_DIR}"/libcl.so +} diff --git a/dev-libs/beignet/files/beignet-1.2.0-drm_intel_get_pooled_eu.patch b/dev-libs/beignet/files/beignet-1.2.0-drm_intel_get_pooled_eu.patch new file mode 100644 index 000000000000..9ffaee039b64 --- /dev/null +++ b/dev-libs/beignet/files/beignet-1.2.0-drm_intel_get_pooled_eu.patch @@ -0,0 +1,23 @@ +diff --git a/src/intel/intel_driver.c b/src/intel/intel_driver.c +index 5f4afda..cf8f829 100644 +--- a/src/intel/intel_driver.c ++++ b/src/intel/intel_driver.c +@@ -958,14 +958,14 @@ intel_update_device_info(cl_device_id device) + + #ifdef HAS_POOLED_EU + /* BXT pooled eu, 3*6 to 2*9, like sub slice count is 2 */ +- unsigned int has_pooled_eu = 0; +- if(!drm_intel_get_pooled_eu(driver->fd, &has_pooled_eu) && has_pooled_eu) ++ int has_pooled_eu; ++ if((has_pooled_eu = drm_intel_get_pooled_eu(driver->fd)) > 0) + device->sub_slice_count = 2; + + #ifdef HAS_MIN_EU_IN_POOL +- unsigned int min_eu; ++ int min_eu; + /* for fused down 2x6 devices, beignet don't support. */ +- if (has_pooled_eu && !drm_intel_get_min_eu_in_pool(driver->fd, &min_eu)) { ++ if (has_pooled_eu > 0 && (min_eu = drm_intel_get_min_eu_in_pool(driver->fd)) > 0) { + assert(min_eu == 9); //don't support fuse down device. + } + #endif //HAS_MIN_EU_IN_POOL |