Gentoo Archives: gentoo-commits

From: Sebastien Fabbro <bicatali@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-astronomy/casacore/
Date: Fri, 07 Jul 2017 20:40:13
Message-Id: 1499459989.d177b3ff53dc5b2e8ae9f8b0d63b70721fdcaf3a.bicatali@gentoo
1 commit: d177b3ff53dc5b2e8ae9f8b0d63b70721fdcaf3a
2 Author: Sébastien Fabbro <bicatali <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jul 7 20:35:57 2017 +0000
4 Commit: Sebastien Fabbro <bicatali <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 7 20:39:49 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d177b3ff
7
8 sci-astronomy/casacore: fixed for multiple python building
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.2
11
12 ...acore-2.3.0.ebuild => casacore-2.3.0-r1.ebuild} | 30 +++++++++++++++++-----
13 1 file changed, 23 insertions(+), 7 deletions(-)
14
15 diff --git a/sci-astronomy/casacore/casacore-2.3.0.ebuild b/sci-astronomy/casacore/casacore-2.3.0-r1.ebuild
16 similarity index 80%
17 rename from sci-astronomy/casacore/casacore-2.3.0.ebuild
18 rename to sci-astronomy/casacore/casacore-2.3.0-r1.ebuild
19 index 60732fa5e8d..18e6cc0dcc7 100644
20 --- a/sci-astronomy/casacore/casacore-2.3.0.ebuild
21 +++ b/sci-astronomy/casacore/casacore-2.3.0-r1.ebuild
22 @@ -3,7 +3,7 @@
23
24 EAPI=6
25
26 -PYTHON_COMPAT=( python2_7 python3_{5,6} )
27 +PYTHON_COMPAT=( python2_7 python3_6 )
28
29 inherit cmake-utils eutils toolchain-funcs fortran-2 python-r1
30
31 @@ -14,7 +14,7 @@ SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
32 LICENSE="GPL-2"
33 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
34 SLOT="0"
35 -IUSE="c++11 +data doc fftw hdf5 openmp python threads test"
36 +IUSE="+c++11 +data doc fftw hdf5 openmp python threads test"
37 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
38
39 RDEPEND="
40 @@ -59,18 +59,19 @@ pkg_pretend() {
41 use openmp && tc-check-openmp
42 }
43
44 -pkg_setup() {
45 - use python && python-r1_pkg_setup
46 - fortran-2_pkg_setup
47 +src_prepare() {
48 + cmake-utils_src_prepare
49 + sed -e '/python-py/s/^.*$/find_package(Boost REQUIRED COMPONENTS python)/' \
50 + -e 's/3.5/3.6 3.5/' \
51 + -i python3/CMakeLists.txt || die
52 }
53
54 src_configure() {
55 has_version sci-libs/hdf5[mpi] && export CXX=mpicxx
56 local mycmakeargs=(
57 -DENABLE_SHARED=ON
58 - -DPYTHON_EXECUTABLE="${PYTHON}"
59 + -DBUILD_PYTHON=OFF
60 -DDATA_DIR="${EPREFIX}/usr/share/casa/data"
61 - -DBUILD_PYTHON="$(usex python)"
62 -DBUILD_TESTING="$(usex test)"
63 -DCXX11="$(usex c++11)"
64 -DUSE_FFTW3="$(usex fftw)"
65 @@ -78,6 +79,20 @@ src_configure() {
66 -DUSE_OPENMP="$(usex openmp)"
67 -DUSE_THREADS="$(usex threads)"
68 )
69 + python_set_options() {
70 + if python_is_python3; then
71 + mycmakeargs+=(
72 + -DPYTHON3_EXECUTABLE="${PYTHON}"
73 + -DBUILD_PYTHON3=ON
74 + )
75 + else
76 + mycmakeargs+=(
77 + -DPYTHON2_EXECUTABLE="${PYTHON}"
78 + -DBUILD_PYTHON=ON
79 + )
80 + fi
81 + }
82 + use python && python_foreach_impl python_set_options
83 cmake-utils_src_configure
84 }
85
86 @@ -93,5 +108,6 @@ src_install(){
87 if use doc; then
88 insinto /usr/share/doc/${PF}
89 doins -r doc/html
90 + docompress -x /usr/share/doc/${PF}/html
91 fi
92 }