/[gentoo-x86]/dev-python/pycuda/pycuda-9999.ebuild
Gentoo

Contents of /dev-python/pycuda/pycuda-9999.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (show annotations) (download)
Tue Dec 2 11:33:53 2014 UTC (5 years, 7 months ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.14: +5 -9 lines
dev-python/pycuda: Version BUmp; add py3.4 support, #531138

(Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key B9D4F231BD1558AB!)

1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-python/pycuda/pycuda-9999.ebuild,v 1.14 2013/11/23 09:32:46 jlec Exp $
4
5 EAPI=5
6
7 PYTHON_COMPAT=( python2_7 python3_{3,4} )
8
9 inherit cuda distutils-r1 git-r3 multilib
10
11 DESCRIPTION="Python wrapper for NVIDIA CUDA"
12 HOMEPAGE="http://mathema.tician.de/software/pycuda/ http://pypi.python.org/pypi/pycuda"
13 SRC_URI=""
14 EGIT_REPO_URI="http://git.tiker.net/trees/pycuda.git"
15
16 LICENSE="GPL-2"
17 SLOT="0"
18 KEYWORDS=""
19 IUSE="examples opengl test"
20
21 RDEPEND="
22 dev-libs/boost[python,${PYTHON_USEDEP}]
23 dev-python/decorator[${PYTHON_USEDEP}]
24 dev-python/mako[${PYTHON_USEDEP}]
25 dev-python/numpy[${PYTHON_USEDEP}]
26 >=dev-python/pytools-2013[${PYTHON_USEDEP}]
27 dev-util/nvidia-cuda-toolkit
28 x11-drivers/nvidia-drivers
29 opengl? ( virtual/opengl )"
30 DEPEND="${RDEPEND}
31 test? (
32 dev-python/mako[${PYTHON_USEDEP}]
33 dev-python/pytest[${PYTHON_USEDEP}] )"
34
35 # We need write acccess /dev/nvidia0 and /dev/nvidiactl and the portage
36 # user is (usually) not in the video group
37 RESTRICT="userpriv"
38
39 python_prepare_all() {
40 cuda_sanitize
41 sed \
42 -e "s:'--preprocess':\'--preprocess\', \'--compiler-bindir=$(cuda_gccdir)\':g" \
43 -e "s:\"--cubin\":\'--cubin\', \'--compiler-bindir=$(cuda_gccdir)\':g" \
44 -e "s:/usr/include/pycuda:${S}/src/cuda:g" \
45 -i pycuda/compiler.py || die
46
47 touch siteconf.py || die
48
49 distutils-r1_python_prepare_all
50 }
51
52 python_configure() {
53 local myopts=()
54 use opengl && myopts+=( --cuda-enable-gl )
55
56 mkdir "${BUILD_DIR}" || die
57 cd "${BUILD_DIR}" || die
58 [[ -e ./siteconf.py ]] && rm -f ./siteconf.py
59 "${EPYTHON}" "${S}"/configure.py \
60 --boost-inc-dir="${EPREFIX}/usr/include" \
61 --boost-lib-dir="${EPREFIX}/usr/$(get_libdir)" \
62 --boost-python-libname=boost_python-$(echo ${EPYTHON} | sed 's/python//')-mt \
63 --boost-thread-libname=boost_thread-mt \
64 --cuda-root="${EPREFIX}/opt/cuda" \
65 --cudadrv-lib-dir="${EPREFIX}/usr/$(get_libdir)" \
66 --cudart-lib-dir="${EPREFIX}/opt/cuda/$(get_libdir)" \
67 --cuda-inc-dir="${EPREFIX}/opt/cuda/include" \
68 --no-use-shipped-boost \
69 "${myopts[@]}"
70 }
71
72 src_test() {
73 # we need write access to this to run the tests
74 addwrite /dev/nvidia0
75 addwrite /dev/nvidiactl
76 python_test() {
77 py.test --debug -v -v -v || die "Tests fail with ${EPYTHON}"
78 }
79 distutils-r1_src_test
80 }
81
82 python_install_all() {
83 distutils-r1_python_install_all
84
85 if use examples; then
86 insinto /usr/share/doc/${PF}
87 doins -r examples
88 fi
89 }

  ViewVC Help
Powered by ViewVC 1.1.20