/[gentoo-x86]/dev-python/PyQt4/PyQt4-4.8.6.ebuild
Gentoo

Contents of /dev-python/PyQt4/PyQt4-4.8.6.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Mon Feb 20 23:55:07 2012 UTC (7 years, 11 months ago) by pesa
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Add <upstream> tag to metadata. Cleanup old ebuilds and patches.

(Portage version: 2.2.0_alpha87/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-python/PyQt4/PyQt4-4.8.6.ebuild,v 1.2 2012/02/20 14:24:02 patrick Exp $
4
5 EAPI="3"
6 PYTHON_DEPEND="*"
7 PYTHON_EXPORT_PHASE_FUNCTIONS="1"
8 SUPPORT_PYTHON_ABIS="1"
9 RESTRICT_PYTHON_ABIS="*-jython 2.7-pypy-**"
10
11 inherit python qt4-r2 toolchain-funcs
12
13 MY_P="PyQt-x11-gpl-${PV/_pre/-snapshot-}"
14
15 # Minimal supported version of Qt.
16 QT_VER="4.6.2"
17
18 DESCRIPTION="Python bindings for the Qt toolkit"
19 HOMEPAGE="http://www.riverbankcomputing.co.uk/software/pyqt/intro/ http://pypi.python.org/pypi/PyQt"
20 SRC_URI="http://www.riverbankcomputing.com/static/Downloads/${PN}/${MY_P}.tar.gz"
21
22 LICENSE="|| ( GPL-2 GPL-3 )"
23 SLOT="0"
24 KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux"
25 IUSE="X assistant +dbus debug declarative doc examples kde multimedia opengl phonon sql svg webkit xmlpatterns"
26
27 DEPEND=">=dev-python/sip-4.12.2
28 >=x11-libs/qt-core-${QT_VER}:4
29 >=x11-libs/qt-script-${QT_VER}:4
30 >=x11-libs/qt-test-${QT_VER}:4
31 X? ( >=x11-libs/qt-gui-${QT_VER}:4[dbus?] )
32 assistant? ( >=x11-libs/qt-assistant-${QT_VER}:4 )
33 dbus? (
34 >=dev-python/dbus-python-0.80
35 >=x11-libs/qt-dbus-${QT_VER}:4
36 )
37 declarative? ( >=x11-libs/qt-declarative-${QT_VER}:4 )
38 multimedia? ( >=x11-libs/qt-multimedia-${QT_VER}:4 )
39 opengl? ( >=x11-libs/qt-opengl-${QT_VER}:4 || ( >=x11-libs/qt-opengl-4.7.0:4[-egl] <x11-libs/qt-opengl-4.7.0:4 ) )
40 phonon? (
41 !kde? ( || ( >=x11-libs/qt-phonon-${QT_VER}:4 media-libs/phonon ) )
42 kde? ( media-libs/phonon )
43 )
44 sql? ( >=x11-libs/qt-sql-${QT_VER}:4 )
45 svg? ( >=x11-libs/qt-svg-${QT_VER}:4 )
46 webkit? ( >=x11-libs/qt-webkit-${QT_VER}:4 )
47 xmlpatterns? ( >=x11-libs/qt-xmlpatterns-${QT_VER}:4 )"
48 RDEPEND="${DEPEND}"
49
50 S="${WORKDIR}/${MY_P}"
51
52 PATCHES=(
53 "${FILESDIR}/${PN}-4.7.2-configure.py.patch"
54 )
55
56 src_prepare() {
57 if ! use dbus; then
58 sed -e "s/^\([[:blank:]]\+\)check_dbus()/\1pass/" -i configure.py || die "sed configure.py failed"
59 fi
60
61 # Support qreal for arm architecture (bug #322349).
62 use arm && epatch "${FILESDIR}/${PN}-4.7.3-qreal_float_support.patch"
63
64 qt4-r2_src_prepare
65
66 # Use proper include directory.
67 sed -e "s:/usr/include:${EPREFIX}/usr/include:g" -i configure.py || die "sed configure.py failed"
68
69 python_copy_sources
70
71 preparation() {
72 if [[ "$(python_get_version --major)" == "3" ]]; then
73 rm -fr pyuic/uic/port_v2
74 else
75 rm -fr pyuic/uic/port_v3
76 fi
77 }
78 python_execute_function -s preparation
79 }
80
81 pyqt4_use_enable() {
82 use $1 && echo "--enable=${2:-$1}"
83 }
84
85 src_configure() {
86 configuration() {
87 local myconf=("$(PYTHON)"
88 configure.py
89 --confirm-license
90 --bindir="${EPREFIX}/usr/bin"
91 --destdir="${EPREFIX}$(python_get_sitedir)"
92 --sipdir="${EPREFIX}/usr/share/sip"
93 --qsci-api
94 $(use debug && echo --debug)
95 --enable=QtCore
96 --enable=QtNetwork
97 --enable=QtScript
98 --enable=QtTest
99 --enable=QtXml
100 $(pyqt4_use_enable X QtDesigner)
101 $(pyqt4_use_enable X QtGui)
102 $(pyqt4_use_enable X QtScriptTools)
103 # QtAssistant module is not available with Qt >=4.7.0.
104 $(pyqt4_use_enable assistant QtAssistant)
105 $(pyqt4_use_enable assistant QtHelp)
106 $(pyqt4_use_enable declarative QtDeclarative)
107 $(pyqt4_use_enable multimedia QtMultimedia)
108 $(pyqt4_use_enable opengl QtOpenGL)
109 $(pyqt4_use_enable phonon)
110 $(pyqt4_use_enable sql QtSql)
111 $(pyqt4_use_enable svg QtSvg)
112 $(pyqt4_use_enable webkit QtWebKit)
113 $(pyqt4_use_enable xmlpatterns QtXmlPatterns)
114 CC="$(tc-getCC)"
115 CXX="$(tc-getCXX)"
116 LINK="$(tc-getCXX)"
117 LINK_SHLIB="$(tc-getCXX)"
118 CFLAGS="${CFLAGS}"
119 CXXFLAGS="${CXXFLAGS}"
120 LFLAGS="${LDFLAGS}")
121 echo "${myconf[@]}"
122 "${myconf[@]}" || return 1
123
124 local mod
125 for mod in QtCore $(use X && echo QtDesigner QtGui) $(use declarative && echo QtDeclarative) $(use opengl && echo QtOpenGL); do
126 # Run eqmake4 inside the qpy subdirectories to respect CC, CXX, CFLAGS, CXXFLAGS and LDFLAGS and avoid stripping.
127 pushd qpy/${mod} > /dev/null || return 1
128 eqmake4 $(ls w_qpy*.pro)
129 popd > /dev/null || return 1
130
131 # Fix insecure runpaths.
132 sed -e "/^LFLAGS[[:space:]]*=/s:-Wl,-rpath,${BUILDDIR}/qpy/${mod}::" -i ${mod}/Makefile || die "Fixing of runpaths failed"
133 done
134
135 # Avoid stripping of libpythonplugin.so.
136 if use X; then
137 pushd designer > /dev/null || return 1
138 eqmake4 python.pro
139 popd > /dev/null || return 1
140 fi
141 }
142 python_execute_function -s configuration
143 }
144
145 src_compile() {
146 python_src_compile
147 }
148
149 src_install() {
150 installation() {
151 # INSTALL_ROOT is needed for the QtDesigner module, other Makefiles use DESTDIR.
152 emake DESTDIR="${D}" INSTALL_ROOT="${D}" install
153 }
154 python_execute_function -s installation
155
156 dodoc NEWS THANKS || die "dodoc failed"
157
158 if use doc; then
159 dohtml -r doc/html/* || die "dohtml failed"
160 fi
161
162 if use examples; then
163 insinto /usr/share/doc/${PF}
164 doins -r examples || die "doins failed"
165 fi
166 }
167
168 pkg_postinst() {
169 python_mod_optimize PyQt4
170
171 ewarn "When updating dev-python/PyQt4, you usually need to rebuild packages, which depend on"
172 ewarn "dev-python/PyQt4, such as dev-python/qscintilla-python. If you have app-portage/gentoolkit"
173 ewarn "installed, you can find these packages with \`equery d dev-python/PyQt4\`."
174 }
175
176 pkg_postrm() {
177 python_mod_cleanup PyQt4
178 }

  ViewVC Help
Powered by ViewVC 1.1.20