/[gentoo-x86]/kde-base/pykde4/pykde4-4.7.0.ebuild
Gentoo

Contents of /kde-base/pykde4/pykde4-4.7.0.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sun Jul 31 20:52:01 2011 UTC (9 years, 4 months ago) by abcd
Branch: MAIN
Changes since 1.1: +2 -2 lines
Remove spurious ${PYTHON_ABI}

(Portage version: 2.2.0_alpha47/cvs/Linux x86_64, RepoMan options: --force)

1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/kde-base/pykde4/pykde4-4.7.0.ebuild,v 1.1 2011/07/27 14:04:41 alexxy Exp $
4
5 EAPI=3
6
7 PYTHON_DEPEND="*:2.5"
8 RESTRICT_PYTHON_ABIS="*-jython 2.4"
9 PYTHON_USE_WITH="threads"
10 SUPPORT_PYTHON_ABIS="1"
11
12 OPENGL_REQUIRED="always"
13 KDE_SCM="git"
14 inherit python portability kde4-base
15
16 DESCRIPTION="Python bindings for KDE4"
17 KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
18 IUSE="debug doc examples semantic-desktop"
19
20 # blocker added due to compatibility issues and error during compile time
21 RDEPEND="
22 !dev-python/pykde
23 >=dev-python/sip-4.12.3-r2
24 $(add_kdebase_dep kdelibs 'opengl,semantic-desktop=')
25 semantic-desktop? ( $(add_kdebase_dep kdepimlibs 'semantic-desktop') )
26 aqua? ( >=dev-python/PyQt4-4.8.2[dbus,declarative,sql,svg,webkit,aqua] )
27 !aqua? ( >=dev-python/PyQt4-4.8.2[dbus,declarative,sql,svg,webkit,X] )
28 "
29 DEPEND="${RDEPEND}
30 sys-devel/libtool
31 "
32
33 PATCHES=(
34 "${FILESDIR}"/${PN}-4.6.3-python-3.2.patch
35 )
36
37 pkg_setup() {
38 python_pkg_setup
39 kde4-base_pkg_setup
40
41 have_python2=false
42
43 scan_python_versions() {
44 [[ ${PYTHON_ABI} == 2.* ]] && have_python2=true
45 :
46 }
47 python_execute_function -q scan_python_versions
48 if ! ${have_python2}; then
49 ewarn "You do not have a Python 2 version selected."
50 ewarn "kpythonpluginfactory will not be built"
51 fi
52 }
53
54 src_prepare() {
55 kde4-base_src_prepare
56
57 if ! use examples; then
58 sed -e '/^ADD_SUBDIRECTORY(examples)/s/^/# DISABLED /' -i CMakeLists.txt \
59 || die "Failed to disable examples"
60 fi
61
62 # See bug 322351
63 use arm && epatch "${FILESDIR}/${PN}-4.4.4-arm-sip.patch"
64
65 sed -i -e 's/kpythonpluginfactory /kpython${PYTHON_SHORT_VERSION}pluginfactory /g' kpythonpluginfactory/CMakeLists.txt
66
67 if ${have_python2}; then
68 mkdir -p "${WORKDIR}/wrapper" || die "failed to copy wrapper"
69 cp "${FILESDIR}/kpythonpluginfactorywrapper.c" "${WORKDIR}/wrapper" || die "failed to copy wrapper"
70 fi
71 }
72
73 src_configure() {
74 configuration() {
75 local mycmakeargs=(
76 -DWITH_PolkitQt=OFF
77 -DWITH_QScintilla=OFF
78 $(cmake-utils_use_with semantic-desktop Soprano)
79 $(cmake-utils_use_with semantic-desktop Nepomuk)
80 $(cmake-utils_use_with semantic-desktop KdepimLibs)
81 -DPYTHON_EXECUTABLE=$(PYTHON -a)
82 )
83 local CMAKE_BUILD_DIR=${S}_build-${PYTHON_ABI}
84 kde4-base_src_configure
85 }
86
87 python_execute_function configuration
88 }
89
90 echo_and_run() {
91 echo "$@"
92 "$@"
93 }
94
95 src_compile() {
96 compilation() {
97 local CMAKE_BUILD_DIR=${S}_build-${PYTHON_ABI}
98 kde4-base_src_compile
99 }
100 python_execute_function compilation
101
102 if ${have_python2}; then
103 cd "${WORKDIR}/wrapper"
104 echo_and_run libtool --tag=CC --mode=compile $(tc-getCC) \
105 -shared \
106 ${CFLAGS} ${CPPFLAGS} \
107 -DEPREFIX="\"${EPREFIX}\"" \
108 -DPLUGIN_DIR="\"/usr/$(get_libdir)/kde4\"" -c \
109 -o kpythonpluginfactorywrapper.lo \
110 kpythonpluginfactorywrapper.c
111 echo_and_run libtool --tag=CC --mode=link $(tc-getCC) \
112 -shared -module -avoid-version \
113 ${CFLAGS} ${LDFLAGS} \
114 -o kpythonpluginfactory.la \
115 -rpath "${EPREFIX}/usr/$(get_libdir)/kde4" \
116 kpythonpluginfactorywrapper.lo \
117 $(dlopen_lib)
118 fi
119 }
120
121 src_install() {
122 installation() {
123 cd "${S}_build-${PYTHON_ABI}"
124 emake DESTDIR="${T}/images/${PYTHON_ABI}" install || die "emake install failed for Python ${PYTHON_ABI}"
125 }
126 python_execute_function installation
127
128 python_merge_intermediate_installation_images "${T}/images"
129
130 # As we don't call the eclass's src_install, we have to install the docs manually
131 DOCS=("${S}"/{AUTHORS,NEWS,README})
132 use doc && HTML_DOCS=("${S}/docs/html/")
133 base_src_install_docs
134
135 if ${have_python2}; then
136 cd "${WORKDIR}/wrapper"
137 echo_and_run libtool --mode=install install kpythonpluginfactory.la "${ED}/usr/$(get_libdir)/kde4/kpythonpluginfactory.la"
138 rm "${ED}/usr/$(get_libdir)/kde4/kpythonpluginfactory.la"
139 fi
140 }
141
142 pkg_postinst() {
143 kde4-base_pkg_postinst
144
145 python_mod_optimize PyKDE4 PyQt4/uic/pykdeuic4.py PyQt4/uic/widget-plugins/kde4.py
146
147 if use examples; then
148 echo
149 elog "PyKDE4 examples have been installed to"
150 elog "${EPREFIX}/usr/share/apps/${PN}/examples"
151 echo
152 fi
153 }
154
155 pkg_postrm() {
156 kde4-base_pkg_postrm
157
158 python_mod_cleanup PyKDE4 PyQt4/uic/pykdeuic4.py PyQt4/uic/widget-plugins/kde4.py
159 }

  ViewVC Help
Powered by ViewVC 1.1.20