aboutsummaryrefslogtreecommitdiff
path: root/cad/salome/Makefile.ext
blob: ae93fa37b7d972c0cd1babc860c0a79bf1d3019e (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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
COMMENT=	${SAL_MODULE_UPPER} module of Salome platform

USE_PYTHON=	2.4+
USE_GMAKE=	yes
USE_LDCONFIG=	yes
SAL_MODULE=	${PKGNAMESUFFIX:S/-//}
USE_FORTRAN=yes
USE_GCC=        4.4
#SAL_MODULE_UPPER=	`${ECHO} ${SAL_MODULE} | ${AWK} '{ print(toupper($$1)); }'`
#SAL_MODULE_UPPER=	YACS

USE_TK=		84+
PLIST=		../salome${PKGNAMESUFFIX}/pkg-plist

#dependencies between modules
KERNEL_DEPEND=	""
GUI_DEPEND=			KERNEL QWT
GEOM_DEPEND=		KERNEL GUI
MED_DEPEND=			KERNEL GUI MED2
SMESH_DEPEND=		KERNEL GUI MED GEOM
VISU_DEPEND=		KERNEL GUI MED
LIGHT_DEPEND=		KERNEL GUI
YACS_DEPEND=		KERNEL GUI
RANDOMIZER_DEPEND=	KERNEL GUI
SIERPINSKY_DEPEND=	KERNEL GUI VISU MED RANDOMIZER
FILTER_DEPEND=		KERNEL GUI MED
MULTIPR_DEPEND=		KERNEL GUI MED MED2 HDF5 CAS QT OMNIORB


RELEASENAME=	5.1.3
HAS_CONFIGURE=		yes
CONFIGURE_ARGS+=	--prefix=${PREFIX}
CONFIGURE_ARGS+=	--enable-debug
CONFIGURE_ENV+=		MACHINE=${OPSYS:U}
CPPFLAGS+=		-L${LOCALBASE}/lib -I/usr/include -I${LOCALBASE}/include -D__freebsd__ -DFREEBSD -DHAVE_IOSTREAM -DHAVE_LIMITS_H -DHAVE_IOMANIP -DMPICH_IGNORE_CXX_SEEK
CXXFLAGS+=		-ffriend-injection -fno-inline -fpermissive -fPIC -L${LOCALBASE}/lib -L${LOCALBASE}/lib/salome
CONFIGURE_SCRIPT=	../configure
PATCH_WRKSRC=		${WRKDIR}/${DISTNAME}/${SAL_MODULE_UPPER}_SRC_${RELEASENAME}
WRKSRC=			${PATCH_WRKSRC}
CONFIGURE_WRKSRC=	${WRKSRC}/${SAL_MODULE_UPPER}_build
BUILD_WRKSRC=		${WRKSRC}/${SAL_MODULE_UPPER}_build
INSTALL_WRKSRC=		${BUILD_WRKSRC}
EXTRACT_AFTER_ARGS=	| ${TAR} -xf - ${DISTNAME}/${SAL_MODULE_UPPER}_SRC_${RELEASENAME}/*
PATCHDIR=		${MASTERDIR}/../salome-${SAL_MODULE}/files/

#Depend from other modules
.if !${SAL_MODULE} == "kernel"
.for D in ${${SAL_MODULE_UPPER}_DEPEND}
    CONFIGURE_ENV+=	${D}_ROOT_DIR=${LOCALBASE}
    AUTOTOOLS_ENV+=	${D}_ROOT_DIR=${LOCALBASE}
    CPPFLAGS+=		-L${LOCALBASE}/lib/salome
.endfor
.endif

#Depndency from KERNEL module
.if !${SAL_MODULE} == "kernel"
BUILD_DEPENDS+=		${RESOURCEDIR}/kernel:${PORTSDIR}/cad/salome-kernel
RUN_DEPENDS+=		${RESOURCEDIR}/kernel:${PORTSDIR}/cad/salome-kernel
.endif


#Depndency from GUI module
.if !${SAL_MODULE} == "kernel" && !${SAL_MODULE} == "gui"
BUILD_DEPENDS+=		${RESOURCEDIR}/gui:${PORTSDIR}/cad/salome-gui
RUN_DEPENDS+=		${RESOURCEDIR}/gui:${PORTSDIR}/cad/salome-gui
.endif

#Depndency from MED module
.if ${SAL_MODULE} == "smesh" || ${SAL_MODULE} == "sierpinsky" || ${SAL_MODULE} == "multipr" || ${SAL_MODULE} == "visu"
BUILD_DEPENDS+=		${RESOURCEDIR}/med:${PORTSDIR}/cad/salome-med
RUN_DEPENDS+=		${RESOURCEDIR}/med:${PORTSDIR}/cad/salome-med
AUTOTOOLS_ENV+= 	MED2HOME=${LOCALBASE}
.endif

#Depndency from GEOM module
.if ${SAL_MODULE} == "smesh"
BUILD_DEPENDS+=		${RESOURCEDIR}/geom:${PORTSDIR}/cad/salome-geom
RUN_DEPENDS+=		${RESOURCEDIR}/geom:${PORTSDIR}/cad/salome-geom
.endif

#Dependency for SIERPINSKY
.if ${SAL_MODULE} == "sierpinsky"
BUILD_DEPENDS+=		${RESOURCEDIR}/visu:${PORTSDIR}/cad/salome-visu \
			${RESOURCEDIR}/randomizer:${PORTSDIR}/cad/salome-randomizer
RUN_DEPENDS+=		${RESOURCEDIR}/visu:${PORTSDIR}/cad/salome-visu \
			${RESOURCEDIR}/randomizer:${PORTSDIR}/cad/salome-randomizer
.endif

###########################################################################
#Dependency from other ports
###########################################################################
#Dependency from autotools
USE_AUTOTOOLS=	autoconf:262 automake:15 libtool:22 aclocal:19
.if ${SAL_MODULE} == "kernel"
    ACLOCAL_ARGS=	-I salome_adm/unix/config_files
.else
. if ${SAL_MODULE} == "yacs"
    ACLOCAL_ARGS=	-I adm/unix/config_files
    USE_AUTOTOOLS+=	autoheader:262
    AUTOHEADER_ARGS=	-I adm/unix/config_files
. else
    ACLOCAL_ARGS=	-I adm_local/unix/config_files -I ${LOCALBASE}/salome_adm/unix/config_files 
.	if ${SAL_MODULE} != "gui"
    ACLOCAL_ARGS+= -I ${LOCALBASE}/adm_local/unix/config_files
.	endif
. endif
.endif
LIBTOOLFLAGS=--force --copy --automake 
AUTOMAKE_ARGS=--add-missing --copy --gnu

#Dependency from HDF5
.if !${SAL_MODULE} == "randomizer" &&  !${SAL_MODULE} == "yacs" && !${SAL_MODULE} == "hello" && !${SAL_MODULE} == "pyhello"
LIB_DEPENDS+=		hdf5.0:${PORTSDIR}/science/hdf5
CONFIGURE_ARGS+=	--with-hdf5=${LOCALBASE} 
AUTOTOOLS_ENV+= 	HDF5HOME=${LOCALBASE}
.endif

#Dependency from Opencascade
.if  !${SAL_MODULE} == "kernel"
LIB_DEPENDS+=		TKernel.0:${PORTSDIR}/cad/opencascade
CASROOT=		${LOCALBASE}/OpenCAS/ros
CONFIGURE_ENV+=		CASROOT=${CASROOT}
AUTOTOOLS_ENV+= 	CASROOT=${CASROOT}
#CXXFLAGS+=		-I${CASROOT}/inc
.endif

#Dependency from swig
.if !${SAL_MODULE} == "randomizer" && !${SAL_MODULE} == "light" && !${SAL_MODULE} == "multipr"
BUILD_DEPENDS+=		swig:${PORTSDIR}/devel/swig13
.endif

#Dependency from libxml2
.if ${SAL_MODULE} == "gui" || ${SAL_MODULE} == "kernel" || ${SAL_MODULE} == "med" || ${SAL_MODULE} == "yacs" 
LIB_DEPENDS+=	xml2.5:${PORTSDIR}/textproc/libxml2
CPPFLAGS+=	-I${LOCALBASE}/include/libxml2
CONFIGURE_ENV+=	LIBXML_DIR=${LOCALBASE}
.endif

#Dependency from boost
.if !${SAL_MODULE} == "light" && !${SAL_MODULE} == "randomizer" && !${SAL_MODULE} == "pycalculator" && !${SAL_MODULE} == "light"
CONFIGURE_ENV+=		BOOSTDIR=${LOCALBASE}
LIB_DEPENDS+=		boost_thread:${PORTSDIR}/devel/boost-all
###python boost support off by default
RUN_DEPENDS+=		${LOCALBASE}/lib/libboost_python.so:${PORTSDIR}/devel/boost-python-libs
BUILD_DEPENDS+=		${LOCALBASE}/lib/libboost_python.so:${PORTSDIR}/devel/boost-python-libs
.endif

#Dependency from qt4
.if !${SAL_MODULE} == "kernel" && !${SAL_MODULE} == "randomizer"
USE_QT_VER=			4
CONFIGURE_ENV+=		QTDIR=${LOCALBASE}
QTFLAGS+=		-I${LOCALBASE}/include/qt4 -L${LOCALBASE}/lib/qt4
QT_COMPONENTS=		gui opengl svg xml qmake_build moc_build rcc_build uic_build linguist
AUTOTOOLS_ENV+= 	QTDIR=${LOCALBASE}
.endif

#Dependency from qscintilla2
.if ${SAL_MODULE} == "yacs"
LIB_DEPEDNS+=		qscintilla2.5:${PORTSDIR}/devel/qscintilla2
CONFIGURE_ARGS+=	--with-qsci4-libraries=${QT_LIBDIR} --with-qsci4-includes=${QT_INCDIR}
.endif


#Dependency from vtk
.if !${SAL_MODULE} == "kernel" && !${SAL_MODULE} == "randomizer"
LIB_DEPENDS+=		vtkCommon.5:${PORTSDIR}/math/vtk5
CONFIGURE_ENV+=		VTKHOME=${LOCALBASE} VTKSUFFIX=-5.4
.endif

#Dependency from qwt5
.if ${SAL_MODULE} == "gui" || ${SAL_MODULE} == "component" || ${SAL_MODULE} == "smesh" || ${SAL_MODULE} == "visu" || ${SAL_MODULE} == "filter"
LIB_DEPENDS+=		qwt.5:${PORTSDIR}/x11-toolkits/qwt5
#CONFIGURE_ENV+=		QWTHOME=${LOCALBASE}
CONFIGURE_ARGS+=	--with-qwt=${LOCALBASE}
CPPFLAGS+=		-I/${LOCALBASE}/include/qwt/
AUTOTOOLS_ENV+= 	QWTHOME=${LOCALBASE}
.endif

#Dependency from omniORB & py-omniorb
.if  !${SAL_MODULE} == "light"
LIB_DEPENDS+=		omniORB4.1:${PORTSDIR}/devel/omniORB
RUN_DEPENDS+=		${LOCALBASE}/include/omniORBpy.h:${PORTSDIR}/devel/py-omniorb
RUN_DEPENDS+=		notifd:${PORTSDIR}/devel/omniNotify
AUTOTOOLS_ENV+= 	OMNIORBDIR=${LOCALBASE}
.endif

#Dependency from sip
.if ${SAL_MODULE} == "gui" || ${SAL_MODULE} == "component"
BUILD_DEPENDS+=		sip:${PORTSDIR}/devel/py-sip
RUN_DEPENDS+=		sip:${PORTSDIR}/devel/py-sip
.endif

#Dependency from Pyqt4
.if ${SAL_MODULE} == "gui" || ${SAL_MODULE} == "component"
CONFIGURE_ENV+=		PYQTDIR=${PYTHON_SITELIBDIR} PYQT_SIPS=${LOCALBASE}/share/py-sip
RUN_DEPENDS+=		${PYTHON_SITELIBDIR}/PyQt4/QtGui.so:${PORTSDIR}/x11-toolkits/py-qt4-gui
BUILD_DEPENDS+=		${PYTHON_SITELIBDIR}/PyQt4/QtGui.so:${PORTSDIR}/x11-toolkits/py-qt4-gui
RUN_DEPENDS+=		${PYTHON_SITELIBDIR}/PyQt4/QtXml.so:${PORTSDIR}/textproc/py-qt4-xml
BUILD_DEPENDS+=		${PYTHON_SITELIBDIR}/PyQt4/QtXml.so:${PORTSDIR}/textproc/py-qt4-xml
.endif

#Dependency from metis & scotsch
.if ${SAL_MODULE} == "med"
. if exists(${LOCALBASE}/bin/graphchk)
BUILD_DEPENDS+=		kmetis:${PORTSDIR}/math/metis
RUN_DEPENDS+=		kmetis:${PORTSDIR}/math/metis
. else
BUILD_DEPENDS+=		kmetis:${PORTSDIR}/math/metis-edf
RUN_DEPENDS+=		kmetis:${PORTSDIR}/math/metis-edf
.endif
BUILD_DEPENDS+=		gmap:${PORTSDIR}/cad/scotch
RUN_DEPENDS+=		gmap:${PORTSDIR}/cad/scotch
CONFIGURE_ENV+=		METISDIR=${LOCALBASE} SCOTCHDIR=${LOCALBASE}
CPPFLAGS+=		-I${LOCALBASE}/include/metis
.endif

#Dependency from MED
.if  ${SAL_MODULE} == "med"
LIB_DEPENDS+=		med.2:${PORTSDIR}/french/med
CONFIGURE_ENV+=		MED2HOME=${LOCALBASE}
.endif

#Dependency from gd
.if  ${SAL_MODULE} == "sierpinsky"
LIB_DEPENDS+=		gd.4:${PORTSDIR}/graphics/gd
.endif

.if ${SAL_MODULE} == "yacs"
LIB_DEPENDS+=		argp.0:${PORTSDIR}/devel/argp-standalone
LIB_DEPENDS+=		expat.6:${PORTSDIR}/textproc/expat2
LIB_DEPENDS+=		gvc.5:${PORTSDIR}/graphics/graphviz
LDFLAGS+=		-largp 
.endif

#Don't strip binaries 
.if ${SAL_MODULE} == "multipr"
STRIP=		
.endif

#optionally dependency from cppunit
.if ${SAL_MODULE} == "kernel" || ${SAL_MODULE} == "gui" || ${SAL_MODULE} == "yacs" ||  ${SAL_MODULE} == "med"
.if defined(WITH_CPPUNIT)
CONFIGURE_ARGS+=	--with-cppunit=${LOCALBASE} --with-cppunit_inc=${LOCALBASE}/include/cppunit
BUILD_DEPENDS+=		cppunit-config:${PORTSDIR}/devel/cppunit
PLIST_SUB+=     CPPUNIT=""
.		else
CONFIGURE_ARGS+=	--with-cppunit=no
PLIST_SUB+=     CPPUNIT="@comment "
.endif
.endif

#optionally dependency from mpich2
.if ${SAL_MODULE} == "kernel" || ${SAL_MODULE} == "med"
.if defined(WITH_MPI)
LIB_DEPENDS+=	mpich.1:${PORTSDIR}/net/mpich2
CONFIGURE_ARGS+=	--with-mpich=${LOCALBASE}/mpich2 --with-mpi=${LOCALBASE}/mpich2
PLIST_SUB+=     MPI=""
.		else
#CONFIGURE_ARGS+=	--with-mpich=NO --with-mpi=NO
PLIST_SUB+=     MPI="@comment "
.endif
.endif

CONFIGURE_ENV+=		LDFLAGS="${LDFLAGS}" CXXFLAGS="${QSCIFLAGS} ${QTFLAGS} ${CXXFLAGS} " CPPFLAGS="${CPPFLAGS}"

.include <bsd.port.pre.mk>

#MAKE_JOBS_SAFE=	yes

.if ${SAL_MODULE} == "kernel"
    post-patch:
.	     if ${PYTHON_REL} > 260
	    ${REINPLACE_CMD} 's|fromlist=None)|fromlist=None, level=-1)|g' ${WRKSRC}/src/KERNEL_PY/import_hook.py
.	     endif
	    ${REINPLACE_CMD} 's|/bin/bash|${LOCALBASE}/bin/bash|g' ${WRKSRC}/bin/appli_clean.sh ${WRKSRC}/bin/runSalome
.endif

.if ${SAL_MODULE} == "gui"
    post-patch:
	${REINPLACE_CMD} 's|/bin/bash|${LOCALBASE}/bin/bash|g' ${WRKSRC}/bin/runLightSalome.sh
.endif

.if ${SAL_MODULE} == "yacs"
    post-patch:
	${CP} ${WRKSRC}/configure.in.base  ${WRKSRC}/configure.in
.endif

.if ${SAL_MODULE} == "med"
    post-install:
	${MV} ${PREFIX}/include/salome/Node.hxx ${PREFIX}/include/salome/MEDNode.hxx
.endif


.if ${SAL_MODULE} == "kernel"
    pre-patch:
	${MKDIR} ${WRKSRC}/src/Communication/rpc
	${CP} /usr/include/rpc/xdr.h ${WRKSRC}/src/Communication/rpc
	${REINPLACE_CMD} 's|__rpc_xdr|XDR|g' ${WRKSRC}/src/Communication/rpc/xdr.h
.endif

MMDEPENDS=${SAL_MODULE_UPPER}_DEPEND
AUTOTOOLS_ENV+=	${SAL_MODULE_UPPER}_ROOT_DIR=${PREFIX}

.for D in ${MMDEPENDS}
    AUTOTOOLS_ENV+=${D}_ROOT_DIR=${LOCALBASE}
.endfor

run-autotools-aclocal:
	echo "Start of aclocal"
	@(cd ${PATCH_WRKSRC} && ${SETENV} ${AUTOTOOLS_ENV} ${ACLOCAL} \
		${ACLOCAL_ARGS})
	echo "End of aclocal"

run-autotools-autoconf:
	echo "Start of autoconf"
	@(cd ${PATCH_WRKSRC} && ${SETENV} ${AUTOTOOLS_ENV} ${AUTOCONF} \
		${AUTOCONF_ARGS})
	echo "End of autotools"

run-autotools-automake:
	echo "Start of automake"
	@(cd ${PATCH_WRKSRC} && ${SETENV} ${AUTOTOOLS_ENV} ${AUTOMAKE} \
		${AUTOMAKE_ARGS})
	echo "End of automake"

.if ${SAL_MODULE} == "yacs"
run-autotools-autoheader:
	echo "Start of autoheader"
	@(cd ${PATCH_WRKSRC} && ${SETENV} ${AUTOTOOLS_ENV} ${AUTOHEADER} \
		${AUTOHEADER_ARGS})
	echo "End of autoheader"
.endif

patch-autotools:
	@(cd ${PATCH_WRKSRC}; ${LIBTOOLIZE} --force;)

pre-configure:
	${MKDIR} ${BUILD_WRKSRC}

.include <bsd.port.post.mk>