--- /dev/null
+# Copyright 1999-2019 Gentoo Authors
+# Copyright 2019 Maximilian Friedersdorff
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python2_7 python3_{4,5,6,7} )
+inherit multibuild python-r1 qmake-utils
+
+DESCRIPTION="Python bindings for the Qt framework"
+HOMEPAGE="https://www.riverbankcomputing.com/software/pyqtwebengine/intro"
+
+MY_P=${PN}_gpl-${PV/_pre/.dev}
+if [[ ${PV} == *_pre* ]]; then
+ SRC_URI="https://dev.gentoo.org/~pesa/distfiles/${MY_P}.tar.gz"
+else
+ SRC_URI="https://www.riverbankcomputing.com/static/Downloads/PyQtWebEngine/PyQtWebEngine_gpl-${PV}.tar.gz"
+fi
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+
+IUSE="debug examples widgets"
+
+# The requirements below were extracted from configure.py
+# and from the output of 'grep -r "%Import " "${S}"/sip'
+REQUIRED_USE="
+ ${PYTHON_REQUIRED_USE}
+"
+
+# Minimal supported version of Qt.
+QT_PV="5.10:5"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ >=dev-python/PyQt5-5.12_pre[widgets?]
+ >=dev-qt/qtwebengine-${QT_PV}[widgets?]
+ widgets? ( >=dev-qt/qtwidgets-${QT_PV} )
+"
+DEPEND="${RDEPEND}
+ >=dev-python/sip-4.19.14_pre[${PYTHON_USEDEP}]
+"
+
+S=${WORKDIR}/${MY_P}
+
+pyqt_use_enable() {
+ use "$1" || return
+
+ if [[ $# -eq 1 ]]; then
+ echo --enable=Qt$(tr 'a-z' 'A-Z' <<< ${1:0:1})${1:1}
+ else
+ shift
+ echo ${@/#/--enable=}
+ fi
+}
+
+src_configure() {
+ configuration() {
+ local myconf=(
+ "${PYTHON}"
+ "${S}"/configure.py
+ $(usex debug '--debug --qml-debug --trace' '')
+ --verbose
+ --qmake="$(qt5_get_bindir)"/qmake
+ --sip-incdir="$(python_get_includedir)"
+ )
+ echo "${myconf[@]}"
+ "${myconf[@]}" || die
+
+ eqmake5 -recursive ${PN}.pro
+ }
+ python_foreach_impl run_in_build_dir configuration
+}
+
+src_compile() {
+ python_foreach_impl run_in_build_dir default
+}
+
+src_install() {
+ installation() {
+ local tmp_root=${D}/${PN}_tmp_root
+ # parallel install fails (same issue as qscintilla-python-2.10.8)
+ emake -j1 INSTALL_ROOT="${tmp_root}" install
+
+ multibuild_merge_root "${tmp_root}" "${D}"
+ python_optimize
+ }
+ python_foreach_impl run_in_build_dir installation
+
+ einstalldocs
+
+ if use examples; then
+ insinto /usr/share/doc/${PF}
+ doins -r examples
+ fi
+}