# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; truncate-lines: t -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 62211 2009-12-31 21:36:31Z ryandesign@macports.org $

PortSystem          1.0

name                qwt
version             5.1.2
categories          graphics science
maintainers         nomaintainer
description         Qt Widgets for Technical Applications
long_description    The Qwt library contains GUI Components and utility classes \
                    which are primarily useful for programs with a technical \
                    background. Beside a 2D plot widget it provides scales, sliders, \
                    dials, compasses, thermometers, wheels and knobs to control \
                    or display values, arrays, or ranges of type double.
homepage            http://qwt.sourceforge.net
master_sites        sourceforge:qwt
distname            qwt-${version}
use_bzip2           yes
checksums           md5 cb26a36f020d7c038e207b03b7d79bc5 \
                    sha1 2fc04b78c438635a78e41a22fea6f9e016f7ca17 \
                    rmd160 a5a94aa3870a631f9605e6370c4d04fb1c79347e
platforms           darwin

patchfiles          patch-qwtconfig.pri.diff

set qt_dir          ${prefix}/libexec/qt4-mac

configure.cmd       ${qt_dir}/bin/qmake
configure.pre_args  INSTALLBASE="${prefix}"
destroot.destdir    INSTALL_ROOT="${destroot}"

post-destroot {
    # fix install-name of dynamic library
    system "install_name_tool -id ${prefix}/lib/libqwt.${version}.dylib ${destroot}${prefix}/lib/libqwt.${version}.dylib"
    system "install_name_tool -change libqwt.5.dylib ${prefix}/lib/libqwt.5.dylib ${destroot}${qt_dir}/plugins/designer/libqwt_designer_plugin.bundle"
}


variant qt3 conflicts qt4 description "Use qt3-mac" {
    depends_lib-append  port:qt3-mac
}

variant qt4 conflicts qt3 description "Use qt4-mac" {
    depends_lib-append  path:bin/qmake-mac:qt4-mac
}

if { ![variant_isset qt3] && ![variant_isset qt4] } {
    default_variants    +qt4
}
