Permalink
Cannot retrieve contributors at this time
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?
paperless-baremetal/Python.build.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
70 lines (47 sloc)
1.38 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
{ | |
set -x | |
set -e | |
set -u | |
. build.profile | |
. "${PREFIX}/${BUILD_sqlite}/profile" | |
function B_PYTHON { | |
# apt install libbz2-dev | |
# wget "https://www.python.org/ftp/python/3.11.9/Python-3.11.9.tgz" | |
SRCURL[0]="https://beehive.molgen.mpg.de/bfd4d3bfeac4216ce35d7a503bf02d5c/Python-3.11.9.tgz" | |
BUILD_PKG=${BUILD_python} | |
PREFIX="${PREFIX}/${BUILD_PKG}" | |
mkdir -p "${PREFIX}" | |
cat >"${PREFIX}"/profile <<-EOF | |
PATH="${PREFIX}"/bin:\${PATH} | |
EOF | |
test -e "${BUILD_PKG}.tar.gz" || wget -nv "${SRCURL}" -O "${BUILD_PKG}.tar.gz" | |
test -d "${BUILD_PKG}" || mkdir -pv "${BUILD_PKG}" && tar -xf "${BUILD_PKG}.tar.gz" --strip-components=1 -C "${BUILD_PKG}" | |
. "${PREFIX}/profile" | |
cd "${BUILD_PKG}" | |
local _conf=( | |
--prefix "${PREFIX}" | |
--enable-loadable-sqlite-extensions | |
--enable-optimizations | |
) | |
export PKG_CONFIG_PATH | |
SQLITE_PREFIX=$(pkg-config sqlite3 --variable=prefix) | |
LDFLAGS="-Wl,-rpath -Wl,-L${SQLITE_PREFIX}/lib" \ | |
./configure "${_conf[@]}" | |
make -j "${NPROC}" | |
make install | |
ln -vfs python3 "${PREFIX}/bin/python" | |
ln -vfs python3-config "${PREFIX}/bin/python-config" | |
ln -vfs pydoc3 "${PREFIX}/bin/pydoc" | |
ln -vfs idle3 "${PREFIX}/bin/idle" | |
ln -vfs pip3 "${PREFIX}/bin/pip" | |
. "${PREFIX}/profile" | |
pip3 install --prefix="${PREFIX}" --upgrade pip | |
python3 -m pip install --no-cache-dir --upgrade pipenv==2023.12.1 | |
pip3 install meson | |
pip3 install sphinx | |
} | |
pushd "${BUILD_DIR}" | |
B_PYTHON | |
popd | |
} |