aboutsummaryrefslogtreecommitdiffstats
path: root/cad/opencascade/Makefile
blob: 35861bcc1409a2565c1a3a91f9ee442b52c66fee (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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# Created by: Thierry Thomas <thierry@pompo.net>
# $FreeBSD$

PORTNAME=       opencascade
PORTVERSION=        6.3
PORTREVISION=   11
CATEGORIES=     cad science
MASTER_SITES=       ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR= thierry

MAINTAINER= thierry@FreeBSD.org
COMMENT=    Open CASCADE Technology, 3D modeling & numerical simulation

BUILD_DEPENDS=  ${LOCALBASE}/include/stlport/algorithm:${PORTSDIR}/devel/stlport
RUN_DEPENDS=    ${LOCALBASE}/include/stlport/algorithm:${PORTSDIR}/devel/stlport    \
        autoexpect:${PORTSDIR}/lang/expect      \
        ${LIB_TCLX}:${PORTSDIR}/lang/tclX
LIB_DEPENDS=    itcl.${ITCL_VER}:${PORTSDIR}/lang/itcl      \
        itk.${ITK_VER}:${PORTSDIR}/x11-toolkits/itk \
        Tix${TIX_VER}:${PORTSDIR}/x11-toolkits/tix  \
        fltk.1:${PORTSDIR}/x11-toolkits/fltk        \
        dps.0:${PORTSDIR}/x11/dgs

USE_BZIP2=  yes
USE_BISON=  build
USE_TK=     84+
USE_TCL_BUILD=  84+
USE_TCL_RUN=    84+
USE_JAVA=   yes
USE_XORG=   xmu
JAVA_VERSION=   1.6+
#.if defined(MAINTAINER_MODE)
# linux-sun-jdk was required for 6.1, but 6.2 is OK with diablo-jdk.
#JAVA_OS=   linux
#.endif

ITCL_VER=   3
ITCL_MM=    3.3
ITK_VER=    3
ITK_MM=     3.3
TIX_VER=    8.4.3
TIX_MM=     8.4.3
TCLX_VER=   8.4
LIB_TCLX=   ${LOCALBASE}/lib/tclx${TCLX_VER}/libtclx${TCLX_VER}.so

PATCH_WRKSRC=   ${WRKDIR}/OpenCASCADE${PORTVERSION}.0
WRKSRC=     ${PATCH_WRKSRC}/ros
REINPLACE_ARGS= -i ""
GNU_CONFIGURE=  yes
CONFIGURE_ARGS= --with-tcl=${TCL_LIBDIR}                \
        --with-tk=${TK_LIBDIR}                  \
        --with-java-include=${JAVA_HOME}/include        \
        --with-dps-include=${LOCALBASE}/include         \
        --with-dps-library=${LOCALBASE}/lib         \
        --with-gl-include=${LOCALBASE}/include          \
        --with-gl-library=${LOCALBASE}/lib          \
        --with-xmu-include=${LOCALBASE}/include/X11     \
        --with-xmu-library=${LOCALBASE}/lib         \
        --with-stlport-include=${LOCALBASE}/include/stlport \
        --with-stlport-libname=stlport_${STL_COMPILER}      \
        --with-stlport-library=${LOCALBASE}/lib         \
        --enable-production=yes
CONFIGURE_ENV=  ARCH=${ARCH} LD=${CXX}
CPPFLAGS+=  ${CXXFLAGS} ${GCC4WA} -I${LOCALBASE}/include    \
        -I${TCL_INCLUDEDIR} -I${TK_INCLUDEDIR}
# We strip the libs
MAKE_ENV=   INSTALL_STRIP_FLAG=-s OCC_BUILDDIR="${PATCH_WRKSRC}"    \
        OCC_INSTALLDIR="${OCCROOT}" PTHREAD_LIBS="${PTHREAD_LIBS}" LD=${CXX}
USE_LDCONFIG=   yes

STL_COMPILER?=  gcc

LOCCROOT=   OpenCAS
OCCROOT=    ${PREFIX}/${LOCCROOT}
CASROOT=    ${OCCROOT}/ros
PLIST_SUB=  OCCROOT="${LOCCROOT}"
SUB_LIST=   OCCROOT="${OCCROOT}" PORTNAME=${PORTNAME} FILESDIR=${FILESDIR}
SUB_FILES=  pkg-message LICENSE.${OPSYS}
PKGMESSAGE= ${WRKDIR}/pkg-message

FBSDBIN=    DRAWEXE wokprocess woksh
DIR2INST=   data
#DIR2INST+= tools wok
SRC2INST=   adm drv inc make src
.if !defined(NOPORTDOCS)
DIR2INST+=  doc
.endif

.include <bsd.port.pre.mk>

.if ${OSVERSION} > 700036 && defined(PACKAGE_BUILDING)
# Work-around for gcc-41+
GCC4WA=     -ffriend-injection -fpermissive
.endif

pre-everything::
    @${ECHO_MSG}
    @${ECHO_MSG} "Warning: to build OpenCascade, you should have at least"
    @${ECHO_MSG} "3.7 Gb of free disk space in build area!"
    @${ECHO_MSG}

pre-configure:
    ${REINPLACE_CMD} -e 's|%%CASROOT%%|${CASROOT}|' \
        -e 's|%%LOCALBASE%%|${LOCALBASE}|'  \
        -e 's|%%TCL_LIBDIR%%|${TCL_LIBDIR}|'    \
        -e 's|%%TK_LIBDIR%%|${TK_LIBDIR}|'  \
        -e 's|%%ITCLMM%%|${ITCL_VER}|'      \
        -e 's|%%ITKMM%%|${ITK_MM}|'     \
        -e 's|%%TIX_MM%%|${TIX_MM}|'        \
        -e 's|!/bin/ksh|! ${LOCALBASE}/bin/ksh|'\
        ${WRKSRC}/env.csh ${WRKSRC}/env.ksh
    ${REINPLACE_CMD} -e 's|/tmp/OCC50|${CASROOT}|'  \
        -e 's|/usr/bin/g++|${CXX}|'     \
        -e 's|/usr/bin/gcc|${CC}|'      \
        -e 's|%%JAVAHOME%%|${JAVA_HOME}|'   \
        -e 's|/usr/local|${LOCALBASE}|'     \
        -e 's|/usr/X11R6|${LOCALBASE}|'     \
        ${WRKSRC}/src/OS/Draw.tcl       \
        ${WRKSRC}/src/OS/Visualization.tcl  \
        ${WRKSRC}/src/OS/ApplicationFramework.tcl
    ${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|'\
        -e 's|/usr/X11R6|${LOCALBASE}|'     \
        -e 's|/usr/local/bin/tclsh8.4|${TCLSH}|'\
        ${WRKSRC}/src/WOKsite/wokinit.csh   \
        ${WRKSRC}/src/OS/WOK.tcl
    ${REINPLACE_CMD} -e 's|$${TCLBIN}/tclsh|${TCLSH}|'  \
        ${WRKSRC}/src/WOKsite/wok.csh
    ${REINPLACE_CMD} -e 's|/usr/bin/g++|${CXX}|'    \
        -e 's|/usr/bin/gcc|${CC}|'      \
        -e 's|/usr/bin/f77|${F77}|'     \
        -e 's|/usr/bin/ld|${LD}|'       \
        -e 's|%%CXXFLAGS%%|${CXXFLAGS}|'    \
        -e 's|%%CFLAGS%%|${CFLAGS}|'        \
        -e 's|%%LOCALBASE%%|${LOCALBASE}|'  \
        -e 's|%%/usr/X11R6%%|${X11LBASE}|'  \
        -e 's|%%STL_COMPILER%%|${STL_COMPILER}|'\
        -e 's|%%TCL_INCDIR%%|${TCL_INCLUDEDIR}|'\
        -e 's|%%JAVA_HOME%%|${JAVA_HOME}|'  \
        ${WRKSRC}/src/WOKBuilderDef/CSF.edl \
        ${WRKSRC}/src/WOKBuilderDef/CMPLRS.edl  \
        ${WRKSRC}/src/WOKBuilderDef/LDEXE.edl   \
        ${WRKSRC}/src/WOKBuilderDef/LDSHR.edl
    ${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|'  \
        ${WRKSRC}/${CONFIGURE_SCRIPT}       \
        ${WRKSRC}/src/WOKBuilderDef/CSF.edl

pre-install:
    ${MKDIR} ${CASROOT}

post-install:
    ${MKDIR} ${CASROOT}/bsd/bin ${OCCROOT}/samples
    ${LN} -sf ${FBSDBIN:S|^|${PREFIX}/bin/|} ${CASROOT}/bsd/bin
    ${LN} -sf ${PREFIX}/lib ${CASROOT}/bsd/lib
    ${LN} -sf ${CASROOT}/bsd ${CASROOT}/${OPSYS}
    ${INSTALL_DATA} ${PATCH_WRKSRC}/LICENSE ${OCCROOT}
    ${INSTALL_DATA} ${WRKDIR}/LICENSE.${OPSYS} ${OCCROOT}
    @${ECHO_CMD} "To populate this directory, please install the following ports:"\
        > ${OCCROOT}/samples/README
    @${ECHO_CMD} "- cad/${PORTNAME}-tutorial" >> ${OCCROOT}/samples/README
    @${ECHO_CMD} "- cad/${PORTNAME}-samples-qt" >> ${OCCROOT}/samples/README
    @${ECHO_CMD} "- cad/${PORTNAME}-samples-java" >> ${OCCROOT}/samples/README
.for di in ${DIR2INST}
    cd ${PATCH_WRKSRC} &&   \
        ${FIND} ${di} -type d -exec ${MKDIR} ${OCCROOT}/{} \;
    cd ${PATCH_WRKSRC} &&   \
        ${FIND} ${di} -type f -exec ${INSTALL_DATA} {} ${OCCROOT}/{} \;
.endfor
#   ${LN} -sf ${PREFIX}/lib ${OCCROOT}/wok/lib/bsd
    cd ${OCCROOT} &&    \
        ${FIND} ${DIR2INST} -name "*sh" -exec ${CHMOD} ${BINMODE} {} \;
.for es in env.csh env.ksh
    ${INSTALL_SCRIPT} ${WRKSRC}/${es} ${CASROOT}
.endfor
    ${FIND} ${OCCROOT} -name "*.orig" -exec ${RM} {} \;
    ${FIND} ${CASROOT} -type d -empty -exec ${TOUCH} {}/.keep-me \;
    @${ECHO_MSG}
    @${CAT} ${PKGMESSAGE}
    @${ECHO_MSG}

.include <bsd.port.post.mk>