# -*- 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 45065 2009-01-08 00:00:15Z macsforever2000@macports.org $

PortSystem          1.0

categories          aqua

name                ng-tools
version             0.0.1

revision            1

maintainers         lilalinux.net:macports
description         Configuration and Debugging Utility for the UAVP-NG Project
long_description    Configuration and Debugging Utility for the UAVP-NG Project.
homepage            http://ng.uavp.ch/

depends_lib-append  port:qwt \
                    port:GLC_lib \
                    port:libsdl \
                    port:libsdl_image \
                    port:lib3ds13 \
                    port:wolferl-ng

master_sites        file:///Users/nas/Desktop/Mikrokopter/ng/nabil/trunk/sources/

#distfiles           ng-tools
#
#checksums           md5 e69d5d7d798e92191c03930ac3b11539 \
#                    sha1 50a22ebd415d821da6ea9bbaef0cb3d1765255f9 \
#                    rmd160 ffda61126502435bd441bcbfe9e862a6fb97b1f3
#
#use_bzip2           yes

fetch {
        system "cp -r  /Users/nas/Desktop/Mikrokopter/ng/nabil/trunk/sources/${name} ${worksrcpath}"
}

checksum {}

extract {}

patchfiles          patch-libng-uart.c.diff \
                    patch-qngctrl-qngctrl.pro.diff \
                    patch-qngctrl-main.cpp.diff \
                    patch-qngctrl-system.pri.diff \
                    patch-qngctrl-glc_render.cpp.diff

configure.cppflags-append  -I${prefix}/include/wolferl-ng/fc/
configure.cflags-append    -arch i386
configure.args-append      QMAKE=${prefix}/bin/qmake-mac

use_autoreconf      yes

worksrcdir          ${name}

post-destroot {
        system "install_name_tool -change ${prefix}/libexec/qt4-mac/lib/libGLC_lib.dylib ${prefix}/lib/libGLC_lib.dylib ${worksrcpath}/qngctrl/qngctrl.app/Contents/MacOS/qngctrl"
       	xinstall -d -m 755 ${worksrcpath}/qngctrl/qngctrl.app/Contents/Resources/
        file copy ${worksrcpath}/qngctrl/qngctrl-bg.png ${worksrcpath}/qngctrl/qngctrl.app/Contents/Resources/qngctrl-bg.png
        file copy ${worksrcpath}/qngctrl/qngctrl.3ds ${worksrcpath}/qngctrl/qngctrl.app/Contents/Resources/qngctrl.3ds

       	set appPath ${destroot}${applications_dir}
       	xinstall -d -m 755 ${appPath}
       	file copy ${worksrcpath}/qngctrl/qngctrl.app ${appPath}/qngctrl.app
}
