Gentoo Archives: gentoo-commits

From: Marius Brehler <marbre@××××××××××××××.de>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: sci-libs/arrayfire/
Date: Mon, 02 Jan 2017 08:42:07
Message-Id: 1483346475.4d8b878cefe04760a489096821fa846fe6179078.marbre@gentoo
1 commit: 4d8b878cefe04760a489096821fa846fe6179078
2 Author: Marius Brehler <marbre <AT> linux <DOT> sungazer <DOT> de>
3 AuthorDate: Mon Jan 2 08:41:15 2017 +0000
4 Commit: Marius Brehler <marbre <AT> linux <DOT> sungazer <DOT> de>
5 CommitDate: Mon Jan 2 08:41:15 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=4d8b878c
7
8 sci-libs/arrayfire: Version bump to 3.4.2
9
10 Package-Manager: portage-2.3.0
11
12 sci-libs/arrayfire/arrayfire-3.4.2.ebuild | 111 ++++++++++++++++++++++++++++++
13 1 file changed, 111 insertions(+)
14
15 diff --git a/sci-libs/arrayfire/arrayfire-3.4.2.ebuild b/sci-libs/arrayfire/arrayfire-3.4.2.ebuild
16 new file mode 100644
17 index 0000000..eaf0a72
18 --- /dev/null
19 +++ b/sci-libs/arrayfire/arrayfire-3.4.2.ebuild
20 @@ -0,0 +1,111 @@
21 +# Copyright 1999-2017 Gentoo Foundation
22 +# Distributed under the terms of the GNU General Public License v2
23 +# $Id$
24 +
25 +EAPI=6
26 +
27 +inherit cmake-utils multilib
28 +
29 +GTEST_PV="1.7.0"
30 +
31 +DESCRIPTION="A general purpose GPU library"
32 +HOMEPAGE="http://www.arrayfire.com/"
33 +SRC_URI="http://arrayfire.com/arrayfire_source/${PN}-full-${PV}.tar.bz2 -> ${P}.tar.bz2
34 +test? ( https://github.com/google/googletest/archive/release-${GTEST_PV}.zip -> gtest-${GTEST_PV}.zip )"
35 +KEYWORDS="~amd64"
36 +
37 +LICENSE="BSD
38 + nonfree? ( OpenSIFT )"
39 +SLOT="0"
40 +IUSE="+examples +cpu cuda nonfree opencl test unified graphics"
41 +
42 +RDEPEND="
43 + >=sys-devel/gcc-4.7:*
44 + media-libs/freeimage
45 + cuda? (
46 + >=dev-util/nvidia-cuda-toolkit-8.0.44
47 + dev-libs/boost
48 + )
49 + cpu? (
50 + virtual/blas
51 + virtual/cblas
52 + virtual/lapacke
53 + sci-libs/fftw:3.0
54 + )
55 + opencl? (
56 + virtual/blas
57 + virtual/cblas
58 + virtual/lapacke
59 + >=sci-libs/clblas-2.4
60 + >=sci-libs/clfft-2.6.1
61 + >=dev-libs/boost-1.61.0
62 + dev-libs/opencl-clhpp
63 + )
64 + graphics? (
65 + media-libs/glbinding
66 + >=media-libs/glfw-3.1.1
67 + =sci-visualization/forge-0.9.2
68 + )"
69 +DEPEND="${RDEPEND}"
70 +
71 +S="${WORKDIR}/${PN}-full-${PV}"
72 +BUILD_DIR="${S}/build"
73 +CMAKE_BUILD_TYPE=Release
74 +
75 +# We need write acccess /dev/nvidiactl, /dev/nvidia0 and /dev/nvidia-uvm and the portage
76 +# user is (usually) not in the video group
77 +RESTRICT="userpriv"
78 +
79 +pkg_pretend() {
80 + if [[ ${MERGE_TYPE} != binary ]]; then
81 + if [[ $(gcc-major-version) -lt 4 ]] || ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 7 ]] ) ; then
82 + die "Compilation with gcc older than 4.7 is not supported."
83 + fi
84 + fi
85 +}
86 +
87 +src_unpack() {
88 + default
89 +
90 + if ! use nonfree; then
91 + find "${WORKDIR}" -name "*_nonfree*" -delete || die
92 + fi
93 +
94 + if use test; then
95 + mkdir -p "${BUILD_DIR}"/third_party/src/ || die
96 + mv "${WORKDIR}"/gtest-"${GTEST_PV}" "${BUILD_DIR}"/third_party/src/googletest || die
97 + fi
98 +}
99 +
100 +src_configure() {
101 + if use cuda; then
102 + addwrite /dev/nvidiactl
103 + addwrite /dev/nvidia0
104 + addwrite /dev/nvidia-uvm
105 + fi
106 +
107 + local mycmakeargs=(
108 + -DBUILD_CPU="$(usex cpu)"
109 + -DBUILD_CUDA="$(usex cuda)"
110 + -DBUILD_OPENCL="$(usex opencl)"
111 + -DBUILD_EXAMPLES="$(usex examples)"
112 + -DBUILD_TEST="$(usex test)"
113 + -DBUILD_GRAPHICS="$(usex graphics)"
114 + -DBUILD_NONFREE="$(usex nonfree)"
115 + -DBUILD_UNIFIED="$(usex unified)"
116 + -DUSE_SYSTEM_BOOST_COMPUTE=ON
117 + -DUSE_SYSTEM_CL2HPP=ON
118 + -DUSE_SYSTEM_CLBLAS=ON
119 + -DUSE_SYSTEM_CLFFT=ON
120 + -DUSE_SYSTEM_FORGE=ON
121 + -DUSE_SYSTEM_GLBINDING=ON
122 + -DAF_INSTALL_CMAKE_DIR=/usr/$(get_libdir)/cmake/ArrayFire
123 + )
124 + cmake-utils_src_configure
125 +}
126 +
127 +src_install() {
128 + cmake-utils_src_install
129 +
130 + dobin "${BUILD_DIR}/bin2cpp"
131 +}