# -*- 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
license Noncommercial Copyleft
description A Two-Dimensional Quality Mesh Generator and Delaunay Triangulator
long_description Triangle generates exact Delaunay triangulations, \
constrained Delaunay triangulations, conforming Delaunay \
triangulations, Voronoi diagrams, and high-quality triangular \
meshes. The latter can be generated with no small or large \
angles, and are thus suitable for finite element analysis.
homepage http://www.cs.cmu.edu/~quake/triangle.html
master_sites http://www.netlib.org/voronoi/
checksums rmd160 12be39ae4e34fc14ef3f9982e28a242abe200307 \
sha256 1766327add038495fa3499e9b7cc642179229750f7201b94f8e1b7bee76f8480
patchfiles-append patch-makefile.diff
reinplace "s|__MACPORTS_CC__|${configure.cc}|g" ${worksrcpath}/makefile
reinplace "s|__MACPORTS_PREFIX__|${prefix}|g" ${worksrcpath}/makefile
reinplace "s|__MACPORTS_CPPFLAGS__|${configure.cppflags}|g" ${worksrcpath}/makefile
reinplace "s|__MACPORTS_CFLAGS__|${configure.cflags} [get_canonical_archflags cc]|g" ${worksrcpath}/makefile
reinplace "s|__MACPORTS_LDFLAGS__|${configure.ldflags} [get_canonical_archflags ld]|g" ${worksrcpath}/makefile
build.target trilibrary triangle
xinstall -d ${destroot}${prefix}/share/doc/${name}
xinstall -W ${worksrcpath} triangle ${destroot}${prefix}/bin
if {[variant_isset showme]} {
xinstall -W ${worksrcpath} showme ${destroot}${prefix}/bin
xinstall -d ${destroot}${prefix}/share/${name}
# The port ncarg needs the triangle source files; see http://trac.macports.org/ticket/34706
xinstall -m 644 -W ${worksrcpath} triangle.h triangle.c ${destroot}${prefix}/share/${name}
xinstall -m 644 -W ${worksrcpath} README ${destroot}${prefix}/share/doc/${name}
xinstall -m 644 -W ${worksrcpath} triangle.h ${destroot}${prefix}/include
xinstall -m 755 -W ${worksrcpath} libtriangle.dylib ${destroot}${prefix}/lib
xinstall -m 644 -W ${worksrcpath} libtriangle.a ${destroot}${prefix}/lib
variant showme description {Install Show Me, a display program for meshes and more} {
depends_lib-append port:xorg-libX11
build.target-append showme