]> git.friedersdorff.com Git - max/gentoo-overlay.git/blob - dev-python/PyQtWebEngine/PyQtWebEngine-5.12.1.ebuild
Merge branch 'master' of git.friedersdorff.com:max/gentoo-overlay
[max/gentoo-overlay.git] / dev-python / PyQtWebEngine / PyQtWebEngine-5.12.1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Copyright 2019 Maximilian Friedersdorff
3 # Distributed under the terms of the GNU General Public License v2
4
5 EAPI=7
6
7 PYTHON_COMPAT=( python2_7 python3_{4,5,6,7} )
8 inherit multibuild python-r1 qmake-utils
9
10 DESCRIPTION="Python bindings for the Qt framework"
11 HOMEPAGE="https://www.riverbankcomputing.com/software/pyqtwebengine/intro"
12
13 MY_P=${PN}_gpl-${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/PyQtWebEngine/${PV}/PyQtWebEngine_gpl-${PV}.tar.gz"
18 fi
19
20 LICENSE="GPL-3"
21 SLOT="0"
22 KEYWORDS="~amd64 ~arm ~arm64 ~x86"
23
24 IUSE="debug examples widgets"
25
26 # The requirements below were extracted from configure.py
27 # and from the output of 'grep -r "%Import " "${S}"/sip'
28 REQUIRED_USE="
29         ${PYTHON_REQUIRED_USE}
30 "
31
32 # Minimal supported version of Qt.
33 QT_PV="5.10:5"
34
35 RDEPEND="
36         ${PYTHON_DEPS}
37         >=dev-python/PyQt5-5.12_pre[widgets?]
38         >=dev-qt/qtwebengine-${QT_PV}[widgets?]
39         widgets? ( >=dev-qt/qtwidgets-${QT_PV} )
40 "
41 DEPEND="${RDEPEND}
42         >=dev-python/sip-4.19.14_pre[${PYTHON_USEDEP}]
43 "
44
45 S=${WORKDIR}/${MY_P}
46
47 pyqt_use_enable() {
48         use "$1" || return
49
50         if [[ $# -eq 1 ]]; then
51                 echo --enable=Qt$(tr 'a-z' 'A-Z' <<< ${1:0:1})${1:1}
52         else
53                 shift
54                 echo ${@/#/--enable=}
55         fi
56 }
57
58 src_configure() {
59         configuration() {
60                 local myconf=(
61                         "${PYTHON}"
62                         "${S}"/configure.py
63                         $(usex debug '--debug --qml-debug --trace' '')
64                         --verbose
65                         --qmake="$(qt5_get_bindir)"/qmake
66                         --sip-incdir="$(python_get_includedir)"
67                 )
68                 echo "${myconf[@]}"
69                 "${myconf[@]}" || die
70
71                 eqmake5 -recursive ${PN}.pro
72         }
73         python_foreach_impl run_in_build_dir configuration
74 }
75
76 src_compile() {
77         python_foreach_impl run_in_build_dir default
78 }
79
80 src_install() {
81         installation() {
82                 local tmp_root=${D}/${PN}_tmp_root
83                 # parallel install fails (same issue as qscintilla-python-2.10.8)
84                 emake -j1 INSTALL_ROOT="${tmp_root}" install
85
86                 multibuild_merge_root "${tmp_root}" "${D}"
87                 python_optimize
88         }
89         python_foreach_impl run_in_build_dir installation
90
91         einstalldocs
92
93         if use examples; then
94                 insinto /usr/share/doc/${PF}
95                 doins -r examples
96         fi
97 }