Use https by default
[gentoo.git] / dev-python / PyQt4 / PyQt4-4.11.4.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6 PYTHON_COMPAT=( python{2_7,3_3,3_4} )
7
8 inherit eutils multibuild multilib python-r1 qmake-utils
9
10 DESCRIPTION="Python bindings for the Qt framework"
11 HOMEPAGE="http://www.riverbankcomputing.com/software/pyqt/intro
12         https://pypi.python.org/pypi/PyQt4"
13
14 MY_PN="PyQt-x11-gpl"
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"
18 else
19         MY_P=${MY_PN}-${PV}
20         SRC_URI="mirror://sourceforge/pyqt/${MY_P}.tar.gz"
21 fi
22
23 LICENSE="GPL-3"
24 SLOT="0"
25 KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
26
27 IUSE="X dbus debug declarative designer doc examples help kde multimedia
28         opengl phonon script scripttools sql svg testlib webkit xmlpatterns"
29 REQUIRED_USE="
30         ${PYTHON_REQUIRED_USE}
31         sql? ( X )
32         testlib? ( X )
33 "
34
35 # Minimal supported version of Qt.
36 QT_PV="4.8.5:4"
37
38 RDEPEND="
39         ${PYTHON_DEPS}
40         >=dev-python/sip-4.16.6:=[${PYTHON_USEDEP}]
41         >=dev-qt/qtcore-${QT_PV}
42         X? ( >=dev-qt/qtgui-${QT_PV} )
43         dbus? (
44                 dev-python/dbus-python[${PYTHON_USEDEP}]
45                 >=dev-qt/qtdbus-${QT_PV}
46         )
47         declarative? ( >=dev-qt/qtdeclarative-${QT_PV} )
48         designer? ( >=dev-qt/designer-${QT_PV} )
49         help? ( >=dev-qt/qthelp-${QT_PV} )
50         multimedia? ( >=dev-qt/qtmultimedia-${QT_PV} )
51         opengl? ( >=dev-qt/qtopengl-${QT_PV} )
52         phonon? (
53                 kde? ( >=media-libs/phonon-4.7[qt4] )
54                 !kde? ( || ( >=dev-qt/qtphonon-${QT_PV} >=media-libs/phonon-4.7[qt4] ) )
55         )
56         script? ( >=dev-qt/qtscript-${QT_PV} )
57         scripttools? ( >=dev-qt/qtgui-${QT_PV} )
58         sql? ( >=dev-qt/qtsql-${QT_PV} )
59         svg? ( >=dev-qt/qtsvg-${QT_PV} )
60         testlib? ( >=dev-qt/qttest-${QT_PV} )
61         webkit? ( >=dev-qt/qtwebkit-${QT_PV} )
62         xmlpatterns? ( >=dev-qt/qtxmlpatterns-${QT_PV} )
63 "
64 DEPEND="${RDEPEND}
65         dbus? ( virtual/pkgconfig )
66 "
67
68 S=${WORKDIR}/${MY_P}
69
70 src_prepare() {
71         # Support qreal on arm architecture (bug 322349).
72         use arm && epatch "${FILESDIR}/${PN}-4.7.3-qreal_float_support.patch"
73
74         # Allow building against KDE's phonon (bug 525354).
75         epatch "${FILESDIR}/${PN}-4.11.2-phonon.patch"
76 }
77
78 pyqt_use_enable() {
79         use $1 && echo --enable=${2:-Qt$(tr 'a-z' 'A-Z' <<< ${1:0:1})${1:1}}
80 }
81
82 src_configure() {
83         configuration() {
84                 local myconf=(
85                         "${PYTHON}"
86                         "${S}"/configure-ng.py
87                         $(use debug && echo --debug --trace)
88                         --verbose
89                         --confirm-license
90                         --qmake="$(qt4_get_bindir)"/qmake
91                         --destdir="$(python_get_sitedir)"
92                         --qsci-api
93                         --enable=QtCore
94                         --enable=QtNetwork
95                         --enable=QtXml
96                         $(pyqt_use_enable X QtGui)
97                         $(pyqt_use_enable dbus QtDBus)
98                         $(usex dbus '' --no-python-dbus)
99                         $(pyqt_use_enable declarative)
100                         $(pyqt_use_enable designer)
101                         $(usex designer '' --no-designer-plugin)
102                         $(pyqt_use_enable help)
103                         $(pyqt_use_enable multimedia)
104                         $(pyqt_use_enable opengl QtOpenGL)
105                         $(pyqt_use_enable phonon phonon)
106                         $(pyqt_use_enable script)
107                         $(pyqt_use_enable scripttools QtScriptTools)
108                         $(pyqt_use_enable sql)
109                         $(pyqt_use_enable svg)
110                         $(pyqt_use_enable testlib QtTest)
111                         $(pyqt_use_enable webkit QtWebKit)
112                         $(pyqt_use_enable xmlpatterns QtXmlPatterns)
113                 )
114                 echo "${myconf[@]}"
115                 "${myconf[@]}" || die
116
117                 eqmake4 -recursive ${PN}.pro
118         }
119         python_foreach_impl run_in_build_dir configuration
120 }
121
122 src_compile() {
123         python_foreach_impl run_in_build_dir default
124 }
125
126 src_install() {
127         installation() {
128                 local tmp_root=${D%/}/tmp
129                 emake INSTALL_ROOT="${tmp_root}" install
130
131                 local uic_dir=${tmp_root}$(python_get_sitedir)/${PN}/uic
132                 if python_is_python3; then
133                         rm -r "${uic_dir}"/port_v2 || die
134                 else
135                         rm -r "${uic_dir}"/port_v3 || die
136                 fi
137
138                 python_doexe "${tmp_root}${EPREFIX}"/usr/bin/pyuic4
139                 rm "${tmp_root}${EPREFIX}"/usr/bin/pyuic4 || die
140
141                 multibuild_merge_root "${tmp_root}" "${D}"
142                 python_optimize
143         }
144         python_foreach_impl run_in_build_dir installation
145
146         dodoc ChangeLog NEWS THANKS
147
148         if use doc; then
149                 dodoc -r doc/html
150         fi
151
152         if use examples; then
153                 insinto /usr/share/doc/${PF}
154                 doins -r examples
155         fi
156 }