18b30338255fca86400af3e261e79fc89f2f5ef6~suv# -*- 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
18b30338255fca86400af3e261e79fc89f2f5ef6~suv# $Id: Portfile 119928 2014-05-10 20:35:38Z devans@macports.org $
18b30338255fca86400af3e261e79fc89f2f5ef6~suvPortSystem 1.0
18b30338255fca86400af3e261e79fc89f2f5ef6~suvname dbus-python
18b30338255fca86400af3e261e79fc89f2f5ef6~suvversion 1.2.0
18b30338255fca86400af3e261e79fc89f2f5ef6~suvmaintainers mcalhoun openmaintainer
18b30338255fca86400af3e261e79fc89f2f5ef6~suvlicense MIT
18b30338255fca86400af3e261e79fc89f2f5ef6~suvcategories devel python
18b30338255fca86400af3e261e79fc89f2f5ef6~suvplatforms darwin
18b30338255fca86400af3e261e79fc89f2f5ef6~suvdescription Python bindings for the dbus message bus system.
18b30338255fca86400af3e261e79fc89f2f5ef6~suvset python_versions {24 25 26 27 31 32 33}
18b30338255fca86400af3e261e79fc89f2f5ef6~suv# this default version should stay synchronized with python_get_default_version
18b30338255fca86400af3e261e79fc89f2f5ef6~suv# in the python PortGroup
18b30338255fca86400af3e261e79fc89f2f5ef6~suvset python_default_version 27
18b30338255fca86400af3e261e79fc89f2f5ef6~suvlong_description \
18b30338255fca86400af3e261e79fc89f2f5ef6~suv ${description}
18b30338255fca86400af3e261e79fc89f2f5ef6~suvmaster_sites http://dbus.freedesktop.org/releases/dbus-python/
18b30338255fca86400af3e261e79fc89f2f5ef6~suvif {${name} eq ${subport}} {
18b30338255fca86400af3e261e79fc89f2f5ef6~suv # set up dbus-python as a stub port that depends on the default dbus-pythonXY
18b30338255fca86400af3e261e79fc89f2f5ef6~suv checksum {}
18b30338255fca86400af3e261e79fc89f2f5ef6~suv extract {}
18b30338255fca86400af3e261e79fc89f2f5ef6~suv supported_archs noarch
18b30338255fca86400af3e261e79fc89f2f5ef6~suv depends_lib port:${name}${python_default_version}
18b30338255fca86400af3e261e79fc89f2f5ef6~suv use_configure no
18b30338255fca86400af3e261e79fc89f2f5ef6~suv destroot {
18b30338255fca86400af3e261e79fc89f2f5ef6~suv xinstall -d ${destroot}${prefix}/share/doc/${name}
18b30338255fca86400af3e261e79fc89f2f5ef6~suv system "echo $name is a stub port > ${destroot}${prefix}/share/doc/${name}/README"
18b30338255fca86400af3e261e79fc89f2f5ef6~suvforeach python_version ${python_versions} {
18b30338255fca86400af3e261e79fc89f2f5ef6~suv set python_branch [string range ${python_version} 0 end-1].[string index ${python_version} end]
18b30338255fca86400af3e261e79fc89f2f5ef6~suv subport ${name}${python_version} {
18b30338255fca86400af3e261e79fc89f2f5ef6~suv checksums rmd160 cba09a1ca259bfa49c943142110a968241f40360 \
18b30338255fca86400af3e261e79fc89f2f5ef6~suv sha256 e12c6c8b2bf3a9302f75166952cbe41d6b38c3441bbc6767dbd498942316c6df
18b30338255fca86400af3e261e79fc89f2f5ef6~suv livecheck.url ${master_sites}?C=M&O=D
18b30338255fca86400af3e261e79fc89f2f5ef6~suv livecheck.regex ${name}-(\\d+(?:\\.\\d+)*)
18b30338255fca86400af3e261e79fc89f2f5ef6~suv # dbus-python 1.x only supports Python 2.6 and above
18b30338255fca86400af3e261e79fc89f2f5ef6~suv if { [vercmp ${python_branch} 2.5] <= 0 } {
18b30338255fca86400af3e261e79fc89f2f5ef6~suv version 0.84.0
18b30338255fca86400af3e261e79fc89f2f5ef6~suv checksums rmd160 ec5912e28e49e89ff3f9a3a5a05292c27f11de2c \
18b30338255fca86400af3e261e79fc89f2f5ef6~suv sha256 b85bc7aaf1a976627ca461b1ca7b0c4ddddff709f52fe44c9b2d1d7d8fac5906
18b30338255fca86400af3e261e79fc89f2f5ef6~suv livecheck.regex ${name}-(0(?:\\.\\d+)*)
18b30338255fca86400af3e261e79fc89f2f5ef6~suv distname ${name}-${version}
18b30338255fca86400af3e261e79fc89f2f5ef6~suv depends_build port:pkgconfig
18b30338255fca86400af3e261e79fc89f2f5ef6~suv depends_lib \
18b30338255fca86400af3e261e79fc89f2f5ef6~suv port:dbus-glib \
18b30338255fca86400af3e261e79fc89f2f5ef6~suv port:gettext \
18b30338255fca86400af3e261e79fc89f2f5ef6~suv port:libiconv \
18b30338255fca86400af3e261e79fc89f2f5ef6~suv port:python${python_version}
18b30338255fca86400af3e261e79fc89f2f5ef6~suv set python_prefix ${frameworks_dir}/Python.framework/Versions/${python_branch}
18b30338255fca86400af3e261e79fc89f2f5ef6~suv configure.pre_args-replace --prefix=${prefix} --prefix=${python_prefix}
18b30338255fca86400af3e261e79fc89f2f5ef6~suv --docdir=${prefix}/share/doc/${subport} \
18b30338255fca86400af3e261e79fc89f2f5ef6~suv --includedir=${python_prefix}/include/python${python_branch} \
18b30338255fca86400af3e261e79fc89f2f5ef6~suv --disable-html-docs \
18b30338255fca86400af3e261e79fc89f2f5ef6~suv --disable-api-docs
18b30338255fca86400af3e261e79fc89f2f5ef6~suv configure.pkg_config_path ${python_prefix}/lib/pkgconfig
18b30338255fca86400af3e261e79fc89f2f5ef6~suv variant html description {Enable HTML documentation building} {}
18b30338255fca86400af3e261e79fc89f2f5ef6~suv # pyXY-epydoc, which is required to build the api, is only supported on certain versions of python
18b30338255fca86400af3e261e79fc89f2f5ef6~suv if { [lsearch -exact {25 26 27} ${python_version}] != -1 } {
18b30338255fca86400af3e261e79fc89f2f5ef6~suv variant doc description {Enable API documentation building} {}
18b30338255fca86400af3e261e79fc89f2f5ef6~suv variant examples description {Install examples} {
18b30338255fca86400af3e261e79fc89f2f5ef6~suv post-destroot {
18b30338255fca86400af3e261e79fc89f2f5ef6~suv set docdir ${prefix}/share/doc/${subport}
18b30338255fca86400af3e261e79fc89f2f5ef6~suv set exdir ${docdir}/examples
18b30338255fca86400af3e261e79fc89f2f5ef6~suv xinstall -d ${destroot}${exdir}
18b30338255fca86400af3e261e79fc89f2f5ef6~suv eval xinstall -m 644 [glob ${worksrcpath}/examples/*] ${destroot}${exdir}
18b30338255fca86400af3e261e79fc89f2f5ef6~suv # pyXY-gobject, which is required to test, is only supported on certain versions of python
18b30338255fca86400af3e261e79fc89f2f5ef6~suv if { [lsearch -exact {26 27 32 33 34} ${python_version}] != -1 } {
18b30338255fca86400af3e261e79fc89f2f5ef6~suv variant test {}
18b30338255fca86400af3e261e79fc89f2f5ef6~suv # ${python_version} and ${python_branch} do not have the right value inside variant block,
18b30338255fca86400af3e261e79fc89f2f5ef6~suv # so put it here.
18b30338255fca86400af3e261e79fc89f2f5ef6~suv if { [variant_isset html] || ([variant_exists doc] && [variant_isset doc]) } {
18b30338255fca86400af3e261e79fc89f2f5ef6~suv depends_build-append port:py${python_version}-docutils
18b30338255fca86400af3e261e79fc89f2f5ef6~suv configure.env-append RST2HTML=${prefix}/bin/rst2html-${python_branch}.py
18b30338255fca86400af3e261e79fc89f2f5ef6~suv if { [variant_isset html] } {
18b30338255fca86400af3e261e79fc89f2f5ef6~suv configure.args-replace --disable-html-docs --enable-html-docs
18b30338255fca86400af3e261e79fc89f2f5ef6~suv # ${python_version} and ${python_branch} do not have the right value inside variant block,
18b30338255fca86400af3e261e79fc89f2f5ef6~suv # so put it here.
18b30338255fca86400af3e261e79fc89f2f5ef6~suv if { [variant_exists doc] && [variant_isset doc] } {
18b30338255fca86400af3e261e79fc89f2f5ef6~suv depends_build-append port:py${python_version}-epydoc
18b30338255fca86400af3e261e79fc89f2f5ef6~suv configure.args-replace --disable-api-docs --enable-api-docs
18b30338255fca86400af3e261e79fc89f2f5ef6~suv configure.env-append EPYDOC=${prefix}/bin/epydoc-${python_branch}
18b30338255fca86400af3e261e79fc89f2f5ef6~suv post-destroot {
18b30338255fca86400af3e261e79fc89f2f5ef6~suv set docdir ${prefix}/share/doc/${subport}
18b30338255fca86400af3e261e79fc89f2f5ef6~suv set apidir ${docdir}/api
18b30338255fca86400af3e261e79fc89f2f5ef6~suv xinstall -d ${destroot}${apidir}
18b30338255fca86400af3e261e79fc89f2f5ef6~suv eval xinstall -m 644 [glob ${worksrcpath}/api/*] ${destroot}${apidir}
18b30338255fca86400af3e261e79fc89f2f5ef6~suv # ${python_version} and ${python_branch} do not have the right value inside variant block,
18b30338255fca86400af3e261e79fc89f2f5ef6~suv # so put it here.
18b30338255fca86400af3e261e79fc89f2f5ef6~suv if { [variant_exists test] } {
18b30338255fca86400af3e261e79fc89f2f5ef6~suv if { [variant_isset test] } {
18b30338255fca86400af3e261e79fc89f2f5ef6~suv depends_build-append port:py${python_version}-gobject
18b30338255fca86400af3e261e79fc89f2f5ef6~suv pre-test {
18b30338255fca86400af3e261e79fc89f2f5ef6~suv ui_error "test variant must be activated to enable test support."
18b30338255fca86400af3e261e79fc89f2f5ef6~suv error "Please enable test variant."
18b30338255fca86400af3e261e79fc89f2f5ef6~suv platform darwin 9 {
18b30338255fca86400af3e261e79fc89f2f5ef6~suv post-patch {
18b30338255fca86400af3e261e79fc89f2f5ef6~suv reinplace "s| -export-symbols-regex.*| \\\\|g" \
18b30338255fca86400af3e261e79fc89f2f5ef6~suv ${worksrcpath}/_dbus_bindings/Makefile.in \
18b30338255fca86400af3e261e79fc89f2f5ef6~suv ${worksrcpath}/_dbus_glib_bindings/Makefile.in