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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Mon Feb 20 23:55:07 2012 UTC (8 years ago) by pesa
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +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.9.ebuild,v 1.4 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.13.1
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.8.0: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 PYTHON_VERSIONED_EXECUTABLES=("/usr/bin/pyuic4")
57
58 src_prepare() {
59 if ! use dbus; then
60 sed -e "s/^\([[:blank:]]\+\)check_dbus()/\1pass/" -i configure.py || die "sed configure.py failed"
61 fi
62
63 # Support qreal for arm architecture (bug #322349).
64 use arm && epatch "${FILESDIR}/${PN}-4.7.3-qreal_float_support.patch"
65
66 qt4-r2_src_prepare
67
68 # Use proper include directory.
69 sed -e "s:/usr/include:${EPREFIX}/usr/include:g" -i configure.py || die "sed configure.py failed"
70
71 python_copy_sources
72
73 preparation() {
74 if [[ "$(python_get_version -l --major)" == "3" ]]; then
75 rm -fr pyuic/uic/port_v2
76 else
77 rm -fr pyuic/uic/port_v3
78 fi
79 }
80 python_execute_function -s preparation
81 }
82
83 pyqt4_use_enable() {
84 use $1 && echo "--enable=${2:-$1}"
85 }
86
87 src_configure() {
88 configuration() {
89 local myconf=("$(PYTHON)"
90 configure.py
91 --confirm-license
92 --bindir="${EPREFIX}/usr/bin"
93 --destdir="${EPREFIX}$(python_get_sitedir)"
94 --sipdir="${EPREFIX}/usr/share/sip"
95 --qsci-api
96 $(use debug && echo --debug)
97 --enable=QtCore
98 --enable=QtNetwork
99 --enable=QtScript
100 --enable=QtTest
101 --enable=QtXml
102 $(pyqt4_use_enable X QtDesigner)
103 $(pyqt4_use_enable X QtGui)
104 $(pyqt4_use_enable X QtScriptTools)
105 # QtAssistant module is not available with Qt >=4.7.0.
106 $(pyqt4_use_enable assistant QtAssistant)
107 $(pyqt4_use_enable assistant QtHelp)
108 $(pyqt4_use_enable dbus QtDBus)
109 $(pyqt4_use_enable declarative QtDeclarative)
110 $(pyqt4_use_enable multimedia QtMultimedia)
111 $(pyqt4_use_enable opengl QtOpenGL)
112 $(pyqt4_use_enable phonon)
113 $(pyqt4_use_enable sql QtSql)
114 $(pyqt4_use_enable svg QtSvg)
115 $(pyqt4_use_enable webkit QtWebKit)
116 $(pyqt4_use_enable xmlpatterns QtXmlPatterns)
117 CC="$(tc-getCC)"
118 CXX="$(tc-getCXX)"
119 LINK="$(tc-getCXX)"
120 LINK_SHLIB="$(tc-getCXX)"
121 CFLAGS="${CFLAGS}"
122 CXXFLAGS="${CXXFLAGS}"
123 LFLAGS="${LDFLAGS}")
124 echo "${myconf[@]}"
125 "${myconf[@]}" || return 1
126
127 local mod
128 for mod in QtCore $(use X && echo QtDesigner QtGui) $(use dbus && echo QtDBus) $(use declarative && echo QtDeclarative) $(use opengl && echo QtOpenGL); do
129 # Run eqmake4 inside the qpy subdirectories to respect CC, CXX, CFLAGS, CXXFLAGS and LDFLAGS and avoid stripping.
130 pushd qpy/${mod} > /dev/null || return 1
131 eqmake4 $(ls w_qpy*.pro)
132 popd > /dev/null || return 1
133
134 # Fix insecure runpaths.
135 sed -e "/^LFLAGS[[:space:]]*=/s:-Wl,-rpath,${BUILDDIR}/qpy/${mod}::" -i ${mod}/Makefile || die "Fixing of runpaths failed"
136 done
137
138 # Avoid stripping of libpythonplugin.so.
139 if use X; then
140 pushd designer > /dev/null || return 1
141 eqmake4 python.pro
142 popd > /dev/null || return 1
143 fi
144 }
145 python_execute_function -s configuration
146 }
147
148 src_compile() {
149 python_src_compile
150 }
151
152 src_install() {
153 installation() {
154 # INSTALL_ROOT is used by designer/Makefile, other Makefiles use DESTDIR.
155 emake DESTDIR="${T}/images/${PYTHON_ABI}" INSTALL_ROOT="${T}/images/${PYTHON_ABI}" install
156 }
157 python_execute_function -s installation
158 python_merge_intermediate_installation_images "${T}/images"
159
160 dodoc NEWS THANKS || die "dodoc failed"
161
162 if use doc; then
163 dohtml -r doc/html/* || die "dohtml failed"
164 fi
165
166 if use examples; then
167 insinto /usr/share/doc/${PF}
168 doins -r examples || die "doins failed"
169 fi
170 }
171
172 pkg_postinst() {
173 python_mod_optimize PyQt4
174
175 ewarn "When updating dev-python/PyQt4, you usually need to rebuild packages, which depend on"
176 ewarn "dev-python/PyQt4, such as dev-python/qscintilla-python. If you have app-portage/gentoolkit"
177 ewarn "installed, you can find these packages with \`equery d dev-python/PyQt4\`."
178 }
179
180 pkg_postrm() {
181 python_mod_cleanup PyQt4
182 }

  ViewVC Help
Powered by ViewVC 1.1.20