Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 98 lines (74 sloc) 3.05 KB
#! /bin/sh
set -xe
PKG=tulip
PYTHON37=/pkg/python-3.7.1-1
QUAZIP_VERSION=0.7.3
QUAZIP_SRC=https://sourceforge.net/projects/quazip/files/quazip/${QUAZIP_VERSION}/quazip-${QUAZIP_VERSION}.tar.gz
TULIP_VERSION=5.2.1
TULIP_SRC=https://sourceforge.net/projects/auber/files/tulip/tulip-${TULIP_VERSION}/tulip-${TULIP_VERSION}_src.tar.gz
BUILD=0
PREFIX=/pkg/$PKG-$TULIP_VERSION-$BUILD
#PREFIX=/dev/shm/pkg/$PKG-$TULIP_VERSION-$BUILD
mkdir -p $PREFIX
cat >$PREFIX/profile <<-EOF
PATH=$PREFIX/bin:$PYTHON37/bin:\$PATH
LD_LIBRARY_PATH=$PREFIX/lib:$PYTHON37/lib\${LD_LIBRARY_PATH:+":\$LD_LIBRARY_PATH"}
export LD_LIBRARY_PATH
EOF
source $PREFIX/profile
mkdir -p $PREFIX/build
# --- build QUAZIP ---
cd $PREFIX/build
test -e quazip-${QUAZIP_VERSION}.tar.gz || wget $QUAZIP_SRC
test -n "$XWIPE" && rm -rf quazip-${QUAZIP_VERSION}
test -d quazip-${QUAZIP_VERSION} || tar -xf quazip-${QUAZIP_VERSION}.tar.gz
mkdir -p quazip-${QUAZIP_VERSION}/build
cd quazip-${QUAZIP_VERSION}/build
cmake \
-DCMAKE_PREFIX_PATH=/usr/local/qt5/lib/cmake \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_CXX_FLAGS=-fPIC \
-DCMAKE_COLOR_MAKEFILE=OFF \
-DCMAKE_VERBOSE_MAKEFILE=ON \
..
make -j $(nproc)
# do not install FindQuaZip5.cmake into /usr/share/cmake-3.8
sed -i -e "/file(INSTALL DESTINATION / s,/usr,$PREFIX," cmake_install.cmake
make install
# --- build TULIP ---
cd $PREFIX/build
test -e tulip-${TULIP_VERSION}_src.tar.gz || wget $TULIP_SRC
test -n "$XWIPE" && rm -rf tulip-${TULIP_VERSION}
test -d tulip-${TULIP_VERSION} || tar -xf tulip-${TULIP_VERSION}_src.tar.gz
mkdir -p tulip-${TULIP_VERSION}/build
cd tulip-${TULIP_VERSION}
# Resolve an issue with "No module named 'tulip.native.sip'",
# meaning '/pkg/tulip-5.2.1-0/lib/tulip/python/tulip/native/sip.so' isn't available.
#
# The unmodified build has some problems with
# a) The 'system sip', which is not in a default location
# b) there is also a 'thirdparty' sip in the source tree
# c) sip tries to cope with such issues by allowing explicit definition
# of a local/private sip module
# So something seems to follow the wrong logic.
# Here is the cure:
# throw some chaff, so TULIP_SIP won't be usable ...
sed -i.debris -e '/ifdef/ s/TULIP_SIP/TULIP_SIP_XXX/' library/tulip-python/src/PythonInterpreter.cpp
sed -i.debris -e '/ifdef/ s/TULIP_SIP/TULIP_SIP_XXX/' library/tulip-python/include/tulip/PythonIncludes.h
# inhibit usage of the '-n name' option (qualified name of the private copy of the sip [python-]module)
sed -i.debris -e '/COMMAND/ s/-n tulip.native.sip//' library/tulip-python/bindings/tulip-gui/CMakeLists.txt
sed -i.debris -e '/COMMAND/ s/-n tulip.native.sip//' library/tulip-python/bindings/tulip-core/CMakeLists.txt
sed -i.debris -e '/COMMAND/ s/-n tulip.native.sip//' library/tulip-python/bindings/stl/CMakeLists.txt
cd build
cmake \
-DCMAKE_PREFIX_PATH=/usr/local/qt5/lib/cmake \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DTULIP_USE_QT5=ON \
-DPYTHON_EXECUTABLE=$PYTHON37/bin/python3.7 \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_COLOR_MAKEFILE=OFF \
-DCMAKE_VERBOSE_MAKEFILE=ON \
..
make -j $(nproc)
make install
exit