forked from lmbelo/python3-embeddable
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
38 lines (27 loc) · 726 Bytes
/
Copy pathbuild.sh
File metadata and controls
38 lines (27 loc) · 726 Bytes
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
set -e
set -x
# Initialize variables
THIS_DIR="$PWD"
PY_SRC_DIR=src/Python-$PYVER
# Clear the last build
if [ -d src ]; then rm -Rf src; fi
if [ -d build ]; then rm -Rf build; fi
if [ -d embedabble ]; then rm -Rf embedabble; fi
# Create the Python source dir
mkdir -p src
pushd src
# Download Python
curl -vLO https://www.python.org/ftp/python/$PYVER/Python-$PYVER.tar.xz
tar --no-same-owner -xf Python-$PYVER.tar.xz
popd
# ---------------- #
pushd $PY_SRC_DIR
# Configure and make Python from source
./configure --enable-shared --prefix=/usr
make
make install DESTDIR="$THIS_DIR/build"
popd
# Create the embeddable dir and moves Python distribution into it
mkdir -p embedabble
mv build/usr/* embedabble