1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python{2_7,3_3,3_4} )
8 inherit eutils multibuild multilib python-r1 qmake-utils
10 DESCRIPTION="Python bindings for the Qt framework"
11 HOMEPAGE="http://www.riverbankcomputing.com/software/pyqt/intro
12 https://pypi.python.org/pypi/PyQt5"
15 if [[ ${PV} == *_pre* ]]; then
16 MY_P=${MY_PN}-${PV%_pre*}-snapshot-${REVISION}
17 SRC_URI="https://dev.gentoo.org/~pesa/distfiles/${MY_P}.tar.xz"
20 SRC_URI="mirror://sourceforge/pyqt/${MY_P}.tar.gz"
25 KEYWORDS="~amd64 ~arm ~x86"
27 # TODO: QtBluetooth, QtWebEngineWidgets
28 IUSE="dbus debug declarative designer doc examples gles2 gui help multimedia
29 network opengl positioning printsupport sensors serialport sql svg
30 testlib webchannel webkit websockets widgets x11extras xmlpatterns"
32 ${PYTHON_REQUIRED_USE}
38 webchannel? ( network )
41 # Minimal supported version of Qt.
46 >=dev-python/sip-4.16.6:=[${PYTHON_USEDEP}]
47 >=dev-qt/qtcore-${QT_PV}
48 >=dev-qt/qtxml-${QT_PV}
50 dev-python/dbus-python[${PYTHON_USEDEP}]
51 >=dev-qt/qtdbus-${QT_PV}
53 declarative? ( >=dev-qt/qtdeclarative-${QT_PV}[widgets?] )
54 designer? ( >=dev-qt/designer-${QT_PV} )
55 gui? ( >=dev-qt/qtgui-${QT_PV}[gles2=] )
56 help? ( >=dev-qt/qthelp-${QT_PV} )
57 multimedia? ( >=dev-qt/qtmultimedia-${QT_PV}[widgets?] )
58 network? ( >=dev-qt/qtnetwork-${QT_PV} )
59 opengl? ( >=dev-qt/qtopengl-${QT_PV} )
60 positioning? ( >=dev-qt/qtpositioning-${QT_PV} )
61 printsupport? ( >=dev-qt/qtprintsupport-${QT_PV} )
62 sensors? ( >=dev-qt/qtsensors-${QT_PV} )
63 serialport? ( >=dev-qt/qtserialport-${QT_PV} )
64 sql? ( >=dev-qt/qtsql-${QT_PV} )
65 svg? ( >=dev-qt/qtsvg-${QT_PV} )
66 testlib? ( >=dev-qt/qttest-${QT_PV} )
67 webchannel? ( >=dev-qt/qtwebchannel-${QT_PV} )
68 webkit? ( >=dev-qt/qtwebkit-${QT_PV}[printsupport] )
69 websockets? ( >=dev-qt/qtwebsockets-${QT_PV} )
70 widgets? ( >=dev-qt/qtwidgets-${QT_PV} )
71 x11extras? ( >=dev-qt/qtx11extras-${QT_PV} )
72 xmlpatterns? ( >=dev-qt/qtxmlpatterns-${QT_PV} )
75 dbus? ( virtual/pkgconfig )
81 # Avoid automagic dependency.
82 use dbus || rm -fr dbus
88 if [[ $# -eq 1 ]]; then
89 echo --enable=Qt$(tr 'a-z' 'A-Z' <<< ${1:0:1})${1:1}
101 $(use debug && echo --debug --trace)
104 --qmake="$(qt5_get_bindir)"/qmake
105 --destdir="$(python_get_sitedir)"
109 $(pyqt_use_enable dbus QtDBus)
110 $(pyqt_use_enable declarative QtQml QtQuick $(usex widgets QtQuickWidgets ''))
111 $(usex declarative '' --no-qml-plugin)
112 $(pyqt_use_enable designer)
113 $(usex designer '' --no-designer-plugin)
114 $(pyqt_use_enable gui)
115 $(pyqt_use_enable gui $(use gles2 && echo _QOpenGLFunctions_ES2 || echo _QOpenGLFunctions_{2_0,2_1,4_1_Core}))
116 $(pyqt_use_enable help)
117 $(pyqt_use_enable multimedia QtMultimedia $(usex widgets QtMultimediaWidgets ''))
118 $(pyqt_use_enable network)
119 $(pyqt_use_enable opengl QtOpenGL)
120 $(pyqt_use_enable positioning)
121 $(pyqt_use_enable printsupport QtPrintSupport)
122 $(pyqt_use_enable sensors)
123 $(pyqt_use_enable serialport QtSerialPort)
124 $(pyqt_use_enable sql)
125 $(pyqt_use_enable svg)
126 $(pyqt_use_enable testlib QtTest)
127 $(pyqt_use_enable webchannel QtWebChannel)
128 $(pyqt_use_enable webkit QtWebKit QtWebKitWidgets)
129 $(pyqt_use_enable websockets QtWebSockets)
130 $(pyqt_use_enable widgets)
131 $(pyqt_use_enable x11extras QtX11Extras)
132 $(pyqt_use_enable xmlpatterns QtXmlPatterns)
135 "${myconf[@]}" || die
137 eqmake5 -recursive ${PN}.pro
139 python_foreach_impl run_in_build_dir configuration
143 python_foreach_impl run_in_build_dir default
148 local tmp_root=${D%/}/tmp
149 emake INSTALL_ROOT="${tmp_root}" install
151 local uic_dir=${tmp_root}$(python_get_sitedir)/${PN}/uic
152 if python_is_python3; then
153 rm -r "${uic_dir}"/port_v2 || die
155 rm -r "${uic_dir}"/port_v3 || die
158 python_doexe "${tmp_root}${EPREFIX}"/usr/bin/pyuic5
159 rm "${tmp_root}${EPREFIX}"/usr/bin/pyuic5 || die
161 multibuild_merge_root "${tmp_root}" "${D}"
164 python_foreach_impl run_in_build_dir installation
172 if use examples; then
173 insinto /usr/share/doc/${PF}