| 1 | # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 |
|---|
| 2 | # kate: backspace-indents true; indent-pasted-text true; indent-width 4; keep-extra-spaces true; remove-trailing-spaces modified; replace-tabs true; replace-tabs-save true; syntax Tcl/Tk; tab-indents true; tab-width 4; |
|---|
| 3 | # $Id: Portfile 126347 2014-10-08 14:48:31Z nicos@macports.org $ |
|---|
| 4 | |
|---|
| 5 | PortSystem 1.0 |
|---|
| 6 | PortGroup kde4 1.1 |
|---|
| 7 | |
|---|
| 8 | name py-pykde4 |
|---|
| 9 | version 4.14.3 |
|---|
| 10 | categories kde kde4 devel |
|---|
| 11 | license LGPL-2+ |
|---|
| 12 | maintainers gmail.com:rjvbertin openmaintainer |
|---|
| 13 | description Python bindings for the KDE Development Platform |
|---|
| 14 | long_description This package contains PyKDE, the Python bindings for the KDE \ |
|---|
| 15 | libraries, that allow you to write KDE programs using Python instead of \ |
|---|
| 16 | C++. It contains at least the following modules under the \ |
|---|
| 17 | PyKDE namespace: \ |
|---|
| 18 | \ |
|---|
| 19 | * dnssd \ |
|---|
| 20 | * kdecore \ |
|---|
| 21 | * kdeui \ |
|---|
| 22 | * khtml \ |
|---|
| 23 | * kio \ |
|---|
| 24 | * knewstuff \ |
|---|
| 25 | * kparts \ |
|---|
| 26 | * kterminal \ |
|---|
| 27 | * ktexteditor \ |
|---|
| 28 | * kutils \ |
|---|
| 29 | * plasma \ |
|---|
| 30 | * solid \ |
|---|
| 31 | \ |
|---|
| 32 | And a few KDE related technologies like: \ |
|---|
| 33 | \ |
|---|
| 34 | * akonadi \ |
|---|
| 35 | * phonon \ |
|---|
| 36 | * soprano |
|---|
| 37 | platforms darwin |
|---|
| 38 | homepage http://www.riverbankcomputing.co.uk/software/pykde/intro |
|---|
| 39 | master_sites kde:stable/${version}/src/ |
|---|
| 40 | use_xz yes |
|---|
| 41 | distname pykde4-${version} |
|---|
| 42 | checksums rmd160 3ea2492cd31704e559456cb78dd85660fae7e74c \ |
|---|
| 43 | sha256 7fb9d7b5ed03d531243ebd67939baf30933452dafbdfca866e6653e9a77d80fc |
|---|
| 44 | |
|---|
| 45 | set python.versions {{27 2.7} {34 3.4}} |
|---|
| 46 | set python.default_version 27 |
|---|
| 47 | |
|---|
| 48 | foreach py ${python.versions} { |
|---|
| 49 | set py_ver [lindex ${py} 0] |
|---|
| 50 | subport py${py_ver}-pykde4 { |
|---|
| 51 | depends_build port:pkgconfig |
|---|
| 52 | depends_lib-append port:kdelibs4 \ |
|---|
| 53 | port:soprano \ |
|---|
| 54 | port:boost \ |
|---|
| 55 | port:py${py_ver}-pyqt4 \ |
|---|
| 56 | port:dbus-python${py_ver} |
|---|
| 57 | depends_run-append port:python${py_ver} port:py${py_ver}-pyqt4 |
|---|
| 58 | |
|---|
| 59 | set py_bra [lindex ${py} 1] |
|---|
| 60 | set pylibdir ${frameworks_dir}/Python.framework/Versions/${py_bra}/lib/python${py_bra} |
|---|
| 61 | configure.args-append -DPYKDEUIC4_ALTINSTALL=TRUE \ |
|---|
| 62 | -DDEFAULT_PYTHON_VERSION=false -DPYTHON_EXECUTABLE=${prefix}/bin/python${py_bra} \ |
|---|
| 63 | -DPYTHON_INCLUDE_PATH=${frameworks_dir}/Python.framework/Versions/${py_bra}/Headers \ |
|---|
| 64 | -DPYTHON_INCLUDE_DIR2=${frameworks_dir}/Python.framework/Versions/${py_bra}/Headers \ |
|---|
| 65 | -DPYTHON_LIBRARY=${frameworks_dir}/Python.framework/Versions/${py_bra}/Python \ |
|---|
| 66 | -DPYTHON_SITE_PACKAGES_INSTALL_DIR=${pylibdir}/site-packages |
|---|
| 67 | post-configure { |
|---|
| 68 | reinplace -W ${build.dir} "s|${prefix}/lib/python${py_bra}/|${pylibdir}/|g" cmake_install.cmake pykdeconfig.py tools/pykdeuic4/cmake_install.cmake |
|---|
| 69 | } |
|---|
| 70 | post-destroot { |
|---|
| 71 | foreach module [glob ${destroot}${pylibdir}/site-packages/PyKDE4/*.dylib] { |
|---|
| 72 | set fname [file rootname ${module}] |
|---|
| 73 | file rename ${module} "${fname}.so" |
|---|
| 74 | } |
|---|
| 75 | xinstall -m 0755 ${build.dir}/pykdeconfig.py ${destroot}${pylibdir}/site-packages/PyKDE4 |
|---|
| 76 | # who will ever need ${prefix}/share/sip/PyKDE4/pykde_config.sip? |
|---|
| 77 | file delete -force ${destroot}${prefix}/share/sip |
|---|
| 78 | file delete ${destroot}${prefix}/share/apps/pykde4/examples/kpartsExamples/konsolepart.py |
|---|
| 79 | file rename ${destroot}${prefix}/share/apps/pykde4 ${destroot}${prefix}/share/apps/${subport} |
|---|
| 80 | reinplace -W ${destroot}${prefix}/share/apps/${subport}/examples \ |
|---|
| 81 | "s|#\!/usr/bin/env python|#\!${prefix}/bin/python${py_bra}|g" __init__.py default.py \ |
|---|
| 82 | kdecoreExamples/__init__.py kdecoreExamples/kaboutdata.py kdecoreExamples/kstandarddirs.py \ |
|---|
| 83 | kdeuiExamples/__init__.py kdeuiExamples/kaboutapplicationdialog.py kdeuiExamples/kaboutkdedialog.py \ |
|---|
| 84 | kdeuiExamples/kapplication.py kdeuiExamples/kcolorbutton.py kdeuiExamples/kcolorcells.py \ |
|---|
| 85 | kdeuiExamples/kcolorcombo.py kdeuiExamples/kcolordialog.py kdeuiExamples/kcolorpatch.py \ |
|---|
| 86 | kdeuiExamples/kcombobox.py kdeuiExamples/kdatepicker.py kdeuiExamples/kdatewidget.py \ |
|---|
| 87 | kdeuiExamples/kfontdialog.py kdeuiExamples/klistwidget.py kdeuiExamples/kmainwindow.py \ |
|---|
| 88 | khtmlExamples/__init__.py kioExamples/__init__.py kpartsExamples/__init__.py kpartsExamples/katepart.py \ |
|---|
| 89 | kutilsExamples/__init__.py polkitqtExamples/PkExampleUi.py \ |
|---|
| 90 | polkitqtExamples/pkexample.py polkitqtExamples/pkexamplehelper.py solidExamples/__init__.py \ |
|---|
| 91 | solidExamples/solid_audiointerface.py solidExamples/solid_device.py solidExamples/solid_networkinterface.py \ |
|---|
| 92 | solidExamples/solid_processor.py solidExamples/solid_storageaccess.py solidExamples/solid_storagedrive.py \ |
|---|
| 93 | solidExamples/solid_storagevolume.py solid_demo.py |
|---|
| 94 | reinplace -W ${destroot}${prefix}/share/apps/${subport}/examples \ |
|---|
| 95 | "s|#\!python|#\!${prefix}/bin/python${py_bra}|g" __init__.py default.py \ |
|---|
| 96 | kdecoreExamples/__init__.py kdecoreExamples/kaboutdata.py kdecoreExamples/kstandarddirs.py \ |
|---|
| 97 | kdeuiExamples/__init__.py kdeuiExamples/kaboutapplicationdialog.py kdeuiExamples/kaboutkdedialog.py \ |
|---|
| 98 | kdeuiExamples/kapplication.py kdeuiExamples/kcolorbutton.py kdeuiExamples/kcolorcells.py \ |
|---|
| 99 | kdeuiExamples/kcolorcombo.py kdeuiExamples/kcolordialog.py kdeuiExamples/kcolorpatch.py \ |
|---|
| 100 | kdeuiExamples/kcombobox.py kdeuiExamples/kdatepicker.py kdeuiExamples/kdatewidget.py \ |
|---|
| 101 | kdeuiExamples/kfontdialog.py kdeuiExamples/klistwidget.py kdeuiExamples/kmainwindow.py \ |
|---|
| 102 | khtmlExamples/__init__.py kioExamples/__init__.py kpartsExamples/__init__.py kpartsExamples/katepart.py \ |
|---|
| 103 | kutilsExamples/__init__.py polkitqtExamples/PkExampleUi.py \ |
|---|
| 104 | polkitqtExamples/pkexample.py polkitqtExamples/pkexamplehelper.py solidExamples/__init__.py \ |
|---|
| 105 | solidExamples/solid_audiointerface.py solidExamples/solid_device.py solidExamples/solid_networkinterface.py \ |
|---|
| 106 | solidExamples/solid_processor.py solidExamples/solid_storageaccess.py solidExamples/solid_storagedrive.py \ |
|---|
| 107 | solidExamples/solid_storagevolume.py solid_demo.py |
|---|
| 108 | } |
|---|
| 109 | } |
|---|
| 110 | } |
|---|
| 111 | |
|---|
| 112 | subport ${name}-docs { |
|---|
| 113 | long_description Python bindings for the KDE Development Platform: the documentation |
|---|
| 114 | # extract only the docs directory: |
|---|
| 115 | extract.post_args-append ${distname}/docs |
|---|
| 116 | configure.args-append -DHTML_INSTALL_DIR:PATH=${prefix}/share/doc/HTML |
|---|
| 117 | configure.post_args ${configure.post_args}/docs |
|---|
| 118 | supported_archs noarch |
|---|
| 119 | } |
|---|
| 120 | |
|---|
| 121 | if {${subport} eq ${name}} { |
|---|
| 122 | depends_build-append port:py${python.default_version}-pykde4 |
|---|
| 123 | fetch {} |
|---|
| 124 | checksum {} |
|---|
| 125 | extract {} |
|---|
| 126 | patch {} |
|---|
| 127 | configure {} |
|---|
| 128 | build {} |
|---|
| 129 | destroot { |
|---|
| 130 | xinstall -d -m 755 ${destroot}${prefix}/share/doc/kde-installed-packages |
|---|
| 131 | system "touch ${destroot}${prefix}/share/doc/kde-installed-packages/${name}=py${python.default_version}-pykde4" |
|---|
| 132 | } |
|---|
| 133 | } |
|---|
| 134 | |
|---|
| 135 | if {${subport} ne "${name}-docs"} { |
|---|
| 136 | # patches come directly from Kubuntu, after doing a hardcoded -p1 |
|---|
| 137 | # python3.3.diff |
|---|
| 138 | patchfiles-append python_modules_dont_link_against_libpython.diff \ |
|---|
| 139 | add_qt_kde_definitions.diff \ |
|---|
| 140 | fix_kpythonpluginfactory_build.diff \ |
|---|
| 141 | make_pykde4_respect_sip_flags.diff \ |
|---|
| 142 | pythonpluginfactory_use_versioned_python_lib.diff \ |
|---|
| 143 | optional_install_sip_files.diff \ |
|---|
| 144 | pythonpluginfactory_python3.diff \ |
|---|
| 145 | kubuntu_include_dirs.diff \ |
|---|
| 146 | kubuntu_kpythonpluginfactory_3.2support.diff \ |
|---|
| 147 | pykde4-macports-adaptations.diff \ |
|---|
| 148 | pykde4-macports-adaptations2.diff \ |
|---|
| 149 | pykde4-macports-adaptations-noDLFCN.diff \ |
|---|
| 150 | pykde4-macports-adaptations-toolongfilename.diff |
|---|
| 151 | } |
|---|
| 152 | |
|---|
| 153 | if {[variant_isset docs]} { |
|---|
| 154 | depends_run-append port:${name}-docs |
|---|
| 155 | } |
|---|
| 156 | |
|---|
| 157 | compiler.blacklist llvm-gcc-4.2 macports-llvm-gcc-4.2 |
|---|
| 158 | |
|---|
| 159 | livecheck.url http://kde.mirrors.hoobly.com/stable/ |
|---|
| 160 | livecheck.regex (\\d+(\\.\\d+)+) |
|---|