-
Notifications
You must be signed in to change notification settings - Fork 3
/
spkg-install
executable file
·55 lines (49 loc) · 1.62 KB
/
spkg-install
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
#! /bin/sh
if [ "$SPKG_LOCAL" = "" ]; then
echo "SPKG_LOCAL undefined ... exiting";
echo "Maybe run 'qsnake --shell'?"
exit 1
fi
set -e
# detect shared library file suffix extension
LIB_SUFFIX=so
PY_LIB_SUFFIX=a
if [ `uname -s` = Darwin ] ; then
LIB_SUFFIX=dylib
fi
if [ $UNAME = "CYGWIN" ] ; then
LIB_SUFFIX=dll.a
PY_LIB_SUFFIX=dll.a
fi
cmake -DBUILD_SHARED_LIBS:BOOL=ON \
-DCMAKE_BUILD_TYPE=Release \
-DVTK_WRAP_PYTHON:BOOL=ON \
-DPYTHON_EXECUTABLE:FILEPATH=$SPKG_LOCAL/bin/python \
-DPYTHON_INCLUDE_PATH:PATH=$SPKG_LOCAL/include/python2.6 \
-DPYTHON_LIBRARY:FILEPATH=$SPKG_LOCAL/lib/python2.6/config/libpython2.6.$PY_LIB_SUFFIX \
-DVTK_USE_GUISUPPORT:BOOL=ON \
-DVTK_USE_DISPLAY:BOOL=ON \
-DVTK_USE_GL2PS:BOOL=ON \
-DVTK_USE_X:BOOL=ON \
-DVTK_USE_TK:BOOL=OFF \
-DBUILD_TESTING:BOOL=OFF \
-DCMAKE_INSTALL_PREFIX:PATH="$SPKG_LOCAL" \
-DCMAKE_USE_RELATIVE_PATHS:BOOL=OFF \
-DVTK_OPENGL_HAS_OSMESA=ON \
-DVTK_USE_OFFSCREEN=ON \
-DOSMESA_INCLUDE_DIR=$SPKG_LOCAL \
-DOSMESA_LIBRARY=$SPKG_LOCAL/lib/libOSMesa.$LIB_SUFFIX \
-DOPENGL_INCLUDE_DIR=$SPKG_LOCAL/include \
-DOPENGL_gl_LIBRARY=$SPKG_LOCAL/lib/libGL.$LIB_SUFFIX \
-DOPENGL_glu_LIBRARY=$SPKG_LOCAL/lib/libGLU.$LIB_SUFFIX \
.
make
make install
# TODO:
# 1) When the Python build fails due to missing openpty, it needs to be linked
# with: -ldl -lpthread -lutil
# (see http://root.cern.ch/root/roottalk/roottalk11/1344.html)
# The solution probably is to link with libpython.so instead of libpython.a
#
# 2) The vtk libraries must be moved from $SPKG_LOCAL/lib/vtk-5.10/* to
# $SPKG_LOCAL/lib/*