PortSystem 1.0

name            py-orbit
set my_name     pyorbit
version         2.24.0
set branch      [join [lrange [split $version .] 0 1] .]
categories      python gnome
license         LGPL-2.1+
platforms       darwin
maintainers     nomaintainer
description     Python binding for the ORBit2 CORBA ORB - Default branch.
long_description PyORBit is a Python binding for the ORBit2 CORBA ORB. It \
                was developped to suit the needs of the bonobo bindings \
                in GNOME-Python, but is usable for other purposes as well. \
                It aims to follow the standard Python language mapping for \
                CORBA. It can generate stubs at runtime from typelibs, IDL \
                files, or by introspecting remote objects using ORBit2's \
                IModule typelib capabilities.

homepage        http://www.pygtk.org/
master_sites    gnome:sources/${my_name}/${branch}/
use_bzip2       yes
distname        ${my_name}-${version}

checksums       md5     574593815e75ee6e98062c75d6d1581f \
                sha1    f9877ce9672ed3c3d001b86924f1b6514a79efc9 \
                rmd160  55aa1c3ac0739d398d8e9bbda93ef36f7c659360

subport py27-orbit {
    set pyversion 2.7
    depends_lib-append  port:python27
}
subport py26-orbit {
    set pyversion 2.6
    depends_lib-append  port:python26
}

if {$subport ne $name} {
    depends_build   port:pkgconfig
    depends_lib-append     port:orbit2

    set python.prefix   ${frameworks_dir}/Python.framework/Versions/${pyversion}

    patchfiles      patch-configure.diff
    post-patch {
       reinplace "s|@@PYTHON_PREFIX@@|${python.prefix}|g" ${worksrcpath}/configure
    }

    configure.args  --includedir=${python.prefix}/include/python${pyversion}
    configure.python ${prefix}/bin/python${pyversion}

    build.args      PYTHON_LDFLAGS= PYTHON_LIBS=

    post-destroot {
       move ${destroot}${prefix}/lib/pkgconfig ${destroot}${python.prefix}/lib
    }
    livecheck.type  none
} else {
    livecheck.type  gnome
    livecheck.name  ${my_name}

    # py-orbit was previously for python 2.4
    revision            1
    replaced_by         py27-orbit
    depends_lib         port:py27-orbit
    supported_archs     noarch
    use_configure       no
    build               {}
    destroot {
        xinstall -d ${destroot}${prefix}/share/doc/${name}
        system "echo This port is a stub. > ${destroot}${prefix}/share/doc/${name}/README"
    }
}