# -*- 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
maintainers {gmail.com:tlockhart1976 @lockhart} openmaintainer
description Generate polygonal approximations of terrains and other height fields.
Generate polygonal approximations of terrains and other height fields. \
Terra is based on algorithms described in: \
Fast Polygonal Approximation of Terrains and Height Fields \
by Michael Garland and Paul Heckbert (Technical Report CMU-CS-95-181).
homepage http://mgarland.org/software/scape.html
master_sites http://mgarland.org/dist/
checksums rmd160 885639282ffe5244f5289ef3f453390c8acdb30f \
sha256 22470e13e1f0659d23dbf7e0ecbfd8f6490bcd1d0a953537c1dfec18f4df3bd7 \
depends_lib port:freeglut
# add proper stdlib and set std=c++11 if building with clang
if {[string match *clang* ${configure.compiler}]} {
configure.cxx ${configure.cxx} -stdlib=${configure.cxx_stdlib} -std=c++11
# gcc requires std=gnu++11 to enable build
if {[string match *gcc* ${configure.compiler}]} {
configure.cxx ${configure.cxx} -std=gnu++11
patchfiles patch-compiler.diff patch-opengl.diff
# add proper archflags set compiler for build
reinplace -E "s,@CC@,${configure.cc} [get_canonical_archflags cc],g" ${worksrcpath}/Makefile
reinplace -E "s,@CXX@,${configure.cxx} [get_canonical_archflags cxx],g" ${worksrcpath}/Makefile
reinplace -E "s,@OPTFLAGS@,${configure.optflags},g" ${worksrcpath}/Makefile
reinplace -E "s,@PREFIX@,${prefix},g" ${worksrcpath}/Makefile
xinstall -m 755 ${worksrcpath}/terra ${destroot}${prefix}/bin/terra
xinstall -m 755 ${worksrcpath}/xterra ${destroot}${prefix}/bin/xterra
xinstall -m 755 -d ${destroot}${prefix}/share/${name}
xinstall -m 644 ${worksrcpath}/README.html ${destroot}${prefix}/share/${name}