Skip to content

Commit

Permalink
Merge branch 'feature-openssl-v3' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
setvisible committed Dec 17, 2023
2 parents 3ca7260 + df338b9 commit 6e2a20c
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 18 deletions.
38 changes: 31 additions & 7 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
qt_host: 'linux'
qt_target: 'desktop'
qt_arch: 'gcc_64'
qt_tools: 'tools_openssl_x64'
qt_tools: '' # To build OpenSSLv3: 'tools_opensslv3_src'
Qt6_CUSTOM_INSTALL_PATH: "/home/runner/work/DownZemAll/qt/"
DIRECTIVE_CMAKE_GENERATOR: ''
INSTALL_BOOST_PLATFORM_VERSION: '18.04' # 18.04, 20.04 Rem: Ubuntu 20.04 doesn't have Boost 1.77.0
Expand All @@ -102,7 +102,7 @@ jobs:
qt_host: 'windows'
qt_target: 'desktop'
qt_arch: 'win64_mingw'
qt_tools: 'tools_openssl_x64'
qt_tools: 'tools_opensslv3_x64'
Qt6_CUSTOM_INSTALL_PATH: "D:\\a\\DownZemAll\\qt\\"
DIRECTIVE_CMAKE_GENERATOR: '-G "MinGW Makefiles"'
INSTALL_BOOST_PLATFORM_VERSION: '2019' # 2019, 2022
Expand Down Expand Up @@ -261,8 +261,9 @@ jobs:
- name: Install Qt
uses: jurplel/install-qt-action@v3
# Rem: Once installed, ${{env.Qt6_DIR}} is set.
# https://ddalcino.github.io/aqt-list-server/
with:
aqtversion: '==2.1.*'
aqtversion: '==3.1.*'
version: ${{env.Qt6_VERSION}}
dir: ${{matrix.Qt6_CUSTOM_INSTALL_PATH}}
host: ${{matrix.qt_host}}
Expand All @@ -282,6 +283,24 @@ jobs:
# The thing is that "env.Qt6_DIR" is defined only at runtime, *after* install-qt-action has run.
id: qt6openssl
shell: python
# 2 versions present in Ubuntu:
# * Default version (3.0.2-0ubuntu1.12)
# in /usr/ (see "apt list libssl-dev")
# => openssl_dir = os.path.normpath("/usr")
#
# * Qt6 version (3.0.12)
# To build it:
# openssl_dir = os.path.normpath(os.path.join(r"${{env.Qt6_DIR}}", "..", "..", "Tools", "OpenSSLv3", "src"))
# cd "${{openssl_dir}}"
# ./config
# make
# make test
# sudo make install_sw
# Then:
# openssl_dir = os.path.normpath(os.path.join(r"${{env.Qt6_DIR}}", "..", "..", "Tools", "OpenSSLv3", "src"))
# openssl_lib_eay = os.path.normpath(os.path.join(openssl_dir, "lib", "libcrypto.a"))
# openssl_ssl_eay = os.path.normpath(os.path.join(openssl_dir, "lib", "libssl.a"))
#
run: |
import os
Expand All @@ -290,14 +309,14 @@ jobs:
# ssleay32 -> libssl
if "${{ matrix.os }}" == "windows-latest":
openssl_dir = os.path.normpath(os.path.join(r"${{env.Qt6_DIR}}", "..", "..", "Tools", "OpenSSL", "Win_x64"))
openssl_dir = os.path.normpath(os.path.join(r"${{env.Qt6_DIR}}", "..", "..", "Tools", "OpenSSLv3", "Win_x64"))
openssl_lib_eay = os.path.normpath(os.path.join(openssl_dir, "lib", "libcrypto.lib"))
openssl_ssl_eay = os.path.normpath(os.path.join(openssl_dir, "lib", "libssl.lib"))
if "${{ matrix.os }}" == "ubuntu-latest":
openssl_dir = os.path.normpath(os.path.join(r"${{env.Qt6_DIR}}", "..", "..", "Tools", "OpenSSL", "binary"))
openssl_lib_eay = os.path.normpath(os.path.join(openssl_dir, "lib", "libcrypto.a"))
openssl_ssl_eay = os.path.normpath(os.path.join(openssl_dir, "lib", "libssl.a"))
openssl_dir = os.path.normpath("/usr")
openssl_lib_eay = os.path.normpath(os.path.join(openssl_dir, "lib", "x86_64-linux-gnu", "libcrypto.a"))
openssl_ssl_eay = os.path.normpath(os.path.join(openssl_dir, "lib", "x86_64-linux-gnu", "libssl.a"))
if "GITHUB_OUTPUT" in os.environ:
with open(os.environ["GITHUB_OUTPUT"], "a") as f:
Expand Down Expand Up @@ -517,30 +536,35 @@ jobs:
os.makedirs(directory)
- name: Download Chromium Addon
continue-on-error: true
uses: actions/download-artifact@v3
with:
name: artifact_chromium
path: "${{env.Project_RELEASE_DIR}}"

- name: Download Firefox Addon
continue-on-error: true
uses: actions/download-artifact@v3
with:
name: artifact_firefox
path: "${{env.Project_RELEASE_DIR}}"

- name: Download Linux Portable
continue-on-error: true
uses: actions/download-artifact@v3
with:
name: artifact_linux_portable
path: "${{env.Project_RELEASE_DIR}}"

- name: Download Windows MinGW 64 Portable
continue-on-error: true
uses: actions/download-artifact@v3
with:
name: artifact_windows_mingw_64_portable
path: "${{env.Project_RELEASE_DIR}}"

- name: Download Windows 64 Installer
continue-on-error: true
uses: actions/download-artifact@v3
with:
name: artifact_windows_64_installer
Expand Down
Binary file modified 3rd/yt-dlp/bin/yt-dlp
Binary file not shown.
Binary file modified 3rd/yt-dlp/bin/yt-dlp.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion 3rd/yt-dlp/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2023.03.04
2023.11.16
24 changes: 17 additions & 7 deletions cmake/Modules/FindOpenSSLPreferablyFromQt6.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if(NOT OpenSSL_ROOT_DIR)
get_filename_component(Qt6_OPENSSL_DIR ${Qt6_OPENSSL_DIR} DIRECTORY)
get_filename_component(Qt6_OPENSSL_DIR ${Qt6_OPENSSL_DIR} DIRECTORY)
get_filename_component(Qt6_OPENSSL_DIR ${Qt6_OPENSSL_DIR} DIRECTORY)
set(OpenSSL_ROOT_DIR "${Qt6_OPENSSL_DIR}/Tools/OpenSSL/Win_x64/")
set(OpenSSL_ROOT_DIR "${Qt6_OPENSSL_DIR}/Tools/OpenSSLv3/Win_x64/")

endif()

Expand All @@ -39,16 +39,26 @@ if(EXISTS "${OpenSSL_ROOT_DIR}/include/openssl/ssl.h")
set(OPENSSL_CRYPTO_LIBRARY "${OpenSSL_ROOT_DIR}/lib/libcrypto.lib" CACHE PATH "Location of the OpenSSL Crypto Lib")
set(OPENSSL_SSL_LIBRARY "${OpenSSL_ROOT_DIR}/lib/libssl.lib" CACHE PATH "Location of the OpenSSL SSL Lib")
set(OPENSSL_INCLUDE_DIRS "${OpenSSL_ROOT_DIR}/include" CACHE PATH "Location of the OpenSSL include files")
set(OPENSSL_CRYPTO_BIN "${OpenSSL_ROOT_DIR}/bin/libcrypto-1_1-x64.dll" CACHE PATH "Location of the OpenSSL Crypto DLL")
set(OPENSSL_SSL_BIN "${OpenSSL_ROOT_DIR}/bin/libssl-1_1-x64.dll" CACHE PATH "Location of the OpenSSL SSL DLL")
set(OPENSSL_CRYPTO_BIN "${OpenSSL_ROOT_DIR}/bin/libcrypto-3-x64.dll" CACHE PATH "Location of the OpenSSL Crypto DLL")
set(OPENSSL_SSL_BIN "${OpenSSL_ROOT_DIR}/bin/libssl-3-x64.dll" CACHE PATH "Location of the OpenSSL SSL DLL")

else() # MacOS or Unix Compilers

set(OPENSSL_CRYPTO_LIBRARY "${OpenSSL_ROOT_DIR}/lib/libcrypto.so" CACHE PATH "Location of the OpenSSL Crypto Lib")
set(OPENSSL_SSL_LIBRARY "${OpenSSL_ROOT_DIR}/lib/libssl.so" CACHE PATH "Location of the OpenSSL SSL Lib")
# To use preinstalled libssl-dev in Ubuntu:
# OpenSSL_ROOT_DIR = '/usr'
set(OPENSSL_CRYPTO_LIBRARY "${OpenSSL_ROOT_DIR}/lib/x86_64-linux-gnu/libcrypto.so" CACHE PATH "Location of the OpenSSL Crypto Lib")
set(OPENSSL_SSL_LIBRARY "${OpenSSL_ROOT_DIR}/lib/x86_64-linux-gnu/libssl.so" CACHE PATH "Location of the OpenSSL SSL Lib")
set(OPENSSL_INCLUDE_DIRS "${OpenSSL_ROOT_DIR}/include" CACHE PATH "Location of the OpenSSL include files")
set(OPENSSL_CRYPTO_BIN "${OpenSSL_ROOT_DIR}/lib/libcrypto.so.1.1" CACHE PATH "Location of the OpenSSL Crypto DLL")
set(OPENSSL_SSL_BIN "${OpenSSL_ROOT_DIR}/lib/libssl.so.1.1" CACHE PATH "Location of the OpenSSL SSL DLL")
set(OPENSSL_CRYPTO_BIN "${OpenSSL_ROOT_DIR}/lib/x86_64-linux-gnu/libcrypto.so.3" CACHE PATH "Location of the OpenSSL Crypto DLL")
set(OPENSSL_SSL_BIN "${OpenSSL_ROOT_DIR}/lib/x86_64-linux-gnu/libssl.so.3" CACHE PATH "Location of the OpenSSL SSL DLL")

# ...or to build it from Qt:
# OpenSSL_ROOT_DIR = '~/work/DownZemAll/qt/Qt/Tools/OpenSSLv3/src'
# set(OPENSSL_CRYPTO_LIBRARY "${OpenSSL_ROOT_DIR}/lib/libcrypto.so" CACHE PATH "Location of the OpenSSL Crypto Lib")
# set(OPENSSL_SSL_LIBRARY "${OpenSSL_ROOT_DIR}/lib/libssl.so" CACHE PATH "Location of the OpenSSL SSL Lib")
# set(OPENSSL_INCLUDE_DIRS "${OpenSSL_ROOT_DIR}/include" CACHE PATH "Location of the OpenSSL include files")
# set(OPENSSL_CRYPTO_BIN "${OpenSSL_ROOT_DIR}/lib/libcrypto.so.3" CACHE PATH "Location of the OpenSSL Crypto DLL")
# set(OPENSSL_SSL_BIN "${OpenSSL_ROOT_DIR}/lib/libssl.so.3" CACHE PATH "Location of the OpenSSL SSL DLL")

endif()

Expand Down
2 changes: 1 addition & 1 deletion src/core/format.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ QString Format::timeToString(qint64 seconds)
*/
QString Format::fileSizeToString(qsizetype size)
{
if (size < 0 || size >= SIZE_MAX) {
if (size < 0 || size >= PTRDIFF_MAX) {
return tr("Unknown");
}
if (size == 0) {
Expand Down
4 changes: 2 additions & 2 deletions src/dialogs/compilerdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ void CompilerDialog::populateOpenSSL()
libCrypto = QLatin1String("libeay32");

#elif defined(Q_OS_WIN32) && defined(Q_OS_WIN64) // 32-bit or 64-bit
libSsl = QLatin1String("libssl-1_1-x64");
libCrypto = QLatin1String("libcrypto-1_1-x64");
libSsl = QLatin1String("libssl-3-x64");
libCrypto = QLatin1String("libcrypto-3-x64");

#elif defined(Q_OS_UNIX)
libSsl = QLatin1String("libssl");
Expand Down

0 comments on commit 6e2a20c

Please sign in to comment.