diff options
| author | Michael Palimaka <kensington@gentoo.org> | 2013-01-30 05:45:21 +1100 |
|---|---|---|
| committer | Michael Palimaka <kensington@gentoo.org> | 2013-01-30 05:45:21 +1100 |
| commit | 1f6b499be0f393da0ea712fd523892f7a7a6be28 (patch) | |
| tree | 2bfc2144a928d0619151bd1001a78e84afcd5149 /kde-base/pykde4/pykde4-9999.ebuild | |
| parent | 586f5d3558960b2afa1d1fe225de522e1dfd0597 (diff) | |
| download | kde-1f6b499be0f393da0ea712fd523892f7a7a6be28.tar.gz kde-1f6b499be0f393da0ea712fd523892f7a7a6be28.tar.bz2 kde-1f6b499be0f393da0ea712fd523892f7a7a6be28.zip | |
[kde-base/pykde4] Migrate to the new python eclass.
Package-Manager: portage-2.1.11.50
Diffstat (limited to 'kde-base/pykde4/pykde4-9999.ebuild')
| -rw-r--r-- | kde-base/pykde4/pykde4-9999.ebuild | 69 |
1 files changed, 37 insertions, 32 deletions
diff --git a/kde-base/pykde4/pykde4-9999.ebuild b/kde-base/pykde4/pykde4-9999.ebuild index 982076be680..45f4b2e133b 100644 --- a/kde-base/pykde4/pykde4-9999.ebuild +++ b/kde-base/pykde4/pykde4-9999.ebuild @@ -3,14 +3,11 @@ # $Header: $ EAPI=5 - -PYTHON_DEPEND="*:2.5" -RESTRICT_PYTHON_ABIS="*-jython 2.4 2.7-pypy-*" -PYTHON_USE_WITH="threads" -SUPPORT_PYTHON_ABIS="1" - +PYTHON_COMPAT=( python{2_5,2_6,2_7,3_1,3_2} ) +PYTHON_REQ_USE="threads" OPENGL_REQUIRED="always" -inherit python portability kde4-base multilib + +inherit python-r1 portability kde4-base multilib DESCRIPTION="Python bindings for KDE4" KEYWORDS="" @@ -19,30 +16,33 @@ REQUIRED_USE="test? ( semantic-desktop )" # blocker added due to compatibility issues and error during compile time RDEPEND=" - >=dev-python/sip-4.14:= + ${PYTHON_DEPS} + >=dev-python/sip-4.14:=[${PYTHON_USEDEP}] + $(add_kdebase_dep kdelibs 'opengl,semantic-desktop=') semantic-desktop? ( $(add_kdebase_dep kdepimlibs 'semantic-desktop') >=dev-libs/soprano-2.9.0 ) - aqua? ( >=dev-python/PyQt4-4.9.5[dbus,declarative,script(+),sql,svg,webkit,aqua] ) - !aqua? ( >=dev-python/PyQt4-4.9.5[dbus,declarative,script(+),sql,svg,webkit,X] ) + aqua? ( >=dev-python/PyQt4-4.9.5[${PYTHON_USEDEP},dbus,declarative,script(+),sql,svg,webkit,aqua] ) + !aqua? ( >=dev-python/PyQt4-4.9.5[${PYTHON_USEDEP},dbus,declarative,script(+),sql,svg,webkit,X] ) " DEPEND="${RDEPEND} sys-devel/libtool " pkg_setup() { - python_pkg_setup kde4-base_pkg_setup have_python2=false scan_python_versions() { - [[ ${PYTHON_ABI} == 2.* ]] && have_python2=true - : + if [[ ${EPYTHON} == python2.* ]]; then + have_python2=true + fi } - python_execute_function -q scan_python_versions + python_foreach_impl scan_python_versions + if ! ${have_python2}; then ewarn "You do not have a Python 2 version selected." ewarn "kpythonpluginfactory will not be built" @@ -60,30 +60,35 @@ src_prepare() { # See bug 322351 use arm && epatch "${FILESDIR}/${PN}-4.4.4-arm-sip.patch" - sed -i -e 's/kpythonpluginfactory /kpython${PYTHON_SHORT_VERSION}pluginfactory /g' kpythonpluginfactory/CMakeLists.txt + sed -e 's/kpythonpluginfactory /kpython${PYTHON_SHORT_VERSION}pluginfactory /g' \ + -i kpythonpluginfactory/CMakeLists.txt || die if ${have_python2}; then mkdir -p "${WORKDIR}/wrapper" || die "failed to copy wrapper" cp "${FILESDIR}/kpythonpluginfactorywrapper.c-r1" "${WORKDIR}/wrapper/kpythonpluginfactorywrapper.c" || die "failed to copy wrapper" fi + python_copy_sources + } src_configure() { configuration() { + pushd "${BUILD_DIR}" > /dev/null local mycmakeargs=( -DWITH_PolkitQt=OFF -DWITH_QScintilla=OFF $(cmake-utils_use_with semantic-desktop Soprano) $(cmake-utils_use_with semantic-desktop Nepomuk) $(cmake-utils_use_with semantic-desktop KdepimLibs) - -DPYTHON_EXECUTABLE=$(PYTHON -a) + -DPYTHON_EXECUTABLE=${PYTHON} -DPYKDEUIC4_ALTINSTALL=TRUE ) local CMAKE_BUILD_DIR=${S}_build-${PYTHON_ABI} kde4-base_src_configure + popd > /dev/null } - python_execute_function configuration + python_foreach_impl configuration } echo_and_run() { @@ -93,13 +98,15 @@ echo_and_run() { src_compile() { compilation() { + pushd "${BUILD_DIR}" > /dev/null local CMAKE_BUILD_DIR=${S}_build-${PYTHON_ABI} kde4-base_src_compile + popd > /dev/null } - python_execute_function compilation + python_foreach_impl compilation if ${have_python2}; then - cd "${WORKDIR}/wrapper" + pushd "${WORKDIR}/wrapper" > /dev/null echo_and_run libtool --tag=CC --mode=compile $(tc-getCC) \ -shared \ ${CFLAGS} ${CPPFLAGS} \ @@ -114,17 +121,22 @@ src_compile() { -rpath "${EPREFIX}/usr/$(get_libdir)/kde4" \ kpythonpluginfactorywrapper.lo \ $(dlopen_lib) + popd > /dev/null fi } src_install() { installation() { - cd "${S}_build-${PYTHON_ABI}" - emake DESTDIR="${T}/images/${PYTHON_ABI}" install + pushd "${BUILD_DIR}" > /dev/null + emake DESTDIR="${D}" install + popd > /dev/null + + mv "${ED}"/usr/bin/pykdeuic4{,-${EPYTHON}} || die + python_optimize } - python_execute_function installation + python_foreach_impl installation - python_merge_intermediate_installation_images "${T}/images" + dosym python-exec /usr/bin/pykdeuic4 # As we don't call the eclass's src_install, we have to install the docs manually DOCS=("${S}"/{AUTHORS,NEWS,README}) @@ -132,17 +144,16 @@ src_install() { base_src_install_docs if ${have_python2}; then - cd "${WORKDIR}/wrapper" + pushd "${WORKDIR}/wrapper" > /dev/null echo_and_run libtool --mode=install install kpythonpluginfactory.la "${ED}/usr/$(get_libdir)/kde4/kpythonpluginfactory.la" rm "${ED}/usr/$(get_libdir)/kde4/kpythonpluginfactory.la" + popd > /dev/null fi } pkg_postinst() { kde4-base_pkg_postinst - python_mod_optimize PyKDE4 PyQt4/uic/pykdeuic4.py PyQt4/uic/widget-plugins/kde4.py - if use examples; then echo elog "PyKDE4 examples have been installed to" @@ -150,9 +161,3 @@ pkg_postinst() { echo fi } - -pkg_postrm() { - kde4-base_pkg_postrm - - python_mod_cleanup PyKDE4 PyQt4/uic/pykdeuic4.py PyQt4/uic/widget-plugins/kde4.py -} |
