Skip to content

Commit

Permalink
Update qbittorrent-nox-static.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
userdocs committed Apr 7, 2023
1 parent 55dc27d commit d4882a1
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions qbittorrent-nox-static.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,6 @@
#
# @credits - https://gist.github.com/notsure2 https://github.com/c0re100/qBittorrent-Enhanced-Edition
#
# shellcheck disable=SC2034,SC1091
# Why are these checks excluded?
#
# https://github.com/koalaman/shellcheck/wiki/SC2034
# There are quite a few variables defined by combining other variables that mean nothing on their own.
# This behavior is intentional and the warning can be skipped.
#
# https://github.com/koalaman/shellcheck/wiki/SC1091
# I am sourcing /etc/os-release for some variables.
# It's not available to shellcheck to source and it's a safe file so we can skip this
#
# Script Formatting - https://marketplace.visualstudio.com/items?itemName=foxundermoon.shell-format
#
#################################################################################################################################################
Expand Down Expand Up @@ -59,16 +48,30 @@ ugrc="\e[37m\U2B24\e[0m" ulgrcc="\e[97m\U2B24\e[0m" # [u]nicode[gr]ey[c]ircle

cdef="\e[39m" # [c]olor[def]ault
cend="\e[0m" # [c]olor[end]

_color_test() {
colour_array=("${cr}" "${clr}" "${cg}" "${clg}" "${cy}" "${cly}" "${cb}" "${clb}" "${cm}" "${cc}" "${cl}" "${tb}" "${td}" "${tu}" "${tn}" "${tbk}" "${urc}" "${ulrc}" "${ugc}" "${ulgc}" "${uyc}" "${ulyc}" "${ubc}" "${ulbc}" "${umc}" "${ulmc}" "${ucc}" "${ulcc}" "${ugrc}" "${ulgrcc}" "${cdef}" "${cend}")
printf '\n'
for colours in "${colour_array[@]}"; do
printf '%b\n' "${colours} Test ${cend}"
done
printf '\n'
exit
}
[[ "${1}" == "ctest" ]] && _color_test
#######################################################################################################################################################
# Check we are on a supported OS and release.
#######################################################################################################################################################
# Get the main platform name, for example: debian, ubuntu or alpine
# shellcheck source=/dev/null
what_id="$(source /etc/os-release && printf "%s" "${ID}")"

# Get the codename for this this OS. Note, Alpine does not have a unique codename.
# shellcheck source=/dev/null
what_version_codename="$(source /etc/os-release && printf "%s" "${VERSION_CODENAME}")"

# Get the version number for this codename, for example: 10, 20.04, 3.12.4
# shellcheck source=/dev/null
what_version_id="$(source /etc/os-release && printf "%s" "${VERSION_ID%_*}")"

# Account for variation in the versioning 3.1 or 3.1.0 to make sure the check works correctly
Expand Down Expand Up @@ -114,10 +117,11 @@ multi_arch_options[riscv64]="riscv64"
#######################################################################################################################################################
_set_default_values() {
# Source env vars from a file if it exists
# shellcheck source=/dev/null
[[ -f "${PWD}/.qbt_env" ]] && source "${PWD}/.qbt_env"

# For docker deploys to not get prompted to set the timezone.
DEBIAN_FRONTEND="noninteractive" && TZ="Europe/London"
export DEBIAN_FRONTEND="noninteractive" && TZ="Europe/London"

# The default build configuration is qmake + qt5, qbt_build_tool=cmake or -c will make qt6 and cmake default
qbt_build_tool="${qbt_build_tool:-qmake}"
Expand Down Expand Up @@ -179,7 +183,7 @@ _set_default_values() {

# Set the CXX standards used to build cxx code.
# ${standard} - Set the CXX standard. You may need to set c++14 for older versions of some apps, like qt 5.12
standard="17" && cpp_standard="c${standard}" && cxx_standard="c++${standard}"
standard="17" cxx_standard="c++${standard}"

# The Alpine repository we use for package sources
CDN_URL="http://dl-cdn.alpinelinux.org/alpine/edge/main" # for alpine
Expand Down Expand Up @@ -878,10 +882,8 @@ _installation_modules() {
# Set some python variables we need.
python_major="$(python"${qbt_python_version}" -c "import sys; print(sys.version_info[0])")"
python_minor="$(python"${qbt_python_version}" -c "import sys; print(sys.version_info[1])")"
python_micro="$(python"${qbt_python_version}" -c "import sys; print(sys.version_info[2])")"

python_short_version="${python_major}.${python_minor}"
python_link_version="${python_major}${python_minor}"

printf '%b\n' "using gcc : : : <cflags>${qbt_optimize/*/${qbt_optimize} }-std=${cxx_standard} <cxxflags>${qbt_optimize/*/${qbt_optimize} }-std=${cxx_standard} ;${tn}using python : ${python_short_version} : /usr/bin/python${python_short_version} : /usr/include/python${python_short_version} : /usr/lib/python${python_short_version} ;" > "${HOME}/user-config.jam"

Expand Down Expand Up @@ -985,13 +987,11 @@ _download() {

if [[ "${qbt_workflow_files}" == "no" ]] || [[ "${qbt_workflow_override[${app_name}]}" == "yes" ]]; then
qbt_dl_source_url="${source_archive_url[${app_name}]}"
qbt_dl_file_name="${source_archive_url[${app_name}]##*/}"
source_type="source"
fi

if [[ "${qbt_workflow_files}" == "yes" && "${qbt_workflow_override[${app_name}]}" == "no" ]] || [[ "${qbt_workflow_artifacts}" == 'yes' ]]; then
qbt_dl_source_url="${qbt_workflow_archive_url[${app_name}]}"
qbt_dl_file_name="${qbt_workflow_archive_url[${app_name}]##*/}"
[[ "${qbt_workflow_files}" == "yes" ]] && source_type="workflow"
[[ "${qbt_workflow_artifacts}" == "yes" ]] && source_type="artifact"
fi
Expand Down Expand Up @@ -1481,10 +1481,10 @@ _multi_arch() {

[[ "${1}" == 'info_bootstrap' ]] && return

CHOST="${qbt_cross_host}"
CC="${qbt_cross_host}-gcc"
AR="${qbt_cross_host}-ar"
CXX="${qbt_cross_host}-g++"
export CHOST="${qbt_cross_host}"
export CC="${qbt_cross_host}-gcc"
export AR="${qbt_cross_host}-ar"
export CXX="${qbt_cross_host}-g++"

mkdir -p "${qbt_install_dir}/logs"

Expand Down Expand Up @@ -2360,9 +2360,9 @@ _boost() {
#######################################################################################################################################################
# shellcheck disable=SC2317
_libtorrent() {
BOOST_ROOT="${qbt_install_dir}/boost"
BOOST_INCLUDEDIR="${qbt_install_dir}/boost"
BOOST_BUILD_PATH="${qbt_install_dir}/boost"
export BOOST_ROOT="${qbt_install_dir}/boost"
export BOOST_INCLUDEDIR="${qbt_install_dir}/boost"
export BOOST_BUILD_PATH="${qbt_install_dir}/boost"

if [[ "${qbt_build_tool}" == 'cmake' ]]; then
mkdir -p "${qbt_install_dir}/graphs/${app_name}/${app_version["${app_name}"]}"
Expand Down Expand Up @@ -2425,7 +2425,7 @@ _double_conversion() {
if [[ "${qbt_build_tool}" == 'cmake' && "${qbt_qt_version}" =~ ^6 ]]; then
mkdir -p "${qbt_install_dir}/graphs/${app_name}/${app_version["${app_name}"]}"
cmake -Wno-dev -Wno-deprecated --graphviz="${qbt_install_dir}/graphs/${app_name}/${app_version["${app_name}"]}/dep-graph.dot" -G Ninja -B build \
"${multi_libtorrent[@]}" \
"${multi_double_conversion[@]}" \
-D CMAKE_VERBOSE_MAKEFILE="${qbt_cmake_debug}" \
-D CMAKE_PREFIX_PATH="${qbt_install_dir}" \
-D CMAKE_CXX_FLAGS="${CXXFLAGS}" \
Expand Down

0 comments on commit d4882a1

Please sign in to comment.