aboutsummaryrefslogtreecommitdiffstats
path: root/cad/calculix/Makefile
blob: cc8ce66a02e3b6cdd8a4f6ca560a2fbf64654baa (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Created by: Pedro Giffuni
# $FreeBSD$

PORTNAME=   calculix
PORTVERSION=    2.14
PORTREVISION=   2
CATEGORIES= cad
MASTER_SITES=   http://www.dhondt.de/
DISTFILES=  ${DIST_SOURCES}
DIST_SUBDIR=    calculix
EXTRACT_ONLY=   ${DIST_SOURCES}

MAINTAINER= pfg@FreeBSD.org
COMMENT=    Three-Dimensional Structural Finite Element Program

LICENSE=    GPLv2

BROKEN=     checksum and size mismatch
BROKEN_aarch64=     fails to link: shapeFunctions.c:(function attach_new): relocation R_AARCH64_CALL26 out of range

RUN_DEPENDS=    ccx:cad/calculix-ccx

DIST_SOURCES=   cgx_${PORTVERSION}.all${EXTRACT_SUFX}
DIST_HTM=   cgx_${PORTVERSION}.htm${EXTRACT_SUFX}
DIST_PDF=   cgx_${PORTVERSION}.pdf
DIST_EXAMPLES=  cgx_${PORTVERSION}.exa${EXTRACT_SUFX}

WRKSRC=     ${WRKDIR}/CalculiX
CGX_VER=    cgx_${PORTVERSION}

USES=       gmake tar:bzip2 compiler:c++11-lib
USE_XORG=   ice sm x11 xext xi xmu xt
USE_GL=     gl glu # uses its own glut

BROWSER?=   firefox
PSVIEWER?=  gv

CXXFLAGS+=  -std=c++98

OPTIONS_DEFINE= DOCS EXAMPLES

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MEXAMPLES}
DISTFILES+= ${DIST_EXAMPLES}
EXTRACT_ONLY+=  ${DIST_EXAMPLES}
.endif

.if ${PORT_OPTIONS:MDOCS}
DISTFILES+= ${DIST_HTM} ${DIST_PDF}
EXTRACT_ONLY+=  ${DIST_HTM}
DOCSDIR=    ${PREFIX}/share/doc/CalculiX
.endif

.if ${ARCH} == "sparc64"
CFLAGS+=    -fPIC
FFLAGS+=    -fPIC
.else
CFLAGS+=    -fpic
FFLAGS+=    -fpic
.endif

pre-build:
    @${REINPLACE_CMD} -e 's!c++!${CXX}!g;' \
        ${WRKSRC}/libSNL/src/makefile
    @${REINPLACE_CMD} -e 's+%%DOCSDIR%%+${DOCSDIR}+g; \
    s+"firefox"+"${BROWSER}"+ ; \
    s+"gv"+"${PSVIEWER}"+ ;' \
        ${WRKSRC}/${CGX_VER}/src/cgx.h

do-build:
    @(cd ${WRKSRC}/libSNL/src; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} )
    @(cd ${WRKSRC}/${CGX_VER}/src; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} )

do-install:
    ${INSTALL_PROGRAM} ${WRKSRC}/${CGX_VER}/src/cgx \
      ${STAGEDIR}${PREFIX}/bin/cgx
.if ${PORT_OPTIONS:MDOCS}
    @${MKDIR} ${STAGEDIR}${DOCSDIR}/cgx
    @(cd ${WRKSRC}/${CGX_VER}/doc/cgx && ${COPYTREE_SHARE} . \
      ${STAGEDIR}${DOCSDIR}/cgx)
    ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/cgx_${PORTVERSION}.pdf \
      ${STAGEDIR}${DOCSDIR}
.endif
.if ${PORT_OPTIONS:MEXAMPLES}
    # Some garbage crept in
    @${RM} ${WRKSRC}/${CGX_VER}/examples/OpenFOAM/couette/constant/polyMesh/*~
    @${RM} ${WRKSRC}/${CGX_VER}/examples/OpenFOAM/couette/constant/*~
    @${RM} ${WRKSRC}/${CGX_VER}/examples/OpenFOAM/couette/system/*~
    @${RM} ${WRKSRC}/${CGX_VER}/examples/ifwhiledemo/*.*~
    @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
    @(cd ${WRKSRC}/${CGX_VER}/examples && ${COPYTREE_SHARE} . \
      ${STAGEDIR}${EXAMPLESDIR})
.endif

.include <bsd.port.mk>