aboutsummaryrefslogtreecommitdiff
path: root/cad/gmsh/Makefile
blob: 5a0baad082c8c7a1c16e35830f50b6650bdef99b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Created by: Pedro Giffuni <giffunip@asme.org>
# $FreeBSD$

PORTNAME=	gmsh
DISTVERSION=	3.0.6
PORTREVISION=	3
CATEGORIES=	cad
MASTER_SITES=	http://gmsh.info/src/
DISTNAME=	${PORTNAME}-${PORTVERSION}-source
DIST_SUBDIR=	gmsh

MAINTAINER=	jrm@FreeBSD.org
COMMENT?=	Automatic 3D finite element mesh generator

LICENSE=	AGPLv3+ APACHE20 GPLv3+ GPLv2+ LGPL21
LICENSE_COMB=	multi
LICENSE_FILE_GPLv2+=	${WRKSRC}/LICENSE.txt

BROKEN_FreeBSD_12_i386=	fails to build on FreeBSD 12 i386 due to a clang bug: https://llvm.org/bugs/show_bug.cgi?id=21903
BROKEN_powerpc64=	fails to build: .rodata._Z7pow_intRKdRKi referenced in section .got of CMakeFiles/gmsh.dir/Numeric/bezierBasis.cpp.o: defined in discarded section

LIB_DEPENDS=	libfltk.so:x11-toolkits/fltk \
		libfontconfig.so:x11-fonts/fontconfig \
		libgmp.so:math/gmp \
		libhdf5.so:science/hdf5 \
		libpng.so:graphics/png \
		libsz.so:science/szip
RUN_DEPENDS=	getdp:science/getdp

USES=		blaslapack cmake fortran jpeg tar:tgz
USE_GL=		gl glu
USE_XORG=	x11 xcursor xext xinerama xfixes xft xrender

SLAVEDIRS=	cad/gmsh-occ

MAKE_JOBS_UNSAFE=	yes

CMAKE_ARGS=	-DCMAKE_SKIP_RPATH:BOOL=YES

OPTIONS_DEFINE=		CGNS MED OCC SHARED STATIC
OPTIONS_DEFAULT=	MED

CGNS_DESC=	Enable experimental CGNS mesh support
MED_DESC=	Enable MED mesh and post file formats
OCC_DESC=	Enable Open CASCADE geometrical models
SHARED_DESC=	Build shared library and install header files
STATIC_DESC=	Build static library

OPTIONS_SUB=	yes
PLIST_SUB=	VER=${PORTVERSION} VE=${PORTVERSION:R}

# TODO
# Dependencies against PythonLibs, swig and petsc are found and registered if
# installed
# => add knobs to handle them.

CGNS_CMAKE_BOOL=	ENABLE_CGNS
CGNS_LIB_DEPENDS=	libcgns.so:science/cgnslib
DOCS_CMAKE_BOOL=	INSTALL_DOCS
MED_CMAKE_BOOL=		ENABLE_MED
MED_LIB_DEPENDS=	libmed.so:french/med
OCC_CFLAGS=		-DHAVE_CONFIG_H -DHAVE_WOK_CONFIG_H -DFREEBSD
OCC_CMAKE_BOOL=		ENABLE_OCC
OCC_CMAKE_ON=		-DOCC_INC=${LOCALBASE}/include/OpenCASCADE
OCC_CONFLICTS=		gmsh-[23].*
OCC_CONFLICTS_OFF=	gmsh-occ-[23].*
OCC_LIB_DEPENDS=	libopenblas.so:math/openblas libTKernel.so:cad/opencascade
OCC_USE=		gnome=cairo
SHARED_ALL_TARGET=	shared
SHARED_CMAKE_BOOL=	ENABLE_BUILD_SHARED
SHARED_VARS=		USE_LDCONFIG=yes
STATIC_ALL_TARGET=	lib
STATIC_CMAKE_BOOL=	ENABLE_BUILD_LIB

post-patch:
	@${REINPLACE_CMD} -e "s|share/doc/gmsh|${DOCSDIR_REL}|" \
		-e 's|share/man/man1|man/man1|' ${WRKSRC}/CMakeLists.txt

.include <bsd.port.mk>