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
69 lines (47 sloc)
1.24 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 { | |
SRCURL="${BUILD_python_SRCURL}" | |
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}" | |
pushd "${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==2024.0.1 | |
# for unpaper | |
pip3 install meson | |
# for paperless-ngx | |
pip3 install sphinx | |
popd | |
} | |
pushd ${BUILD_DIR} | |
B_PYTHON | |
popd | |
} |