Gentoo Archives: gentoo-commits

From: Justin Lecher <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: sci-libs/shtools/
Date: Sun, 29 Jan 2017 11:59:32
Message-Id: 1485691162.b41f534524a6add32b78ff817576d8640a52b59a.jlec@gentoo
1 commit: b41f534524a6add32b78ff817576d8640a52b59a
2 Author: Justin Lecher <jlec <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 29 11:22:47 2017 +0000
4 Commit: Justin Lecher <jlec <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 29 11:59:22 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=b41f5345
7
8 sci-libs/shtools: Multiple QA enhancements
9
10 Properly handle fortran
11 Properly handle multiple python versions
12 fix doc installation dir respect FCFLAGS, AR, FC, RANLIB
13 Add support for static-libs
14 Drop unnecessary . from DESCRIPTION
15
16 Package-Manager: Portage-2.3.3, Repoman-2.3.1
17 Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>
18
19 sci-libs/shtools/shtools-4.0.ebuild | 59 +++++++++++++++++++++++++++----------
20 1 file changed, 43 insertions(+), 16 deletions(-)
21
22 diff --git a/sci-libs/shtools/shtools-4.0.ebuild b/sci-libs/shtools/shtools-4.0.ebuild
23 index 149c2bb..43bf743 100644
24 --- a/sci-libs/shtools/shtools-4.0.ebuild
25 +++ b/sci-libs/shtools/shtools-4.0.ebuild
26 @@ -5,7 +5,7 @@
27 EAPI=6
28
29 if [[ ${PV} == 9999 ]]; then
30 - ECLASS="git-r3"
31 + _ECLASS="git-r3"
32 EGIT_REPO_URI="https://github.com/heroxbd/${PN^^}.git"
33 S="${WORKDIR}"/${P}
34 else
35 @@ -14,38 +14,65 @@ else
36 S="${WORKDIR}"/${PN^^}-${PV/_/-}
37 fi
38
39 -PYTHON_COMPAT=( python2_7 )
40 +PYTHON_COMPAT=( python{2_7,3_{4,5}} )
41
42 -inherit python-r1 flag-o-matic toolchain-funcs ${ECLASS}
43 +inherit fortran-2 flag-o-matic python-single-r1 toolchain-funcs ${_ECLASS}
44
45 -DESCRIPTION="Spherical harmonic transforms and reconstructions, rotations."
46 +DESCRIPTION="Spherical harmonic transforms and reconstructions, rotations"
47 HOMEPAGE="http://shtools.ipgp.fr"
48
49 LICENSE="BSD-4"
50 SLOT="0"
51 KEYWORDS="~amd64"
52 +IUSE="static-libs"
53
54 -RDEPEND="sci-libs/fftw:*
55 - sys-devel/gcc:*[fortran]
56 +RDEPEND="
57 + dev-python/numpy[${PYTHON_USEDEP}]
58 + dev-python/matplotlib[${PYTHON_USEDEP}]
59 + sci-libs/fftw:3.0=
60 virtual/lapack
61 virtual/blas
62 - dev-python/numpy
63 - dev-python/matplotlib
64 ${PYTHON_DEPS}"
65
66 -DEPEND="${RDEPEND}"
67 +DEPEND="${RDEPEND}
68 + virtual/pkgconfig
69 +"
70
71 -src_compile() {
72 +src_prepare() {
73 append-ldflags -shared # needed by f2py
74 - # needed by f2py in fortran 77 mode
75 - use amd64 && append-fflags -fPIC
76 - OPTS=( LAPACK=$($(tc-getPKG_CONFIG) lapack --libs-only-l)
77 + # needed by f2py in fortran 77 mode
78 + append-fflags -fPIC
79 + [[ $(tc-getFC) =~ gfortran ]] && append-fflags -fno-second-underscore
80 + export _pyver=$(python_is_python3 && echo 3 || echo 2)
81 + export OPTS=(
82 + LAPACK=$($(tc-getPKG_CONFIG) lapack --libs-only-l)
83 BLAS=$($(tc-getPKG_CONFIG) blas --libs-only-l)
84 FFTW=$($(tc-getPKG_CONFIG) fftw3 --libs-only-l)
85 - PYTHON_VERSION=2 )
86 - emake python ${OPTS[@]}
87 + F95=$(tc-getFC)
88 + F95FLAGS="${FCFLAGS}"
89 + AR=$(tc-getAR)
90 + RLIB=$(tc-getRANLIB)
91 + PYTHON_VERSION=${_pyver}
92 + )
93 +
94 + sed \
95 + -e '/mv/s:.so:*.so:g' \
96 + -e "/SYSDOCPATH/s:${PN}:${PF}:g" \
97 + -e "/www/s:/$:/html/:g" \
98 + -i Makefile || die
99 +
100 + default
101 +}
102 +
103 +src_compile() {
104 + emake fortran "${OPTS[@]}"
105 + emake python${_pyver} "${OPTS[@]}"
106 }
107
108 src_install() {
109 - emake PREFIX="${EPREFIX}/usr" DESTDIR="${D}" ${OPTS[@]} install
110 + emake PREFIX="${EPREFIX}/usr" DESTDIR="${D}" "${OPTS[@]}" install-fortran
111 + emake PREFIX="${EPREFIX}/usr" DESTDIR="${D}" "${OPTS[@]}" install-python${_pyver}
112 + if ! use static-libs; then
113 + rm -rf "${ED}"/usr/$(get_libdir)/*.a || die
114 + fi
115 }