Skip to content

Commit

Permalink
Merge pull request #33 from mariux64/rebuild-python-2.7.15-1-to-2
Browse files Browse the repository at this point in the history
Rebuild python 2.7.15 1 to 2
  • Loading branch information
donald authored Nov 5, 2018
2 parents b5e87b4 + a9a565b commit ae6bbd4
Showing 1 changed file with 277 additions and 0 deletions.
277 changes: 277 additions & 0 deletions python-2.7.15-2.build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,277 @@
#! /bin/bash

PKG=python
VERSION=2.7.15
BUILD=2

PREFIX=/pkg/$PKG-$VERSION-$BUILD
# PREFIX=/dev/shm/pkg/$PKG-$VERSION-$BUILD

XPYTHONVER=2.7
XPYTHONLIB=$PREFIX/lib/python$XPYTHONVER/site-packages

PATH=/bin:/usr/bin:/usr/sbin:/usr/local/package/bin:/usr/local/bin
export PATH

set -xe
umask 022

BUILD_TMPDIR=/dev/shm/$PKG-$VERSION-$BUILD.build.tmp
test -d $BUILD_TMPDIR && rm -rf $BUILD_TMPDIR
mkdir -p $BUILD_TMPDIR/home
export TMPDIR=$BUILD_TMPDIR
export HOME=$BUILD_TMPDIR/home

exec </dev/null

mkdir -p $PREFIX
cat >$PREFIX/profile <<-EOF
PATH=$PREFIX/bin:\$PATH
PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig\${PKG_CONFIG_PATH:+:\$PKG_CONFIG_PATH}
export PKG_CONFIG_PATH
EOF
. $PREFIX/profile

export MAKEFLAGS="-j $(nproc)"

BUILDDIR=$PREFIX/build

mkdir -p $BUILDDIR
cd $BUILDDIR

function plaininstall() {
local dir=$1
local tar=$2
local url=$3
(
cd $BUILDDIR
test -e $tar || wget $url
test -d $dir || tar xvf $tar
cd $dir
./configure --prefix=$PREFIX
make -j $(nproc)
make install
)
}

URL=https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tgz
test -e Python-$VERSION.tgz || wget $URL
test -d Python-$VERSION || tar xf Python-$VERSION.tgz
cd Python-$VERSION

# Required for "Thenao" , bad for virtualenv --enable-shared
# Required for tensorflow : --enable-unicode=ucs4;
./configure --prefix=$PREFIX --enable-shared LDFLAGS=-Wl,-rpath,$PREFIX/lib --enable-unicode=ucs4
make
make install

cd $PREFIX
python -m ensurepip
pip install --upgrade pip

pip install distribute # requested by sven klages. For unknown reasons must be installed early

pip install Pillow
pip install virtualenv

pip install NumPy Matplotlib pandas SymPy nose

pip install ipython[all]
pip install ipywidgets
pip install scikit-learn
pip install seaborn

pip install bx-python # now at version 0.8.1

pip install Cython # for metaseq,pygpu
pip install pycurl # for metaseq
pip install metaseq

pip install macs2
pip install HTSeq

# for sasse: Theano and tensorflow (cuda version)

# install libgpuarray/pygpu for Tensorflow
(
VER=0.7.6
cd build
test -e libgpuarray-$VER.tar.gz || wget -O libgpuarray-$VER.tar.gz https://codeload.github.com/Theano/libgpuarray/tar.gz/v$VER
test -d libgpuarray-$VER || tar xf libgpuarray-$VER.tar.gz
cd libgpuarray-$VER
test -d Build || mkdir Build
cmake -DCMAKE_INSTALL_PREFIX=$PREFIX .
make
make install
python setup.py build_ext -L $PREFIX/lib -I $PREFIX/include
python setup.py install
)

pip install Theano

# these dickheads like to downgrade numpy, because there where problems on windows!
# https://github.com/tensorflow/tensorflow > 88917888f509e3e61ffe632534476e7b09d3326a
echo 'numpy >= 1.15.1' > $BUILDDIR/dont_clobber_numpy_on_linux
pip install tensorflow-gpu --constraint $BUILDDIR/dont_clobber_numpy_on_linux

pip install biopython # wird von bressin fuer python3 benutzt. klingt gut, ist in metaseq requirement drin
pip install git+git://github.com/tanghaibao/jcvi.git # angefragt von Dr. Jun Yang

# for Klages
#
# we need cairo otherwise pygtk won't do the gtk stuff and pygtk.h
# if we install cairo with wheel, we dont get a pkg-config file.
pip install --no-binary :all: pycairo
pip install GPy distribute h5py igraph ranger pep8
plaininstall pygobject-2.28.7 pygobject-2.28.7.tar.xz https://ftp.gnome.org/pub/gnome/sources/pygobject/2.28/pygobject-2.28.7.tar.xz
plaininstall pygtk-2.24.0 pygtk-2.24.0.tar.gz https://ftp.gnome.org/pub/GNOME/sources/pygtk/2.24/pygtk-2.24.0.tar.gz
# no new packages since apr 2010
plaininstall pygtksourceview-2.10.1 pygtksourceview-2.10.1.tar.gz https://ftp.gnome.org/pub/gnome/sources/pygtksourceview/2.10/pygtksourceview-2.10.1.tar.gz
plaininstall dbus-python-1.2.8 dbus-python-1.2.8.tar.gz https://dbus.freedesktop.org/releases/dbus-python/dbus-python-1.2.8.tar.gz

(
cd build
# nothing new since Apr 2011
test -e py2cairo-1.10.0.tar.gz || wget https://www.cairographics.org/releases/py2cairo-1.10.0.tar.bz2
test -d py2cairo-1.10.0 || tar xf py2cairo-1.10.0.tar.bz2
cd py2cairo-1.10.0
./waf configure --prefix=$PREFIX
./waf build
./waf install
)

pip install keras
pip install deeptools # Alena vom Boemmel -> helpdesk 19.04.2017, 3.0.1 Laura Glaser -> Helpdesk 05.03.2018

pip install sphinx
pip install recommonmark # Sabrina Krakau -> Helpdesk 21.06.2017
pip install fastcluster # Peter Arndt -> Helpdesk: PANNZER - dependencies, 21.07.2017

pip install umi_tools # Sven Klages -> Helpdesk 11.09.2017

# bunch of packages # Thomas Risch -> Helpdesk 20.11.2017 Topic: 'Cellprofiler', wxPython and gdal left out
# (11 plus deps) # wxPython might cause trouble with existing wxWidgets, gdal build needs more investigation
pip install pytest
pip install cellh5
pip install centrosome
pip install prokaryote
pip install inflect
pip install javabridge
pip install libtiff
pip install pydot
pip install pygraphviz
pip install python-bioformats
pip install MySQL-python

pip install CrossMap # Laura Glaser -> Helpdesk 07.12.2017

pip install cutadapt # Sabrina Krakau, 23.01.2018 (phd Seminar)

# to be removed from system. Install here:

plaininstall libxml2-2.9.8 libxml2-2.9.8.tar.gz http://xmlsoft.org/sources/libxml2-2.9.8.tar.gz
# nothing new since Mar 2012
plaininstall gnome-doc-utils-0.20.10 gnome-doc-utils-0.20.10.tar.xz https://ftp.gnome.org/pub/gnome/sources/gnome-doc-utils/0.20/gnome-doc-utils-0.20.10.tar.xz
pip install pssh

(
cd $BUILDDIR
test -e iotop-0.6.tar.gz || wget http://guichaz.free.fr/iotop/files/iotop-0.6.tar.gz
test -d iotop-0.6 || tar xf iotop-0.6.tar.gz
cd iotop-0.6
python setup.py install
mv $PREFIX/sbin/iotop $PREFIX/bin
rmdir $PREFIX/sbin
)

# win remote tools, linux alternativen zur power-shell, kreitler 06.03.2018
pip install pywinrm
pip install ptwinrm
pip install winremote

pip install joblib # helpdesk mail (03/28/18 13:22, Denise Thiel)

pip install MotifScan # Alena 30.8.2018
pip install MAmotif

pip install hic2cool # helpdesk robert schoepflin 17.09.2018
pip install hifive

# https://hicexplorer.readthedocs.io/en/latest/index.html
# HiCExplorer likes to downgrade practically everyting ...
cat <<__CONSTRAINTS > $BUILDDIR/such_a_lamer
numpy >= 1.13
scipy >= 1.0
matplotlib >= 2.1
pysam >= 0.11
intervaltree >= 2.1
biopython >= 1.68
tables >= 3.3
pandas >= 0.20
pyBigWig >= 0.3
six >= 1.10
future >= 0.16
cooler >= 0.7
jinja2 >= 2.9
unidecode >= 0.4
configparser >= 3.5
__CONSTRAINTS

# setup.py bdist_wheel for HiCExplorer fails, but setup.py install
# creates a working executable, so don't get confused.
pip install HiCExplorer --constraint $BUILDDIR/such_a_lamer --no-warn-conflicts

(
SIP_VERSION=4.19.13
SIP_SRC=https://sourceforge.net/projects/pyqt/files/sip/sip-$SIP_VERSION/sip-$SIP_VERSION.tar.gz

cd $BUILDDIR
test -e sip-$SIP_VERSION.tar.gz || wget $SIP_SRC
test -d sip-$SIP_VERSION || tar -xf sip-$SIP_VERSION.tar.gz

cd sip-$SIP_VERSION

python configure.py\
-b $PREFIX/bin \
-d $XPYTHONLIB \
-e $PREFIX/include/python$XPYTHONVER \
-v $PREFIX/share/sip

mkdir -p $PREFIX/share/sip
make; make install
)

(
# Don't use 5.11.3 !
PYQT_VERSION=5.10.1
PYQT_SRC=https://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-$PYQT_VERSION/PyQt5_gpl-$PYQT_VERSION.tar.gz

cd $BUILDDIR
test -e PyQt5_gpl-$PYQT_VERSION.tar.gz || wget $PYQT_SRC
test -d PyQt5_gpl-$PYQT_VERSION || tar -xf PyQt5_gpl-$PYQT_VERSION.tar.gz

cd PyQt5_gpl-$PYQT_VERSION

export QTDIR=/usr/local/qt5

python configure.py \
-b $PREFIX/bin \
-d $XPYTHONLIB \
-q /usr/local/qt5/bin/qmake \
-v $PREFIX/share/sip \
--confirm-license \
--no-designer-plugin \
--no-python-dbus \
--no-qml-plugin \
--no-stubs \
--sip-incdir=$PREFIX/include/python$XPYTHONVER \
--verbose

make -j $(nproc); make install
)

cp -pr $PREFIX/man $PREFIX/share
rm -r $PREFIX/man

# exit 1 # final test, inhibits 'closing' on success
exit

0 comments on commit ae6bbd4

Please sign in to comment.