2012-11-03 23:25:19 +01:00
# Created by: Pedro Giffuni <giffunip@asme.org>
2003-07-23 16:21:51 +02:00
# $FreeBSD$
PORTNAME = gmsh
2014-02-09 01:52:13 +01:00
PORTVERSION = 2.8.4
2014-09-10 22:50:31 +02:00
PORTREVISION = 5
2003-07-23 16:21:51 +02:00
CATEGORIES = cad
2010-01-13 13:47:20 +01:00
MASTER_SITES = http://www.geuz.org/gmsh/src/ \
http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/
2003-07-23 16:21:51 +02:00
DISTNAME = ${ PORTNAME } -${ PORTVERSION } -source
2010-01-13 13:47:20 +01:00
DISTFILES = ${ DISTNAME } ${ EXTRACT_SUFX }
DIST_SUBDIR = gmsh
EXTRACT_ONLY = ${ DISTNAME } ${ EXTRACT_SUFX }
2003-07-23 16:21:51 +02:00
2011-06-14 09:38:51 +02:00
MAINTAINER = stephen@FreeBSD.org
2014-06-09 13:21:52 +02:00
COMMENT = Automatic 3D finite element mesh generator
2003-07-23 16:21:51 +02:00
2013-12-11 15:53:20 +01:00
LIB_DEPENDS = libfltk.so:${ PORTSDIR } /x11-toolkits/fltk \
libjpeg.so:${ PORTSDIR } /graphics/jpeg \
libpng15.so:${ PORTSDIR } /graphics/png \
liblapack.so:${ PORTSDIR } /math/lapack
2003-07-23 16:21:51 +02:00
2011-07-25 21:04:03 +02:00
WRKSRC = ${ WRKDIR } /${ PORTNAME } -${ PORTVERSION } -source
2008-12-31 13:47:22 +01:00
SLAVEDIRS = cad/gmsh-occ
2014-07-29 21:11:51 +02:00
USES = cmake fortran gmake tar:tgz
2010-01-13 13:47:20 +01:00
USE_GL = yes
ALL_TARGET = all
2013-09-15 23:41:35 +02:00
MAKE_JOBS_UNSAFE = yes
2013-03-22 21:06:14 +01:00
CMAKE_ARGS += -DCMAKE_SKIP_RPATH:BOOL= YES
2003-07-23 16:21:51 +02:00
2014-07-15 17:00:15 +02:00
OPTIONS_DEFINE = DOCS
2010-01-13 13:47:20 +01:00
. i f ! d e f i n e d ( W I T H O U T _ S T A T I C _ L I B )
2013-03-09 23:22:52 +01:00
CMAKE_ARGS += -DENABLE_BUILD_LIB= ON
2010-01-13 13:47:20 +01:00
ALL_TARGET += lib
PLIST_SUB += STATIC_LIB = ""
. e l s e
PLIST_SUB += STATIC_LIB = "@comment "
2007-04-01 11:04:46 +02:00
. e n d i f
2010-01-13 13:47:20 +01:00
. i f ! d e f i n e d ( W I T H O U T _ S H A R E D _ L I B )
2013-03-09 23:22:52 +01:00
CMAKE_ARGS += -DENABLE_BUILD_SHARED= ON
2010-01-13 13:47:20 +01:00
ALL_TARGET += shared
PLIST_SUB += SHARED_LIB = ""
USE_LDCONFIG = yes
2007-04-01 11:04:46 +02:00
. e l s e
2010-01-13 13:47:20 +01:00
PLIST_SUB += SHARED_LIB = "@comment "
. e n d i f
2013-05-11 19:18:48 +02:00
.if defined(PORT_OPTIONS : MDOCS )
2010-01-13 13:47:20 +01:00
CMAKE_ARGS += -DINSTALL_DOCS= OFF
2007-04-01 11:04:46 +02:00
. e n d i f
2010-01-13 13:47:20 +01:00
. i f d e f i n e d ( W I T H O U T _ T E T G E N )
CMAKE_ARGS += -DENABLE_TETGEN= OFF
2007-04-01 11:04:46 +02:00
. e l s e
2014-06-21 20:56:50 +02:00
NO_CDROM = Contact appropriate authors for commercial purposes if including Tetgen or Metis
2010-01-13 13:47:20 +01:00
CMAKE_ARGS += -DENABLE_TETGEN= ON
2007-04-01 11:04:46 +02:00
. e n d i f
2010-01-13 13:47:20 +01:00
# Even though the taucs port pulls in the metis port, we will still need
2010-02-13 09:26:46 +01:00
# WITHOUT_METIS not set when WITH_TAUCS is set, otherwise the linker
2010-01-13 13:47:20 +01:00
# does not find the libraries installed by the metis port.
2010-02-13 09:26:46 +01:00
. i f d e f i n e d ( W I T H _ T A U C S ) & & d e f i n e d ( W I T H O U T _ M E T I S )
IGNORE = requires that WITHOUT_METIS is not set if WITH_TAUCS is set
2010-01-13 13:47:20 +01:00
. e n d i f
. i f ! d e f i n e d ( W I T H O U T _ M E T I S )
2014-06-21 20:56:50 +02:00
NO_CDROM = Contact appropriate authors for commercial purposes if including Tetgen or Metis
2010-01-13 13:47:20 +01:00
CMAKE_ARGS += -DENABLE_METIS= ON
2013-05-11 19:18:48 +02:00
.if defined(PORT_OPTIONS : MDOCS )
2011-07-25 21:04:03 +02:00
IGNORE = the license for Metis requires that its documentation is included
2010-01-13 13:47:20 +01:00
. e n d i f
DISTFILES += manual.pdf
PLIST_SUB += METIS = ""
2007-04-01 11:04:46 +02:00
. e l s e
2010-01-13 13:47:20 +01:00
CMAKE_ARGS += -DENABLE_METIS= OFF
PLIST_SUB += METIS = "@comment "
2007-04-01 11:04:46 +02:00
. e n d i f
2010-02-13 09:26:46 +01:00
. i f d e f i n e d ( W I T H _ T A U C S )
2013-12-11 15:53:20 +01:00
LIB_DEPENDS += libtaucs.so:${ PORTSDIR } /math/taucs
2010-01-13 13:47:20 +01:00
CMAKE_ARGS += -DENABLE_TAUCS= ON
. e l s e
CMAKE_ARGS += -DENABLE_TAUCS= OFF
2009-02-04 15:07:54 +01:00
. e n d i f
2010-01-13 13:47:20 +01:00
. i f ! d e f i n e d ( W I T H O U T _ M E D )
2013-12-11 15:53:20 +01:00
LIB_DEPENDS += libmed.so:${ PORTSDIR } /french/med
2010-01-13 13:47:20 +01:00
CMAKE_ARGS += -DENABLE_MED= ON
2008-07-25 17:31:16 +02:00
. e l s e
2010-01-13 13:47:20 +01:00
CMAKE_ARGS += -DENABLE_MED= OFF
2008-07-25 17:31:16 +02:00
. e n d i f
2010-01-13 13:47:20 +01:00
. i f ! d e f i n e d ( W I T H O U T _ C G N S )
2013-12-11 15:53:20 +01:00
LIB_DEPENDS += libcgns.so:${ PORTSDIR } /science/cgnslib
2010-01-13 13:47:20 +01:00
CMAKE_ARGS += -DENABLE_CGNS= ON
2007-04-01 11:04:46 +02:00
. e l s e
2010-01-13 13:47:20 +01:00
CMAKE_ARGS += -DENABLE_CGNS= OFF
2007-04-01 11:04:46 +02:00
. e n d i f
2010-01-13 13:47:20 +01:00
. i f d e f i n e d ( W I T H O U T _ G M M )
CMAKE_ARGS += -DENABLE_GMM= OFF
. e n d i f
2003-07-23 16:21:51 +02:00
2010-01-13 13:47:20 +01:00
. i f d e f i n e d ( W I T H _ O C C )
2013-12-11 15:53:20 +01:00
LIB_DEPENDS += libTKernel.so:${ PORTSDIR } /cad/opencascade
2013-05-12 19:32:13 +02:00
CMAKE_ARGS += -DENABLE_OCC= ON -DOCC_INC= ${ LOCALBASE } /include/OpenCASCADE
2014-05-06 21:38:43 +02:00
CFLAGS += -DHAVE_CONFIG_H -DHAVE_WOK_CONFIG_H -DFREEBSD
2010-01-13 13:47:20 +01:00
CONFLICTS = gmsh-2.*
. e l s e
CMAKE_ARGS += -DENABLE_OCC= OFF
CONFLICTS = gmsh-occ-2.*
. e n d i f
2008-07-25 17:31:16 +02:00
2012-07-07 17:15:38 +02:00
# TODO
# Dependencies against PythonLibs, swig and petsc are found and registered if installed
# => add knobs to handle them.
2010-01-13 13:47:20 +01:00
PKGMESSAGE = ${ WRKDIR } /pkg-message
2004-12-23 13:23:05 +01:00
2009-02-04 15:07:54 +01:00
. i n c l u d e < b s d . p o r t . p r e . m k >
2007-04-01 11:04:46 +02:00
pre-everything ::
@${ ECHO_MSG } ""
. i f ! d e f i n e d ( W I T H O U T _ T E T G E N )
@${ ECHO_MSG } "Define WITHOUT_TETGEN to disable Tetgen as an alternative"
@${ ECHO_MSG } "3D mesh generator."
@${ ECHO_MSG } ""
. e n d i f
2010-01-13 13:47:20 +01:00
. i f ! d e f i n e d ( W I T H O U T _ M E T I S )
@${ ECHO_MSG } "Define WITHOUT_METIS to disable Metis as an alternative"
@${ ECHO_MSG } "3D mesh generator."
@${ ECHO_MSG } ""
. e n d i f
2010-02-13 09:26:46 +01:00
. i f ! d e f i n e d ( W I T H _ T A U C S )
@${ ECHO_MSG } "Define WITH_TAUCS to enable the Taucs linear algebra solver."
2007-04-01 11:04:46 +02:00
@${ ECHO_MSG } ""
. e n d i f
2010-01-13 13:47:20 +01:00
. i f ! d e f i n e d ( W I T H O U T _ M E D )
@${ ECHO_MSG } "Define WITHOUT_MED to disable MED support."
2007-04-01 11:04:46 +02:00
@${ ECHO_MSG } ""
. e n d i f
. i f ! d e f i n e d ( W I T H O U T _ C G N S )
@${ ECHO_MSG } "Define WITHOUT_CGNS to disable CGNS support."
@${ ECHO_MSG } ""
. e n d i f
2009-02-04 15:07:54 +01:00
. i f ! d e f i n e d ( W I T H O U T _ G M M )
@${ ECHO_MSG } "Define WITHOUT_GMM to disable gmm++ support."
@${ ECHO_MSG } ""
. e n d i f
2008-02-23 12:12:53 +01:00
. i f ! d e f i n e d ( W I T H _ O C C )
@${ ECHO_MSG } "Define WITH_OCC to enable STEP, IGES and BREP support"
2007-04-01 11:04:46 +02:00
@${ ECHO_MSG } "(through OpenCascade)."
@${ ECHO_MSG } ""
2004-12-23 13:23:05 +01:00
. e n d i f
2010-01-13 13:47:20 +01:00
. i f ! d e f i n e d ( W I T H O U T _ S T A T I C _ L I B )
@${ ECHO_MSG } "Define WITHOUT_STATIC_LIB to avoid building and installing the static library."
@${ ECHO_MSG } "(You would want to do this to reduce build time.)"
@${ ECHO_MSG } ""
. e n d i f
. i f ! d e f i n e d ( W I T H O U T _ S H A R E D _ L I B )
@${ ECHO_MSG } "Define WITHOUT_SHARED_LIB to avoid building and installing the shared library."
@${ ECHO_MSG } "(You would want to do this to reduce build time.)"
@${ ECHO_MSG } ""
. e n d i f
2004-12-23 13:23:05 +01:00
2004-08-23 20:49:45 +02:00
post-extract :
2010-01-13 13:47:20 +01:00
${ CP } ${ DISTDIR } /${ DIST_SUBDIR } /manual.pdf ${ WRKDIR }
2007-07-24 00:00:52 +02:00
${ TOUCH } ${ PKGMESSAGE }
2006-01-17 21:36:45 +01:00
. i f ! d e f i n e d ( W I T H O U T _ T E T G E N )
2007-07-24 00:00:52 +02:00
@${ ECHO } >> ${ PKGMESSAGE }
@${ ECHO } "The FreeBSD project has been granted redistribution rights" >> ${ PKGMESSAGE }
@${ ECHO } "but anyone attempting to redistribute Gmsh with Tetgen" >> ${ PKGMESSAGE }
@${ ECHO } "for strict commercial purposes must still contact the author" >> ${ PKGMESSAGE }
@${ ECHO } "(Hang Si) and license the code." >> ${ PKGMESSAGE }
2006-01-17 21:36:45 +01:00
. e n d i f
2010-01-13 13:47:20 +01:00
. i f ! d e f i n e d ( W I T H O U T _ M E T I S )
@${ ECHO } >> ${ PKGMESSAGE }
@${ ECHO } "The FreeBSD project has been granted redistribution rights" >> ${ PKGMESSAGE }
@${ ECHO } "but anyone attempting to redistribute Gmsh with Metis" >> ${ PKGMESSAGE }
@${ ECHO } "must still contact the author" >> ${ PKGMESSAGE }
@${ ECHO } "http://glaros.dtc.umn.edu/gkhome/metis/metis/faq?q=metis/metis/faq#distribute" >> ${ PKGMESSAGE }
@${ ECHO } "\"A Fast and Highly Quality Multilevel Scheme for Partitioning Irregular Graphs\". George Karypis and Vipin Kumar. SIAM Journal on Scientific Computing, Vol. 20, No. 1, pp. 359-392, 1999." >> ${ PKGMESSAGE }
. e n d i f
2010-02-13 09:26:46 +01:00
. i f d e f i n e d ( W I T H _ T A U C S )
2010-01-13 13:47:20 +01:00
@${ ECHO } >> ${ PKGMESSAGE }
@${ ECHO } "There might be licensing issues with using Taucs with Gmsh" >> ${ PKGMESSAGE }
@${ ECHO } "because Taucs requires Metis." >> ${ PKGMESSAGE }
2003-07-23 16:21:51 +02:00
. e n d i f
2011-07-25 21:04:03 +02:00
post-patch :
${ REINPLACE_CMD } -e s+share/doc/gmsh+${ DOCSDIR_REL } + \
-e s+share/man/man1+man/man1+ ${ WRKSRC } /CMakeLists.txt
2007-07-24 00:00:52 +02:00
post-install :
2010-01-13 13:47:20 +01:00
. i f ! d e f i n e d ( W I T H O U T _ M E T I S )
2014-01-26 23:25:15 +01:00
${ MKDIR } ${ STAGEDIR } ${ DOCSDIR } /metis
${ INSTALL_DATA } ${ WRKDIR } /manual.pdf ${ STAGEDIR } ${ DOCSDIR } /metis
2010-01-13 13:47:20 +01:00
. e n d i f
2009-02-04 15:07:54 +01:00
. i n c l u d e < b s d . p o r t . p o s t . m k >