dev-perl/Class-Inspector: amd64 stable
[gentoo.git] / dev-python / pyqwt / pyqwt-5.2.0-r2.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 PYTHON_COMPAT=( python2_7 )
7
8 inherit flag-o-matic python-r1 qmake-utils
9
10 DESCRIPTION="Python bindings for the Qwt library"
11 HOMEPAGE="http://pyqwt.sourceforge.net/"
12 MY_P="PyQwt-${PV}"
13 SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
14
15 SLOT="5"
16 LICENSE="GPL-2"
17 KEYWORDS="amd64 arm ia64 x86"
18 IUSE="debug doc examples svg"
19 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
20
21 RDEPEND="${PYTHON_DEPS}
22         dev-python/numpy[${PYTHON_USEDEP}]
23         dev-python/PyQt4[${PYTHON_USEDEP},compat(+)]
24         dev-python/sip[${PYTHON_USEDEP}]
25         x11-libs/qwt:5[svg?]"
26 DEPEND="${RDEPEND}
27         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )"
28
29 S=${WORKDIR}/${MY_P}/configure
30
31 src_prepare() {
32         sed -i -e "s|configuration.qt_dir, 'bin'|'$(qt4_get_bindir)'|" configure.py || die
33         python_copy_sources
34         append-flags -fPIC
35 }
36
37 src_configure() {
38         configuration() {
39                 local myconf=()
40                 use debug && myconf+=( --debug )
41
42                 cd "${BUILD_DIR}" || die
43                 # '-j' option can be buggy.
44                 "${PYTHON}" configure.py \
45                         --extra-cflags="${CFLAGS}" \
46                         --extra-cxxflags="${CXXFLAGS}" \
47                         --extra-lflags="${LDFLAGS}" \
48                         --disable-numarray \
49                         --disable-numeric \
50                         -I/usr/include/qwt5 \
51                         -lqwt \
52                         ${myconf[@]} \
53                         || die "configure.py failed"
54
55                 # Avoid stripping of the libraries.
56                 sed -i -e "/strip/d" {iqt5qt4,qwt5qt4}/Makefile || die "sed failed"
57         }
58         python_foreach_impl configuration
59 }
60
61 src_compile() {
62         compilation() {
63                 cd "${BUILD_DIR}" || die
64                 default
65         }
66         python_foreach_impl compilation
67
68         if use doc; then
69                 cd "${S}"/../sphinx || die
70                 emake
71         fi
72 }
73
74 src_install() {
75         installation() {
76                 cd "${BUILD_DIR}" || die
77                 emake DESTDIR="${D}" install
78         }
79         python_foreach_impl installation
80
81         cd "${S}"/.. || die
82
83         dodoc ANNOUNCEMENT-${PV} README
84
85         use doc && dodoc -r sphinx/build/.
86         if use examples; then
87                 docinto examples
88                 dodoc -r qt4examples/.
89         fi
90 }