#
# netgen version
#
-NETGEN_VERSION=5.0.0
+NETGEN_VERSION=4.9.13
check_version()
{
# unpack
check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INST_ROOT}
+local patch_sources=1
+local patch_build=1
+local patch_gcc43=1
# apply general patch for SALOME
-if [ -f patches/netgen-${NETGEN_VERSION}-for-SALOME.patch ] ; then
- cp patches/netgen-${NETGEN_VERSION}-for-SALOME.patch ${PRODUCT_SRC_DIR}
- ( cd ${PRODUCT_SRC_DIR}; patch -p1 < netgen-${NETGEN_VERSION}-for-SALOME.patch && \
- sed -i "s/^\(SUBDIRS = .* \)ng /\1nglib #/g" Makefile.in > /dev/null && \
- sed -i "s%#include <string>%#include <string>\n#include <string.h>%g" libsrc/include/mystdlib.h > /dev/null )
+if [ "${patch_sources}" = "1" ] ; then
+ if [ -f patches/netgen-${NETGEN_VERSION}-for-SALOME.patch ] ; then
+ cp patches/netgen-${NETGEN_VERSION}-for-SALOME.patch ${PRODUCT_SRC_DIR}
+ cd ${PRODUCT_SRC_DIR}
+ patch -p1 < netgen-${NETGEN_VERSION}-for-SALOME.patch
+ fi
+fi
+# patch for gcc 4.3 compatibility
+if [ "${patch_gcc43}" = "1" ] ; then
+ cd ${PRODUCT_SRC_DIR}
+ sed -i "s%#include <string>%#include <string>\n#include <string.h>%g" libsrc/include/mystdlib.h
+fi
+# patch to make nglib only:
+if [ "${patch_build}" = "1" ] ; then
+ cd ${PRODUCT_SRC_DIR}
+ sed -i "s/^\(SUBDIRS = .* \)ng /\1nglib #/g" Makefile.in
fi
-
-# to make nglib only:
-# -SUBDIRS = libsrc ng nglib tutorials doc windows
-# +SUBDIRS = libsrc nglib #ng tutorials doc windows
-( cd ${PRODUCT_SRC_DIR} && sed -i "s/^\(SUBDIRS = .* \)ng /\1nglib #/g" Makefile.in )
-
-# patch for gcc 4.3
-( cd ${PRODUCT_SRC_DIR} && sed -i "s%#include <string>%#include <string>\n#include <string.h>%g" libsrc/include/mystdlib.h )
# to generate environment scripts
try_preinstalled
# install
check_job ${PRODUCT_DIR}/INSTALL.LOG make install
+# copy additional headers
for directory in general gprim linalg meshing ; do
cp -f ${PRODUCT_SRC_DIR}/libsrc/${directory}/*.hpp ${PRODUCT_DIR}/include
done
cp -f ${PRODUCT_SRC_DIR}/libsrc/include/mystdlib.h ${PRODUCT_SRC_DIR}/libsrc/include/mydefs.hpp ${PRODUCT_DIR}/include
cp -f ${PRODUCT_SRC_DIR}/libsrc/occ/occgeom.hpp ${PRODUCT_SRC_DIR}/libsrc/occ/occmeshsurf.hpp ${PRODUCT_DIR}/include
+# fix libGL dependencies
+cd ${PRODUCT_DIR}/lib && fix_gl_libs
+
cd ${PRODUCT_DIR};
# remove sources and temporary files after building