summaryrefslogtreecommitdiff
blob: bd54e3432d3a3da9a1ddfab00f0157d82b5e060d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=5

PYTHON_COMPAT=( python2_7 )

inherit python-any-r1 cmake-utils
CMAKE_BUILD_TYPE="Release"

DESCRIPTION="The Beignet GPGPU System for Intel Ivybridge GPUs"
HOMEPAGE="http://wiki.freedesktop.org/www/Software/Beignet/"

LICENSE="GPL-2"
SLOT="0"

if [[ "${PV}" == "9999" ]]; then
	inherit git-r3
	EGIT_REPO_URI="git://anongit.freedesktop.org/beignet"
	KEYWORDS=""
else
	KEYWORDS="~amd64 ~x86"
	SRC_URI="https://01.org/sites/default/files/${P/intel-/}-source.tar.gz -> ${P}.tar.gz"
	S=${WORKDIR}/Beignet-${PV}-Source
fi

DEPEND=">=sys-devel/gcc-4.6
	${PYTHON_DEPS}"
RDEPEND="app-admin/eselect-opencl
	media-libs/mesa
	sys-devel/clang
	>=sys-devel/llvm-3.3
	x11-libs/libdrm
	x11-libs/libXext
	x11-libs/libXfixes"

pkg_setup() {
	python_setup
}
IBEIGNET_DIR=/usr/$(get_libdir)/OpenCL/vendors/intel-beignet

src_prepare() {
	# disable tests for now
	sed -i "s/ADD_SUBDIRECTORY(utests)/#ADD_SUBDIRECTORY(utests)/" CMakeLists.txt || die "sed failed"

	echo "${IBEIGNET_DIR}/lib/beignet/libcl.so" > intelbeignet.icd
	cmake-utils_src_prepare
}
src_configure() {

	local mycmakeargs=( -DCMAKE_INSTALL_PREFIX="${IBEIGNET_DIR}/" )

	cmake-utils_src_configure
}
src_install() {
	cmake-utils_src_install

	insinto /etc/OpenCL/vendors/
	doins intelbeignet.icd

	dodoc -r  docs

	dosym lib/beignet/libcl.so "${IBEIGNET_DIR}"/libOpenCL.so.1
	dosym lib/beignet/libcl.so "${IBEIGNET_DIR}"/libOpenCL.so
	dosym lib/beignet/libcl.so "${IBEIGNET_DIR}"/libcl.so.1
	dosym lib/beignet/libcl.so "${IBEIGNET_DIR}"/libcl.so
}