summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Szuba <marecki@gentoo.org>2017-06-14 10:07:15 +0159
committerMarek Szuba <marecki@gentoo.org>2017-06-14 10:08:54 +0159
commit364c62714143099e12673aea2785c2648ea5dd00 (patch)
tree286b46c0a0a24975b2de836756277184c43a1076 /dev-libs
parentdev-perl/AnyEvent: Fix for '.' in @INC re bug #614640 (diff)
downloadgentoo-364c62714143099e12673aea2785c2648ea5dd00.tar.gz
gentoo-364c62714143099e12673aea2785c2648ea5dd00.tar.bz2
gentoo-364c62714143099e12673aea2785c2648ea5dd00.zip
dev-libs/beignet: add live ebuild
Closes: 4918 Package-Manager: Portage-2.3.5, Repoman-2.3.1
Diffstat (limited to 'dev-libs')
-rw-r--r--dev-libs/beignet/beignet-9999.ebuild103
-rw-r--r--dev-libs/beignet/files/beignet-1.4.0_no-debian-multiarch.patch21
2 files changed, 124 insertions, 0 deletions
diff --git a/dev-libs/beignet/beignet-9999.ebuild b/dev-libs/beignet/beignet-9999.ebuild
new file mode 100644
index 000000000000..fee1267ce37d
--- /dev/null
+++ b/dev-libs/beignet/beignet-9999.ebuild
@@ -0,0 +1,103 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python{2_7,3_4,3_5} )
+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"
+IUSE="ocl-icd ocl20"
+
+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="media-libs/mesa
+ sys-devel/clang:0=
+ >=sys-devel/llvm-3.6:0=
+ ocl20? ( >=sys-devel/llvm-3.9:0= )
+ >=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}
+ ocl-icd? ( dev-libs/ocl-icd )
+ virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.4.0_no-debian-multiarch.patch
+ "${FILESDIR}"/${PN}-1.3.1-oclicd_no_upstream_icdfile.patch
+ "${FILESDIR}"/${PN}-1.2.0_no-hardcoded-cflags.patch
+ "${FILESDIR}"/llvm-terminfo.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}"
+ -DOCLICD_COMPAT=$(usex ocl-icd)
+ -DENABLE_OPENCL_20=$(usex ocl20)
+ )
+
+ 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.4.0_no-debian-multiarch.patch b/dev-libs/beignet/files/beignet-1.4.0_no-debian-multiarch.patch
new file mode 100644
index 000000000000..983ba61ff38f
--- /dev/null
+++ b/dev-libs/beignet/files/beignet-1.4.0_no-debian-multiarch.patch
@@ -0,0 +1,21 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -33,15 +33,9 @@
+
+ SET(CMAKE_VERBOSE_MAKEFILE "false")
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMake/")
+-INCLUDE (GNUInstallDirs OPTIONAL)
+-# support old CMake without GNUInstallDirs
+-if (NOT CMAKE_INSTALL_FULL_LIBDIR)
+- set (CMAKE_INSTALL_FULL_LIBDIR "${CMAKE_INSTALL_PREFIX}/lib")
+- set (CMAKE_INSTALL_FULL_DATADIR "${CMAKE_INSTALL_PREFIX}/share")
+- set (BEIGNET_LIBRARY_ARCHITECTURE "")
+-else (NOT CMAKE_INSTALL_FULL_LIBDIR)
+- set (BEIGNET_LIBRARY_ARCHITECTURE "${CMAKE_LIBRARY_ARCHITECTURE}")
+-endif (NOT CMAKE_INSTALL_FULL_LIBDIR)
++set (CMAKE_INSTALL_FULL_LIBDIR "${CMAKE_INSTALL_PREFIX}/lib")
++set (CMAKE_INSTALL_FULL_DATADIR "${CMAKE_INSTALL_PREFIX}/share")
++set (BEIGNET_LIBRARY_ARCHITECTURE "")
+
+ if (NOT LIB_INSTALL_DIR)
+ set (LIB_INSTALL_DIR "${CMAKE_INSTALL_FULL_LIBDIR}")