# -*- 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 103041 2013-02-12 13:23:05Z michaelld@macports.org $

PortSystem          1.0
PortGroup           python 1.0

name                py-pyqwt
version             5.2.0
revision            4

platforms           macosx
categories-append   devel
maintainers         macsforever2000 michaelld erickt openmaintainer
license             GPL-2+

description         PyQwt is a set of Python bindings for the Qwt 5 toolkit
long_description    PyQwt is a set of Python bindings for the Qwt C++ class library which extends \
                    the Qt framework with widgets for scientific and engineering applications. It \
                    provides a widget to plot 2-dimensional data and various widgets to display \
                    and control bounded or unbounded floating point values. \
                    PyQwt version 5 is compatible with Qwt version 5 only.

homepage            http://pyqwt.sourceforge.net
master_sites        sourceforge:pyqwt
distname            PyQwt-${version}
dist_subdir         python

checksums           md5     fcd6c6029090d473dcc9df497516eae7 \
                    sha1    797f37c63dec660272f6a8ccfd16a017df0ad640 \
                    rmd160  e4c8a63d623d974cd500e29fbc62255746ca7feb

# Note that python 3.1 is supported but the dependencies need to be checked first
python.versions     25 26 27

if {$subport != $name} {

    use_configure      yes

    depends_lib-append port:py${python.version}-pyqt4 \
                       port:py${python.version}-numpy
    
    worksrcdir         ${worksrcdir}/configure
    
    configure.cmd      ${prefix}/bin/python${python.branch} configure.py
    configure.pre_args -I ${prefix}/include -I ${prefix}/include/qwt -I ${prefix}/include/python${python.branch} -L ${prefix}/lib --disable-numarray --disable-numeric
    configure.universal_args-delete --disable-dependency-tracking

    build.target
    build.cmd          make
    destroot.cmd       make install
    destroot.destdir   DESTDIR=${destroot}

    # depend on the QWT5 library, but default to 5.2.  This port is
    # does not work with Qwt 6 (any longer; not sure if it ever did).
    depends_lib-append  path:lib/libqwt.5.dylib:qwt52

    livecheck.type  none
} else {
    livecheck.type  regex
    livecheck.url   ${homepage}
    livecheck.regex {PyQwt-([0-9\.]+)\.tar\.gz}
}
