Skip to content

Commit

Permalink
OpenSSL 3
Browse files Browse the repository at this point in the history
Signed-off-by: Cédrik Fuoco <[email protected]>
  • Loading branch information
cedrik-fuoco-adsk committed Nov 1, 2024
1 parent 355d455 commit 5b6c1b3
Show file tree
Hide file tree
Showing 25 changed files with 528 additions and 162 deletions.
64 changes: 61 additions & 3 deletions .github/actions/build-qt5-for-arm64/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,23 @@ runs:
brew install --quiet --formula libiconv libpng libpq libtool libuv libxau libxcb libxdmcp
brew install --quiet --formula autoconf automake cmake pcre2 harfbuzz freetype node@18 nspr nss
brew install --quiet --formula xcb-proto xcb-util xcb-util-cursor xcb-util-image xcb-util-keysyms xcb-util-renderutil xcb-util-wm
brew install --quiet --formula brotli bzip2 dbus glew icu4c jpeg md4c [email protected] pkg-config sqlite xorgproto zlib zstd
brew install --quiet --formula brotli bzip2 dbus glew icu4c jpeg md4c pkg-config sqlite xorgproto zlib zstd
shell: bash

- name: Install Homebrew dependencies (OpenSSL 1.1.1)
if: steps.arm64-qt.outputs.cache-hit != 'true' && matrix.vfx-platform == 'CY2023'
run: |
brew install --quiet --formula [email protected]
brew list [email protected]
shell: bash

- name: Install Homebrew dependencies (OpenSSL 3.X.X)
if: steps.arm64-qt.outputs.cache-hit != 'true' && matrix.vfx-platform == 'CY2024'
run: |
brew install --quiet --formula openssl@3
brew list openssl@3
shell: bash

# Use Ninja 1.11.1 because Qt need to be patched for Ninja 1.12.1.
- name: Install Ninja 1.11.1
if: steps.arm64-qt.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -120,8 +133,14 @@ runs:
mkdir -p qt-build
shell: bash

- name: Configure Qt ${{ inputs.qt-version }}
if: steps.arm64-qt.outputs.cache-hit != 'true'
- name: List OpenSSL folder
if: matrix.vfx-platform == 'CY2024'
run: |
ls -al $(brew --prefix openssl@3)
shell: bash

- name: Configure Qt ${{ inputs.qt-version }} for CY2023
if: steps.arm64-qt.outputs.cache-hit != 'true' && matrix.vfx-platform == 'CY2023'
run: |
../qt-src/configure \
--prefix="../${{ inputs.qt-output }}" \
Expand Down Expand Up @@ -159,6 +178,45 @@ runs:
working-directory: ${{ github.workspace }}/qt-build
shell: bash

- name: Configure Qt ${{ inputs.qt-version }} for CY2024
if: steps.arm64-qt.outputs.cache-hit != 'true' && matrix.vfx-platform == 'CY2024'
run: |
../qt-src/configure \
--prefix="../${{ inputs.qt-output }}" \
-no-strip \
-no-rpath \
-opensource \
-plugin-sql-sqlite \
-openssl-linked \
-verbose \
-opengl desktop \
-no-warnings-are-errors \
-no-libudev \
-no-egl \
-nomake examples \
-nomake tests \
-c++std c++14 \
-confirm-license \
-no-use-gold-linker \
-release \
-no-sql-mysql \
-no-xcb \
-qt-libjpeg \
-qt-libpng \
-bundled-xcb-xinput \
-sysconfdir /etc/xdg \
-qt-pcre \
-qt-harfbuzz \
-R . \
-icu \
-skip qtnetworkauth \
-skip qtpurchasing \
-skip qtlocation \
-I $(brew --prefix openssl@3)/include -L $(brew --prefix openssl@3)/lib \
-I /opt/homebrew/Cellar/icu4c/74.2/include -L /opt/homebrew/Cellar/icu4c/74.2/lib
working-directory: ${{ github.workspace }}/qt-build
shell: bash

- name: Build Qt ${{ inputs.qt-version }}
if: steps.arm64-qt.outputs.cache-hit != 'true'
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ jobs:
dnf install -y epel-release
dnf config-manager --set-enabled ${{ matrix.extra_repo }} devel
dnf groupinstall "Development Tools" -y
dnf install -y alsa-lib-devel autoconf automake avahi-compat-libdns_sd-devel bison bzip2-devel cmake-gui curl-devel flex gcc gcc-c++ git libXcomposite libXi-devel libaio-devel libffi-devel nasm ncurses-devel nss libtool libxkbcommon libXcomposite libXdamage libXrandr libXtst libXcursor mesa-libOSMesa mesa-libOSMesa-devel meson openssl-devel patch pulseaudio-libs pulseaudio-libs-glib2 ocl-icd ocl-icd-devel opencl-headers python3 python3-devel qt5-qtbase-devel readline-devel sqlite-devel tcl-devel tcsh tk-devel yasm zip zlib-devel wget patchelf pcsc-lite libxkbfile
dnf install -y alsa-lib-devel autoconf automake avahi-compat-libdns_sd-devel bison bzip2-devel cmake-gui curl-devel flex gcc gcc-c++ git libXcomposite libXi-devel libaio-devel libffi-devel nasm ncurses-devel nss libtool libxkbcommon libXcomposite libXdamage libXrandr libXtst libXcursor mesa-libOSMesa mesa-libOSMesa-devel meson openssl-devel patch pulseaudio-libs pulseaudio-libs-glib2 ocl-icd ocl-icd-devel opencl-headers qt5-qtbase-devel readline-devel sqlite-devel tcl-devel tcsh tk-devel yasm zip zlib-devel wget patchelf pcsc-lite libxkbfile perl-IPC-Cmd
dnf install -y libX11-devel libXext-devel libXrender-devel libXrandr-devel libXcursor-devel libXi-devel libXxf86vm-devel libxkbcommon-devel
dnf install -y xz-devel mesa-libGLU mesa-libGLU-devel
Expand Down
82 changes: 49 additions & 33 deletions cmake/dependencies/openssl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ SET(_target
"RV_DEPS_OPENSSL"
)

IF(RV_TARGET_IS_RHEL8)
IF(RV_TARGET_IS_RHEL8
AND RV_VFX_PLATFORM STREQUAL CY2023
)
# VFX2023: Rocky Linux 8

FIND_PACKAGE(OpenSSL 1.1.1 REQUIRED)

SET(RV_DEPS_OPENSSL_VERSION
Expand All @@ -25,6 +29,8 @@ IF(RV_TARGET_IS_RHEL8)
MESSAGE(STATUS "_lib_dir ${_lib_dir}")

ELSE()
# VFX2023: Rocky Linux 9, Windows and MacOS VFX2024: Rocky Linux 8/9, Windows and MacOS

SET(RV_DEPS_WIN_PERL_ROOT
""
CACHE STRING "Path to Windows perl root"
Expand All @@ -34,10 +40,9 @@ ELSE()
"RV_DEPS_OPENSSL"
)

SET(_version
"1.1.1u"
)
string(REPLACE "." "_" _version_underscored ${_version})
RV_VFX_SET_VARIABLE(_version CY2023 "1.1.1u" CY2024 "3.4.0")

STRING(REPLACE "." "_" _version_underscored ${_version})

IF(RV_TARGET_WINDOWS
AND (NOT RV_DEPS_WIN_PERL_ROOT
Expand All @@ -61,20 +66,26 @@ ELSE()
SET(_build_dir
${RV_DEPS_BASE_DIR}/${_target}/build
)
SET(_lib_dir
${RV_DEPS_OPENSSL_INSTALL_DIR}/lib
)

IF(RHEL_VERBOSE)
RV_VFX_SET_VARIABLE(_lib_dir CY2023 "${RV_DEPS_OPENSSL_INSTALL_DIR}/lib" CY2024 "${RV_DEPS_OPENSSL_INSTALL_DIR}/lib64")
ELSE()
SET(_lib_dir
${RV_DEPS_OPENSSL_INSTALL_DIR}/lib
)
ENDIF()

SET(_bin_dir
${RV_DEPS_OPENSSL_INSTALL_DIR}/bin
)

SET(_download_url
"https://github.com/openssl/openssl/releases/download/OpenSSL_${_version_underscored}/openssl-${_version}.tar.gz"
)
SET(_download_hash
"72f7ba7395f0f0652783ba1089aa0dcc"
RV_VFX_SET_VARIABLE(
_download_url CY2023 "https://github.com/openssl/openssl/releases/download/OpenSSL_${_version_underscored}/openssl-${_version}.tar.gz" CY2024
"https://github.com/openssl/openssl/releases/download/openssl-${_version}/openssl-${_version}.tar.gz"
)

RV_VFX_SET_VARIABLE(_download_hash CY2023 "72f7ba7395f0f0652783ba1089aa0dcc" CY2024 "34733f7be2d60ecd8bd9ddb796e182af")

SET(_make_command_script
"${PROJECT_SOURCE_DIR}/src/build/make_openssl.py"
)
Expand All @@ -86,52 +97,57 @@ ELSE()
LIST(APPEND _make_command ${_source_dir})
LIST(APPEND _make_command "--output-dir")
LIST(APPEND _make_command ${RV_DEPS_OPENSSL_INSTALL_DIR})

LIST(APPEND _make_command "--vfx_platform")
RV_VFX_SET_VARIABLE(_vfx_platform_ CY2023 "2023" CY2024 "2024")
LIST(APPEND _make_command ${_vfx_platform_})

IF(RV_TARGET_WINDOWS)
LIST(APPEND _make_command "--perlroot")
LIST(APPEND _make_command ${RV_DEPS_WIN_PERL_ROOT})
ENDIF()

IF(APPLE)
# This is needed because if Rosetta is used to compile for x86_64 from ARM64,
# openssl build system detects it as "linux-x86_64" and it causes issues.
# This is needed because if Rosetta is used to compile for x86_64 from ARM64, openssl build system detects it as "linux-x86_64" and it causes issues.

IF(RV_TARGET_APPLE_X86_64)
SET(__openssl_arch__ x86_64)
SET(__openssl_arch__
x86_64
)
ELSEIF(RV_TARGET_APPLE_ARM64)
SET(__openssl_arch__ arm64)
SET(__openssl_arch__
arm64
)
ENDIF()

LIST(APPEND _make_command --arch=-${__openssl_arch__})
ENDIF()

# On most POSIX platforms, shared libraries are named `libcrypto.so.1.1`
# and `libssl.so.1.1`.

# On Windows build with MSVC or using MingW, shared libraries are named
# `libcrypto-1_1.dll` and `libssl-1_1.dll` for 32-bit Windows,
# `libcrypto-1_1-x64.dll` and `libssl-1_1-x64.dll` for 64-bit x86_64 Windows,
# and `libcrypto-1_1-ia64.dll` and `libssl-1_1-ia64.dll` for IA64 Windows.
# With MSVC, the import libraries are named `libcrypto.lib` and `libssl.lib`,
# while with MingW, they are named `libcrypto.dll.a` and `libssl.dll.a`.
# On most POSIX platforms, shared libraries are named `libcrypto.so.1.1` and `libssl.so.1.1`.

# On Windows build with MSVC or using MingW, shared libraries are named `libcrypto-1_1.dll` and `libssl-1_1.dll` for 32-bit Windows, `libcrypto-1_1-x64.dll`
# and `libssl-1_1-x64.dll` for 64-bit x86_64 Windows, and `libcrypto-1_1-ia64.dll` and `libssl-1_1-ia64.dll` for IA64 Windows. With MSVC, the import libraries
# are named `libcrypto.lib` and `libssl.lib`, while with MingW, they are named `libcrypto.dll.a` and `libssl.dll.a`.

# Ref: https://github.com/openssl/openssl/blob/398011848468c7e8e481b295f7904afc30934217/INSTALL.md?plain=1#L1847-L1858

IF(RV_TARGET_LINUX)
RV_VFX_SET_VARIABLE(_dot_version CY2023 ".1.1" CY2024 ".3")

SET(_crypto_lib_name
${CMAKE_SHARED_LIBRARY_PREFIX}crypto${CMAKE_SHARED_LIBRARY_SUFFIX}.1.1
${CMAKE_SHARED_LIBRARY_PREFIX}crypto${CMAKE_SHARED_LIBRARY_SUFFIX}${_dot_version}
)

SET(_ssl_lib_name
${CMAKE_SHARED_LIBRARY_PREFIX}ssl${CMAKE_SHARED_LIBRARY_SUFFIX}.1.1
${CMAKE_SHARED_LIBRARY_PREFIX}ssl${CMAKE_SHARED_LIBRARY_SUFFIX}${_dot_version}
)
ELSEIF(RV_TARGET_WINDOWS)
# As stated in the openssl documentation, the names are libcrypto-1_1-x64 and libssl-1_1-x64
# when OpenSSL is build with MSVC.
# As stated in the openssl documentation, the names are libcrypto-1_1-x64 and libssl-1_1-x64 when OpenSSL is build with MSVC.
SET(_crypto_lib_name
libcrypto-1_1-x64${CMAKE_SHARED_LIBRARY_SUFFIX}
libcrypto-1_1-x64${CMAKE_SHARED_LIBRARY_SUFFIX}
)
SET(_ssl_lib_name
libssl-1_1-x64${CMAKE_SHARED_LIBRARY_SUFFIX}
libssl-1_1-x64${CMAKE_SHARED_LIBRARY_SUFFIX}
)
ELSE()
SET(_crypto_lib_name
Expand Down Expand Up @@ -304,4 +320,4 @@ ENDIF()
SET_PROPERTY(
GLOBAL APPEND
PROPERTY "RV_FFMPEG_EXTERNAL_LIBS" "--enable-openssl"
)
)
Loading

0 comments on commit 5b6c1b3

Please sign in to comment.