blob: cd37b96be333578a07420cfbd5949d850ad7a7b4 (
plain) (
blame)
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
|
#!/bin/bash
## run like this: ./compile_python_debian.sh 3.8.1 3.8.1 (for example)
PYTHON_VERSION=$1
#echo "Updating system...."
sudo xbps-install -y make libssl3 zlib-devel
sudo xbps-install -y bzip3-devel readline-devel sqlite-devel wget curl llvm
sudo xbps-install -y ncurses-devel xz liblzma-devel tk-devel
cd $HOME/Downloads
wget https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz
DIR="$HOME/.python$PYTHON_VERSION"
if [ -d $DIR ]
then
echo "$0: directory '$DIR' exists."
echo "Not overwriting existing Python installation. Exiting."
exit 1
else
echo "Creating $DIR..."
mkdir $DIR
fi
tar -xvf Python-$PYTHON_VERSION.tar.xz
cd Python-$PYTHON_VERSION
#e we set LDFLAGS pointing to install directory if system does not have libpython3.6 Here we set LDFLAGS pointing to install directory if system does not have libpython3.6
./configure --prefix="$DIR" LDFLAGS="-Wl,--rpath=$DIR/lib"
#./configure --prefix="$DIR" --enabled-shared LDFLAGS="-Wl,--rpath=$DIR/lib"
make
make install
cd ~
rm -rf $HOME/Downloads/Python-$PYTHON_VERSION
rm $HOME/Downloads/Python-$PYTHON_VERSION.tar.xz
echo "Done...!"
|