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 136 lines (104 sloc) 3.82 KB
#! /bin/bash
# COOKIE=$(mcookie|cut -c-8); grep -v V_GREP_ME $0 > /dev/shm/runme-$COOKIE.sh ; sleep 0.3; exec bash /dev/shm/runme-$COOKIE.sh
# TESTING=1
PKG=pymol-open-source
VERSION=2.5.0
BUILD=0
PREFIX=/pkg/$PKG-$VERSION-$BUILD
if [ -n "$TESTING" ]; then PREFIX=/scratch/local2/$PKG-$VERSION-$BUILD ; fi
PATH=/bin:/usr/bin:/usr/sbin:/usr/local/bin
set -xe
umask 022
BUILD_TMPDIR=/scratch/local2/$PKG-$VERSION-$BUILD.$USER.build.tmp
test -d $BUILD_TMPDIR && ( chmod -R u+rwx $BUILD_TMPDIR || true ; rm -rf $BUILD_TMPDIR )
export TMPDIR=$BUILD_TMPDIR
export HOME=$BUILD_TMPDIR/home
exec </dev/null
mkdir -p $PREFIX
cat >$PREFIX/profile <<-EOF
# pymol is build against current python-3.9.7-0
PYFP='3.9.7.*Sep 22 2021, 08:50:06'
python -VV | grep -q "\$PYFP" || . /pkg/python-3.9.7-0/profile
PATH=$PREFIX/bin:\$PATH
export LD_LIBRARY_PATH=$PREFIX/lib\${LD_LIBRARY_PATH:+:}\$LD_LIBRARY_PATH
PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig\${PKG_CONFIG_PATH:+:}\$PKG_CONFIG_PATH
export PKG_CONFIG_PATH
if [ -d $PREFIX/.compatlibs ]; then export LD_LIBRARY_PATH=$PREFIX/.compatlibs\${LD_LIBRARY_PATH:+:}\$LD_LIBRARY_PATH ; fi
EOF
. $PREFIX/profile
NPROC=$(( $(nproc) * 4 / 5 + 1 ))
export MAKEFLAGS="-j $NPROC"
BUILDDIR=$PREFIX/build
mkdir -p $BUILDDIR
cd $BUILDDIR
if /bin/true ; then
(
# https://github.com/msgpack/msgpack-c/archive/refs/tags/cpp-4.1.1.tar.gz
# -> msgpack-c-cpp-4.1.1.tar.gz
BEEHIVE=https://beehive.molgen.mpg.de/74d2b6675d0660c570e722b82dc04f8b/msgpack-c-cpp-4.1.1.tar.gz
test -e msgpack-c-cpp-4.1.1.tar.gz || wget -nv $BEEHIVE
test -d msgpack-c-cpp-4.1.1 || tar -xf msgpack-c-cpp-4.1.1.tar.gz
cd msgpack-c-cpp-4.1.1
mkdir -p build
cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_VERBOSE_MAKEFILE=ON \
..
make -j $NPROC
make install
)
(
# https://github.com/rcsb/mmtf-cpp/archive/refs/tags/v1.0.0.tar.gz
BEEHIVE=https://beehive.molgen.mpg.de/553f028a771b9d9f824903a2bf34be51/mmtf-cpp-1.0.0.tar.gz
test -e mmtf-cpp-1.0.0.tar.gz || wget -nv $BEEHIVE
test -d mmtf-cpp-1.0.0 || tar -xf mmtf-cpp-1.0.0.tar.gz
cd mmtf-cpp-1.0.0
mkdir -p build
cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_PREFIX_PATH=$PREFIX \
..
make -j $NPROC
make install
)
(
# https://github.com/g-truc/glm/archive/refs/tags/0.9.9.8.tar.gz
BEEHIVE=https://beehive.molgen.mpg.de/0e83d4a33c7d4044a2c35c8d6aba4671/glm-0.9.9.8.tar.gz
test -e glm-0.9.9.8.tar.gz || wget -nv $BEEHIVE
test -d glm-0.9.9.8 || tar -xf glm-0.9.9.8.tar.gz
cd glm-0.9.9.8
mkdir -p build
cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_PREFIX_PATH=$PREFIX \
-DGLM_TEST_ENABLE=OFF \
..
make -j $NPROC
mkdir -p $PREFIX/include
cp -ax ../glm $PREFIX/include
)
fi
(
# https://github.com/schrodinger/pymol-open-source/archive/refs/tags/v2.5.0.tar.gz
BEEHIVE=https://beehive.molgen.mpg.de/1c2d43789dd5580958fd75672ecfd8e7/pymol-open-source-2.5.0.tar.gz
test -e pymol-open-source-2.5.0.tar.gz || wget -nv $BEEHIVE
test -d pymol-open-source-2.5.0 || tar -xf pymol-open-source-2.5.0.tar.gz
cd pymol-open-source-2.5.0
# patch setup.py, great, everthing else but a hack is a waste of time ...
# needed -lcurl -lhdf5_hl -lhdf5_cpp -lhdf5, hdf 5 is static, curl was forgotten ?
# old: extra_link_args = ext_link_args,
# new: extra_link_args = ['-lcurl', '-lhdf5_hl', '-lhdf5_cpp', '-lhdf5'] + ext_link_args,
sed -i -e '/\s\s*extra_link_args/ s/= /= \["-lcurl", "-lhdf5_hl", "-lhdf5_cpp", "-lhdf5"\] + /' setup.py
export PREFIX_PATH=$PREFIX
export CXXFLAGS='-I/usr/include -I/usr/include/freetype2 -I/usr/include/libxml2'
python setup.py build --use-msgpackc c++11
python setup.py install --prefix=$PREFIX
)