dev-python/PyQt5-sip: add 4.19.19
[gentoo.git] / dev-python / PyQt5-sip / PyQt5-sip-4.19.19.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
7 inherit python-r1 toolchain-funcs
8
9 DESCRIPTION="Private sip module for PyQt5"
10 HOMEPAGE="https://www.riverbankcomputing.com/software/sip/intro"
11
12 MY_PN=sip
13 MY_P=${MY_PN}-${PV/_pre/.dev}
14 if [[ ${PV} == *_pre* ]]; then
15         SRC_URI="https://dev.gentoo.org/~pesa/distfiles/${MY_P}.tar.gz"
16 else
17         SRC_URI="https://www.riverbankcomputing.com/static/Downloads/${MY_PN}/${PV}/${MY_P}.tar.gz"
18 fi
19
20 # Sub-slot based on SIP_API_MAJOR_NR from siplib/sip.h
21 SLOT="0/12"
22 LICENSE="|| ( GPL-2 GPL-3 SIP )"
23 KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
24 IUSE=""
25
26 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
27
28 DEPEND="${PYTHON_DEPS}"
29 RDEPEND="${DEPEND}
30         !<dev-python/PyQt5-5.12.2
31 "
32
33 S=${WORKDIR}/${MY_P}
34
35 src_prepare() {
36         # Sub-slot sanity check
37         local sub_slot=${SLOT#*/}
38         local sip_api_major_nr=$(sed -nre 's:^#define SIP_API_MAJOR_NR\s+([0-9]+):\1:p' siplib/sip.h || die)
39         if [[ ${sub_slot} != ${sip_api_major_nr} ]]; then
40                 eerror
41                 eerror "Ebuild sub-slot (${sub_slot}) does not match SIP_API_MAJOR_NR (${sip_api_major_nr})"
42                 eerror "Please update SLOT variable as follows:"
43                 eerror "    SLOT=\"${SLOT%%/*}/${sip_api_major_nr}\""
44                 eerror
45                 die "sub-slot sanity check failed"
46         fi
47
48         default
49 }
50
51 src_configure() {
52         configuration() {
53                 if ! python_is_python3; then
54                         local CFLAGS="${CFLAGS} -fno-strict-aliasing"
55                 fi
56
57                 local myconf=(
58                         "${PYTHON}"
59                         "${S}"/configure.py
60                         --sip-module PyQt5.sip
61                         --sysroot="${ESYSROOT}/usr"
62                         --no-tools
63                         AR="$(tc-getAR) cqs"
64                         CC="$(tc-getCC)"
65                         CFLAGS="${CFLAGS}"
66                         CFLAGS_RELEASE=
67                         CXX="$(tc-getCXX)"
68                         CXXFLAGS="${CXXFLAGS}"
69                         CXXFLAGS_RELEASE=
70                         LINK="$(tc-getCXX)"
71                         LINK_SHLIB="$(tc-getCXX)"
72                         LFLAGS="${LDFLAGS}"
73                         LFLAGS_RELEASE=
74                         RANLIB=
75                         STRIP=
76                 )
77                 echo "${myconf[@]}"
78                 "${myconf[@]}" || die
79         }
80         python_foreach_impl run_in_build_dir configuration
81 }
82
83 src_compile() {
84         python_foreach_impl run_in_build_dir default
85 }
86
87 src_install() {
88         installation() {
89                 emake DESTDIR="${D}" install
90         }
91         python_foreach_impl run_in_build_dir installation
92
93         einstalldocs
94 }