# -*- 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
# $Id: Portfile 102822 2013-02-09 00:51:24Z jmr@macports.org $

PortSystem          1.0
PortGroup           cmake 1.0

name                gmsh
conflicts           gmsh-devel
version             2.5.0
revision            2
categories          science
platforms           darwin
license             GPL-2+
maintainers         ujf-grenoble.fr:Christophe.Prudhomme
description         Finite element mesh generator in 1D, 2D and 3D
long_description    \
        Gmsh is an automatic 3D finite element mesh generator (primarily   \
        Delaunay) with build-in CAD and post-processing facilities. Its     \
        design goal is to provide a simple meshing tool for academic test   \
        cases with parametric input and up to date visualization            \
        capabilities.

homepage            http://www.geuz.org/gmsh/
master_sites        http://www.geuz.org/gmsh/src/
distname            gmsh-${version}-source
extract.suffix      .tgz

checksums           \
                          sha1    b541fd9f1aadf1df7bf6fdd97a68ca41966ffeb6 \
                          rmd160  49ab2054d546e4549250119cec0453cd1cdfffef

patchfiles          patch-cmakelists.diff \
                    patch-Graphics-gl2png.cpp.diff

# https://trac.macports.org/ticket/33925
compiler.blacklist  clang

configure.args-append \
    -DENABLE_NATIVE_FILE_CHOOSER:BOOL=OFF\
    -DENABLE_OCC:BOOL=OFF \
    -DENABLE_FLTK:BOOL=ON\
    -DENABLE_GRAPHICS:BOOL=ON

post-build {
    # lib and shared targets are not handled by default target
    system "cd ${worksrcpath} && make lib shared"
}

depends_lib  \
    port:mesa \
    port:libpng \
    path:lib/libfltk.dylib:fltk \
    port:jpeg \
    port:zlib \
    port:texinfo
