1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
7 inherit multibuild python-r1 qmake-utils
9 DESCRIPTION="Python bindings for the Qt framework"
10 HOMEPAGE="https://www.riverbankcomputing.com/software/pyqt/intro"
13 MY_P=${MY_PN}_gpl-${PV/_pre/.dev}
14 if [[ ${PV} == *_pre* ]]; then
15 SRC_URI="https://dev.gentoo.org/~pesa/distfiles/${MY_P}.tar.gz"
17 SRC_URI="https://www.riverbankcomputing.com/static/Downloads/${MY_PN}/${PV}/${MY_P}.tar.gz"
22 KEYWORDS="amd64 arm arm64 ~ppc ~ppc64 x86"
24 # TODO: QtNetworkAuth, QtNfc
25 IUSE="bluetooth dbus debug declarative designer examples gles2 gui help location
26 multimedia network opengl positioning printsupport sensors serialport sql svg
27 testlib webchannel webengine webkit websockets widgets x11extras xmlpatterns"
29 # The requirements below were extracted from configure.py
30 # and from the output of 'grep -r "%Import " "${S}"/sip'
32 ${PYTHON_REQUIRED_USE}
34 declarative? ( gui network )
37 location? ( positioning )
38 multimedia? ( gui network )
39 opengl? ( gui widgets )
41 printsupport? ( gui widgets )
47 webchannel? ( network )
48 webengine? ( network widgets? ( printsupport webchannel ) )
49 webkit? ( gui network printsupport widgets )
50 websockets? ( network )
52 xmlpatterns? ( network )
55 # Minimal supported version of Qt.
60 >=dev-python/sip-4.19.6:=[${PYTHON_USEDEP}]
61 >=dev-qt/qtcore-${QT_PV}
62 >=dev-qt/qtxml-${QT_PV}
63 bluetooth? ( >=dev-qt/qtbluetooth-${QT_PV} )
65 dev-python/dbus-python[${PYTHON_USEDEP}]
66 >=dev-qt/qtdbus-${QT_PV}
68 declarative? ( >=dev-qt/qtdeclarative-${QT_PV}[widgets?] )
69 designer? ( >=dev-qt/designer-${QT_PV} )
70 gui? ( >=dev-qt/qtgui-${QT_PV}[gles2=] )
71 help? ( >=dev-qt/qthelp-${QT_PV} )
72 location? ( >=dev-qt/qtlocation-${QT_PV} )
73 multimedia? ( >=dev-qt/qtmultimedia-${QT_PV}[widgets?] )
74 network? ( >=dev-qt/qtnetwork-${QT_PV} )
75 opengl? ( >=dev-qt/qtopengl-${QT_PV} )
76 positioning? ( >=dev-qt/qtpositioning-${QT_PV} )
77 printsupport? ( >=dev-qt/qtprintsupport-${QT_PV} )
78 sensors? ( >=dev-qt/qtsensors-${QT_PV} )
79 serialport? ( >=dev-qt/qtserialport-${QT_PV} )
80 sql? ( >=dev-qt/qtsql-${QT_PV} )
81 svg? ( >=dev-qt/qtsvg-${QT_PV} )
82 testlib? ( >=dev-qt/qttest-${QT_PV} )
83 webchannel? ( >=dev-qt/qtwebchannel-${QT_PV} )
84 webengine? ( >=dev-qt/qtwebengine-${QT_PV}[widgets?] )
85 webkit? ( >=dev-qt/qtwebkit-5.9:5[printsupport] )
86 websockets? ( >=dev-qt/qtwebsockets-${QT_PV} )
87 widgets? ( >=dev-qt/qtwidgets-${QT_PV} )
88 x11extras? ( >=dev-qt/qtx11extras-${QT_PV} )
89 xmlpatterns? ( >=dev-qt/qtxmlpatterns-${QT_PV} )
92 dbus? ( virtual/pkgconfig )
97 DOCS=( "${S}"/{ChangeLog,NEWS} )
100 "${FILESDIR}/${P}-timeline.patch"
101 "${FILESDIR}/${P}-fix-testlib.patch"
107 if [[ $# -eq 1 ]]; then
108 echo --enable=Qt$(tr 'a-z' 'A-Z' <<< ${1:0:1})${1:1}
111 echo ${@/#/--enable=}
120 $(usex debug '--debug --qml-debug --trace' '')
123 --qmake="$(qt5_get_bindir)"/qmake
124 --bindir="${EPREFIX}/usr/bin"
125 --destdir="$(python_get_sitedir)"
126 --sip-incdir="$(python_get_includedir)"
130 $(pyqt_use_enable bluetooth)
131 $(pyqt_use_enable dbus QtDBus)
132 $(usex dbus '' --no-python-dbus)
133 $(pyqt_use_enable declarative QtQml QtQuick $(usex widgets QtQuickWidgets ''))
134 $(usex declarative '' --no-qml-plugin)
135 $(pyqt_use_enable designer)
136 $(usex designer '' --no-designer-plugin)
137 $(pyqt_use_enable gui)
138 $(pyqt_use_enable gui $(use gles2 && echo _QOpenGLFunctions_ES2 || echo _QOpenGLFunctions_{2_0,2_1,4_1_Core}))
139 $(pyqt_use_enable help)
140 $(pyqt_use_enable location)
141 $(pyqt_use_enable multimedia QtMultimedia $(usex widgets QtMultimediaWidgets ''))
142 $(pyqt_use_enable network)
143 $(pyqt_use_enable opengl QtOpenGL)
144 $(pyqt_use_enable positioning)
145 $(pyqt_use_enable printsupport QtPrintSupport)
146 $(pyqt_use_enable sensors)
147 $(pyqt_use_enable serialport QtSerialPort)
148 $(pyqt_use_enable sql)
149 $(pyqt_use_enable svg)
150 $(pyqt_use_enable testlib QtTest)
151 $(pyqt_use_enable webchannel QtWebChannel)
152 $(pyqt_use_enable webengine QtWebEngine QtWebEngineCore $(usex widgets QtWebEngineWidgets ''))
153 $(pyqt_use_enable webkit QtWebKit QtWebKitWidgets)
154 $(pyqt_use_enable websockets QtWebSockets)
155 $(pyqt_use_enable widgets)
156 $(pyqt_use_enable x11extras QtX11Extras)
157 $(pyqt_use_enable xmlpatterns QtXmlPatterns)
160 "${myconf[@]}" || die
162 eqmake5 -recursive ${MY_PN}.pro
164 python_foreach_impl run_in_build_dir configuration
168 python_foreach_impl run_in_build_dir default
173 local tmp_root=${D%/}/${PN}_tmp_root
174 emake INSTALL_ROOT="${tmp_root}" install
176 local bin_dir=${tmp_root}${EPREFIX}/usr/bin
178 for exe in pylupdate5 pyrcc5 pyuic5; do
179 python_doexe "${bin_dir}/${exe}"
180 rm "${bin_dir}/${exe}" || die
183 local uic_dir=${tmp_root}$(python_get_sitedir)/${PN}/uic
184 if python_is_python3; then
185 rm -r "${uic_dir}"/port_v2 || die
187 rm -r "${uic_dir}"/port_v3 || die
190 multibuild_merge_root "${tmp_root}" "${D}"
193 python_foreach_impl run_in_build_dir installation
197 if use examples; then
198 insinto /usr/share/doc/${PF}