# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 72630 2010-10-21 12:57:18Z michaelld@macports.org $

PortSystem 1.0
PortGroup muniversal 1.0
PortGroup archcheck 1.0
PortGroup qt4 1.0

name            gnuradio-qtgui
version         3.3.0
revision        1
maintainers     michaelld
description     Qt GUI component of GNU Radio.
long_description Qt GUI component of GNU Radio: \
Qt-based GUI widgets.

categories      science
homepage        http://gnuradio.org/

# all GNU Radio components come in a single tarball.
# Reuse this tarball for each Port

dist_subdir     gnuradio
master_sites.mirror_subdir gnuradio
distname        gnuradio-${version}
master_sites    gnu

platforms       darwin macosx

checksums       md5     cef9ef65d626e1273c6381966ae9d4bc \
                sha1    41d5c177b173ce73404f5fe539b013c82600f73f \
                rmd160  ae83bd8a93deaf73d730e2af0d05c9ffc4c98520

depends_lib     port:gnuradio-core \
                port:qwtplot3d

archcheck.files lib/libgnuradio-core.dylib \
                lib/libqwtplot3d.dylib

# fix various 'time' functions that are not on OSX;
# should be unnecessary in version 3.3.1.
patchfiles      patch_gr-qtgui_src_lib_highResTimeFunctions.h.diff

configure.args  --disable-all-components \
                --with-gruel \
                --with-gnuradio-core \
                --enable-gr-qtgui \
                --with-qwt-libdir=${prefix}/lib \
                --with-qwt-incdir=${prefix}/include/qwt \
                --with-qwtplot3d-libdir=${prefix}/lib \
                --with-qwtplot3d-incdir=${prefix}/include/qwtplot3d

# Include the Qt framework directory; GNU Radio 3.3.0's configure
# script ignores this part of the QtCore PKGCONFIG file.
configure.ldflags-append -F${qt_dir}/lib

use_parallel_build yes

variant docs description "build documentation for ${name}" {
    configure.args-append --enable-doxygen --enable-docs
    depends_lib-append port:doxygen
}

if { ![variant_isset docs] } {
    configure.args-append --disable-doxygen --disable-docs
}

variant python25 conflicts python26 python27 \
description "Use Python 2.5" {
    configure.env      PYTHON=${prefix}/bin/python2.5
    depends_lib-append port:python25 \
                       port:py25-pyqt4
}

variant python26 conflicts python25 python27 \
description "Use Python 2.6" {
    configure.env      PYTHON=${prefix}/bin/python2.6
    depends_lib-append port:python26 \
                       port:py26-pyqt4
}

variant python27 conflicts python25 python26 \
description "Use Python 2.7" {
    configure.env      PYTHON=${prefix}/bin/python2.7
    depends_lib-append port:python27 \
                       port:py27-pyqt4
}

if { ![variant_isset python25] && \
     ![variant_isset python26] && \
     ![variant_isset python27] } {
    default_variants +python26
}
