From 9c88f493179d48348def15c7cfd3e3ce60d2d624 Mon Sep 17 00:00:00 2001 From: userdocs <16525024+userdocs@users.noreply.github.com> Date: Wed, 27 Dec 2023 11:00:35 +0000 Subject: [PATCH] Update qbittorrent-nox-static.sh fix: https://github.com/userdocs/qbittorrent-nox-static/issues/131 a regression from the v2 update. fixed. If no crossbuild toolchain is used, check what Alpine host arch is being used and set that for zlib-ng --- qbittorrent-nox-static.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qbittorrent-nox-static.sh b/qbittorrent-nox-static.sh index 35f6fa73..3d7532a9 100644 --- a/qbittorrent-nox-static.sh +++ b/qbittorrent-nox-static.sh @@ -2268,8 +2268,8 @@ _glibc() { _zlib() { if [[ "${qbt_build_tool}" == "cmake" ]]; then mkdir -p "${qbt_install_dir}/graphs/${app_name}/${app_version["${app_name}"]}" - # force set some ARCH when using zlib-ng, cmake and musl-cross since it does detect the arch correctly. - [[ "${qbt_cross_target}" =~ ^(alpine)$ ]] && printf '%b\n' "\narchfound ${qbt_zlib_arch:-x86_64}" >> "${qbt_dl_folder_path}/cmake/detect-arch.c" + # force set some ARCH when using zlib-ng, cmake and musl-cross since it does not detect the arch correctly on Alpine. + [[ "${qbt_cross_target}" =~ ^(alpine)$ ]] && printf '%b\n' "\narchfound ${qbt_zlib_arch:-$(apk --print-arch)}" >> "${qbt_dl_folder_path}/cmake/detect-arch.c" cmake -Wno-dev -Wno-deprecated --graphviz="${qbt_install_dir}/graphs/${app_name}/${app_version["${app_name}"]}/dep-graph.dot" -G Ninja -B build \ -D CMAKE_VERBOSE_MAKEFILE="${qbt_cmake_debug}" \ -D CMAKE_CXX_STANDARD="${standard}" \ @@ -2282,8 +2282,8 @@ _zlib() { cmake --install build |& _tee -a "${qbt_install_dir}/logs/${app_name}.log" dot -Tpng -o "${qbt_install_dir}/completed/${app_name}-graph.png" "${qbt_install_dir}/graphs/${app_name}/${app_version["${app_name}"]}/dep-graph.dot" else - # force set some ARCH when using zlib-ng, configure and musl-cross since it does detect the arch correctly. - [[ "${qbt_cross_target}" =~ ^(alpine)$ ]] && sed "s| CFLAGS=\"-O2 \${CFLAGS}\"| ARCH=${qbt_zlib_arch:-x86_64}\n CFLAGS=\"-O2 \${CFLAGS}\"|g" -i "${qbt_dl_folder_path}/configure" + # force set some ARCH when using zlib-ng, configure and musl-cross since it does not detect the arch correctly on Alpine. + [[ "${qbt_cross_target}" =~ ^(alpine)$ ]] && sed "s| CFLAGS=\"-O2 \${CFLAGS}\"| ARCH=${qbt_zlib_arch:-$(apk --print-arch)}\n CFLAGS=\"-O2 \${CFLAGS}\"|g" -i "${qbt_dl_folder_path}/configure" ./configure --prefix="${qbt_install_dir}" --static --zlib-compat |& _tee "${qbt_install_dir}/logs/${app_name}.log" make -j"$(nproc)" CXXFLAGS="${CXXFLAGS}" CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" |& _tee -a "${qbt_install_dir}/logs/${app_name}.log" _post_command build