mirror of
https://github.com/python-LimeReport/containers.git
synced 2025-10-14 23:32:48 +03:00
test
This commit is contained in:
7
scripts/install_extra.sh
Normal file
7
scripts/install_extra.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
PYTHON_PLATFORM=$(python3 -c "from packaging.tags import sys_tags; print(next(sys_tags()).platform.lower().replace(\"-\", \"_\").replace(\".\", \"_\").replace(\" \", \"_\"))")
|
||||
|
||||
echo "platform: $PYTHON_PLATFORM"
|
||||
|
||||
curl -L https://github.com/python-LimeReport/pyside6/releases/download/py${PYTHON_VERSION}-qt${QT_VERSION}/extra-$PYTHON_PLATFORM.tar.gz | tar -h -zx -C /usr/local
|
20
scripts/install_pipx.sh
Executable file
20
scripts/install_pipx.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
python3 -m pip install pipx
|
||||
python3 -m pipx ensurepath
|
||||
|
||||
source "$HOME/.bashrc"
|
||||
|
||||
#
|
||||
# cat <<EOF > /usr/local/bin/pipx
|
||||
# #!/bin/bash
|
||||
#
|
||||
# set -euo pipefail
|
||||
#
|
||||
# if [ \$(id -u) -eq 0 ]; then
|
||||
# export PIPX_HOME=/opt/_internal/pipx
|
||||
# export PIPX_BIN_DIR=/usr/local/bin
|
||||
# fi
|
||||
# ${TOOLS_PATH}/bin/pipx "\$@"
|
||||
# EOF
|
||||
# chmod 755 /usr/local/bin/pipx
|
66
scripts/install_python.sh
Executable file
66
scripts/install_python.sh
Executable file
@@ -0,0 +1,66 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
PYTHON_INSTALL_PATH="${INSTALLPATH:-"/usr/local/python"}"
|
||||
CURRENT_PATH="${PYTHON_INSTALL_PATH}/current"
|
||||
|
||||
find_version_from_git_tags() {
|
||||
local variable_name=$1
|
||||
local requested_version=${!variable_name}
|
||||
if [ "${requested_version}" = "none" ]; then return; fi
|
||||
local repository=$2
|
||||
local prefix=${3:-"tags/v"}
|
||||
local separator=${4:-"."}
|
||||
local last_part_optional=${5:-"false"}
|
||||
if [ "$(echo "${requested_version}" | grep -o "." | wc -l)" != "2" ]; then
|
||||
local escaped_separator=${separator//./\\.}
|
||||
local last_part
|
||||
if [ "${last_part_optional}" = "true" ]; then
|
||||
last_part="(${escaped_separator}[0-9]+)?"
|
||||
else
|
||||
last_part="${escaped_separator}[0-9]+"
|
||||
fi
|
||||
local regex="${prefix}\\K[0-9]+${escaped_separator}[0-9]+${last_part}$"
|
||||
local version_list="$(git ls-remote --tags ${repository} | grep -oP "${regex}" | tr -d ' ' | tr "${separator}" "." | sort -rV)"
|
||||
if [ "${requested_version}" = "latest" ] || [ "${requested_version}" = "current" ] || [ "${requested_version}" = "lts" ]; then
|
||||
declare -g ${variable_name}="$(echo "${version_list}" | head -n 1)"
|
||||
else
|
||||
set +e
|
||||
declare -g ${variable_name}="$(echo "${version_list}" | grep -E -m 1 "^${requested_version//./\\.}([\\.\\s]|$)")"
|
||||
set -e
|
||||
fi
|
||||
fi
|
||||
if [ -z "${!variable_name}" ] || ! echo "${version_list}" | grep "^${!variable_name//./\\.}$" > /dev/null 2>&1; then
|
||||
echo -e "Invalid ${variable_name} value: ${requested_version}\nValid values:\n${version_list}" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "${variable_name}=${!variable_name}"
|
||||
}
|
||||
|
||||
add_symlink() {
|
||||
if [[ ! -d "${CURRENT_PATH}" ]]; then
|
||||
ln -s -r "${INSTALL_PATH}" "${CURRENT_PATH}"
|
||||
fi
|
||||
|
||||
if [ "${OVERRIDE_DEFAULT_VERSION}" = "true" ]; then
|
||||
if [[ $(ls -l ${CURRENT_PATH}) != *"-> ${INSTALL_PATH}"* ]] ; then
|
||||
rm "${CURRENT_PATH}"
|
||||
ln -s -r "${INSTALL_PATH}" "${CURRENT_PATH}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
VERSION="3.9"
|
||||
|
||||
find_version_from_git_tags VERSION "https://github.com/python/cpython"
|
||||
|
||||
mkdir -p /tmp/python-src
|
||||
cd /tmp/python-src
|
||||
tgz_filename="Python-${VERSION}.tgz"
|
||||
tgz_url="https://www.python.org/ftp/python/${VERSION}/${tgz_filename}"
|
||||
echo "Downloading ${tgz_filename}..."
|
||||
curl -sSL -o "/tmp/python-src/${tgz_filename}" "${tgz_url}"
|
||||
tar -xzf "/tmp/python-src/${tgz_filename}" -C "/tmp/python-src" --strip-components=1
|
||||
cd /tmp/python-src
|
||||
./configure --enable-optimizations
|
||||
make -j "$(nproc)" install
|
||||
alias python=/usr/local/bin/python3
|
5
scripts/install_qt.sh
Executable file
5
scripts/install_qt.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source "$HOME/.bashrc"
|
||||
|
||||
/root/.local/bin/aqt install-qt --outputdir /opt/Qt linux desktop ${QT_VERSION}
|
Reference in New Issue
Block a user