Skip to content

Commit

Permalink
fix openssl download in cross build (#578)
Browse files Browse the repository at this point in the history
  • Loading branch information
abcfy2 authored Aug 2, 2024
1 parent fb6e1ae commit 3e3a6df
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build_appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ prepare_buildenv() {
cmake_binary_url="https://github.com/Kitware/CMake/releases/download/v${cmake_latest_ver}/cmake-${cmake_latest_ver}-linux-x86_64.tar.gz"
cmake_sha256_url="https://github.com/Kitware/CMake/releases/download/v${cmake_latest_ver}/cmake-${cmake_latest_ver}-SHA-256.txt"
if [ x"${USE_CHINA_MIRROR}" = x1 ]; then
cmake_binary_url="https://mirror.ghproxy.com/${cmake_binary_url}"
cmake_sha256_url="https://mirror.ghproxy.com/${cmake_sha256_url}"
cmake_binary_url="https://ghproxy.org/${cmake_binary_url}"
cmake_sha256_url="https://ghproxy.org/${cmake_sha256_url}"
fi
if [ -f "/usr/src/cmake-${cmake_latest_ver}-linux-x86_64.tar.gz" ]; then
cd /usr/src
Expand All @@ -158,7 +158,7 @@ prepare_buildenv() {
ninja_ver="$(retry curl -ksSL --compressed https://ninja-build.org/ \| grep "'The last Ninja release is'" \| sed -r "'s@.*<b>(.+)</b>.*@\1@'" \| head -1)"
ninja_binary_url="https://github.com/ninja-build/ninja/releases/download/${ninja_ver}/ninja-linux.zip"
if [ x"${USE_CHINA_MIRROR}" = x1 ]; then
ninja_binary_url="https://mirror.ghproxy.com/${ninja_binary_url}"
ninja_binary_url="https://ghproxy.org/${ninja_binary_url}"
fi
if [ ! -f "/usr/src/ninja-${ninja_ver}-linux.zip.download_ok" ]; then
rm -f "/usr/src/ninja-${ninja_ver}-linux.zip"
Expand All @@ -176,7 +176,7 @@ prepare_ssl() {
echo "openssl version: ${openssl_ver}"
openssl_latest_url="https://github.com/openssl/openssl/archive/refs/tags/${openssl_filename}"
if [ x"${USE_CHINA_MIRROR}" = x1 ]; then
openssl_latest_url="https://mirror.ghproxy.com/${openssl_latest_url}"
openssl_latest_url="https://ghproxy.org/${openssl_latest_url}"
fi
mkdir -p "/usr/src/openssl-${openssl_ver}/"
if [ ! -f "/usr/src/openssl-${openssl_ver}/.unpack_ok" ]; then
Expand Down Expand Up @@ -265,7 +265,7 @@ prepare_qt() {
if [ ! -d "/usr/src/qt6gtk2/" ]; then
qt6gtk2_git_url="https://github.com/trialuser02/qt6gtk2.git"
if [ x"${USE_CHINA_MIRROR}" = x1 ]; then
qt6gtk2_git_url="https://mirror.ghproxy.com/${qt6gtk2_git_url}"
qt6gtk2_git_url="https://ghproxy.org/${qt6gtk2_git_url}"
fi
retry git clone --depth 1 --recursive "${qt6gtk2_git_url}" "/usr/src/qt6gtk2/"
fi
Expand Down Expand Up @@ -303,7 +303,7 @@ prepare_libtorrent() {
echo "libtorrent-rasterbar branch: ${LIBTORRENT_BRANCH}"
libtorrent_git_url="https://github.com/arvidn/libtorrent.git"
if [ x"${USE_CHINA_MIRROR}" = x1 ]; then
libtorrent_git_url="https://mirror.ghproxy.com/${libtorrent_git_url}"
libtorrent_git_url="https://ghproxy.org/${libtorrent_git_url}"
fi
if [ ! -d "/usr/src/libtorrent-rasterbar-${LIBTORRENT_BRANCH}/" ]; then
retry git clone --depth 1 --recursive --shallow-submodules --branch "${LIBTORRENT_BRANCH}" \
Expand Down Expand Up @@ -353,7 +353,7 @@ build_appimage() {
# build AppImage
linuxdeploy_qt_download_url="https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
if [ x"${USE_CHINA_MIRROR}" = x1 ]; then
linuxdeploy_qt_download_url="https://mirror.ghproxy.com/${linuxdeploy_qt_download_url}"
linuxdeploy_qt_download_url="https://ghproxy.org/${linuxdeploy_qt_download_url}"
fi
[ -x "/tmp/linuxdeployqt-continuous-x86_64.AppImage" ] || retry curl -kSLC- -o /tmp/linuxdeployqt-continuous-x86_64.AppImage "${linuxdeploy_qt_download_url}"
chmod -v +x '/tmp/linuxdeployqt-continuous-x86_64.AppImage'
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/cross_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ prepare_cmake() {
cmake_binary_url="https://github.com/Kitware/CMake/releases/download/v${cmake_latest_ver}/cmake-${cmake_latest_ver}-linux-x86_64.tar.gz"
cmake_sha256_url="https://github.com/Kitware/CMake/releases/download/v${cmake_latest_ver}/cmake-${cmake_latest_ver}-SHA-256.txt"
if [ x"${USE_CHINA_MIRROR}" = x1 ]; then
cmake_binary_url="https://mirror.ghproxy.com/${cmake_binary_url}"
cmake_sha256_url="https://mirror.ghproxy.com/${cmake_sha256_url}"
cmake_binary_url="https://ghproxy.org/${cmake_binary_url}"
cmake_sha256_url="https://ghproxy.org/${cmake_sha256_url}"
fi
if [ -f "/usr/src/cmake-${cmake_latest_ver}-linux-x86_64.tar.gz" ]; then
cd /usr/src
Expand All @@ -168,7 +168,7 @@ prepare_ninja() {
ninja_ver="$(retry curl -ksSL --compressed https://ninja-build.org/ \| grep "'The last Ninja release is'" \| sed -r "'s@.*<b>(.+)</b>.*@\1@'" \| head -1)"
ninja_binary_url="https://github.com/ninja-build/ninja/releases/download/${ninja_ver}/ninja-linux.zip"
if [ x"${USE_CHINA_MIRROR}" = x1 ]; then
ninja_binary_url="https://mirror.ghproxy.com/${ninja_binary_url}"
ninja_binary_url="https://ghproxy.org/${ninja_binary_url}"
fi
if [ ! -f "/usr/src/ninja-${ninja_ver}-linux.zip.download_ok" ]; then
rm -f "/usr/src/ninja-${ninja_ver}-linux.zip"
Expand All @@ -186,7 +186,7 @@ prepare_zlib() {
zlib_ng_latest_url="https://github.com/zlib-ng/zlib-ng/archive/refs/tags/${zlib_ng_latest_tag}.tar.gz"
echo "zlib-ng version ${zlib_ng_latest_tag}"
if [ x"${USE_CHINA_MIRROR}" = x1 ]; then
zlib_ng_latest_url="https://mirror.ghproxy.com/${zlib_ng_latest_url}"
zlib_ng_latest_url="https://ghproxy.org/${zlib_ng_latest_url}"
fi
if [ ! -f "/usr/src/zlib-ng-${zlib_ng_latest_tag}/.unpack_ok" ]; then
mkdir -p "/usr/src/zlib-ng-${zlib_ng_latest_tag}/"
Expand Down Expand Up @@ -231,13 +231,13 @@ prepare_zlib() {
}

prepare_ssl() {
openssl_filename="$(retry curl -ksSL --compressed https://www.openssl.org/source/ \| grep -o "'href=\"openssl-3\(\.[0-9]*\)*tar.gz\"'" \| grep -o "'[^\"]*.tar.gz'" \| sort -r \| head -1)"
openssl_filename="$(retry curl -ksSL --compressed https://openssl-library.org/source/ \| grep -o "'>openssl-3\(\.[0-9]*\)*tar.gz<'" \| grep -o "'[^>]*.tar.gz'" \| sort -nr \| head -1)"
openssl_ver="$(echo "${openssl_filename}" | sed -r 's/openssl-(.+)\.tar\.gz/\1/')"
echo "OpenSSL version ${openssl_ver}"
if [ ! -f "/usr/src/openssl-${openssl_ver}/.unpack_ok" ]; then
openssl_download_url="https://github.com/openssl/openssl/archive/refs/tags/${openssl_filename}"
openssl_download_url="https://github.com/openssl/openssl/releases/download/openssl-${openssl_ver}/${openssl_filename}"
if [ x"${USE_CHINA_MIRROR}" = x1 ]; then
openssl_download_url="https://mirror.ghproxy.com/${openssl_download_url}"
openssl_download_url="https://ghproxy.org/${openssl_download_url}"
fi
mkdir -p "/usr/src/openssl-${openssl_ver}/"
retry curl -kL "${openssl_download_url}" \| tar -zxf - --strip-components=1 -C "/usr/src/openssl-${openssl_ver}/"
Expand Down Expand Up @@ -333,7 +333,7 @@ prepare_libtorrent() {
echo "libtorrent-rasterbar branch: ${LIBTORRENT_BRANCH}"
libtorrent_git_url="https://github.com/arvidn/libtorrent.git"
if [ x"${USE_CHINA_MIRROR}" = x1 ]; then
libtorrent_git_url="https://mirror.ghproxy.com/${libtorrent_git_url}"
libtorrent_git_url="https://ghproxy.org/${libtorrent_git_url}"
fi
if [ ! -d "/usr/src/libtorrent-rasterbar-${LIBTORRENT_BRANCH}/" ]; then
retry git clone --depth 1 --recursive --shallow-submodules --branch "${LIBTORRENT_BRANCH}" \
Expand Down

0 comments on commit 3e3a6df

Please sign in to comment.