# -*- 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
# $Id: Portfile 73341 2010-11-10 16:33:38Z michaelld@macports.org $

PortSystem      1.0

name            py-sip
version         4.11.2
revision        1
categories      python devel
maintainers     blair openmaintainer
platforms       macosx

description     create Python bindings for C and C++ libraries
long_description \
    SIP is a tool that makes it very easy to create \
    Python bindings for C and C++ libraries. \
    It was originally developed to create PyQt, \
    the Python bindings for the Qt toolkit, \
    but can be used to create bindings for any \
    C or C++ library.

homepage        http://www.riverbankcomputing.co.uk/software/sip/intro
master_sites \
    http://www.riverbankcomputing.com/static/Downloads/sip4/ \
    http://gentoo.mirrors.easynews.com/linux/gentoo/distfiles/ \
    http://gentoo.osuosl.org/distfiles/ \
    http://www.gtlib.gatech.edu/pub/gentoo/distfiles/

distname        sip-${version}
checksums           md5     d799804ca0a88bd76c6c2cdf8935c3cb \
                    sha1    586a86a55553617e39b1df8376166d03d697184c \
                    rmd160  755e4610f9e3359df0a7a9f009ad16a5592341f0

dist_subdir python

depends_lib port:python24

patchfiles      patch-siputils.py.diff

configure.cmd   ${prefix}/bin/python2.4 configure.py
configure.pre_args  -d ${prefix}/lib/python2.4/site-packages \
                -e ${prefix}/include/python2.4 \
                -v ${prefix}/share/sip \
                -p macx-g++
configure.post_args LFLAGS="-F${prefix}/Library/Frameworks -L${prefix}/lib"

test.run    yes
test.cmd    cd siplib && ${prefix}/bin/python2.4 -c 'import sip'

post-destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/doc
    file copy ${worksrcpath}/doc ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath} LICENSE LICENSE-GPL2 LICENSE-GPL3 NEWS README \
        ${destroot}${prefix}/share/doc/${name}
    system "${prefix}/bin/python2.4 ${prefix}/lib/python2.4/compileall.py ${destroot}${prefix}"
    system "${prefix}/bin/python2.4 -O ${prefix}/lib/python2.4/compileall.py ${destroot}${prefix}"
}
