From e57ca25a538b844f98e151c1a0da35a3d6c7cc07 Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Fri, 29 Mar 2024 10:15:54 +0100 Subject: [PATCH] spns #41446: build Qt with SSL support if this later is present in the list of products --- products/compil_scripts/openssl-1.1.bat | 43 +++++++++++++++++++++++++ products/compil_scripts/qt-5.12.10.bat | 9 +++++- products/compil_scripts/qt-5.15.2.bat | 9 +++++- products/env_scripts/openssl.py | 14 ++++++++ products/openssl.pyconf | 21 ++++++++++++ products/qt.pyconf | 2 ++ 6 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 products/compil_scripts/openssl-1.1.bat create mode 100644 products/env_scripts/openssl.py diff --git a/products/compil_scripts/openssl-1.1.bat b/products/compil_scripts/openssl-1.1.bat new file mode 100644 index 0000000..eb943ee --- /dev/null +++ b/products/compil_scripts/openssl-1.1.bat @@ -0,0 +1,43 @@ +@echo off + +echo ########################################################################## +echo openSSL %VERSION% +echo ########################################################################## + +if NOT exist "%PRODUCT_INSTALL%\bin" mkdir %PRODUCT_INSTALL%\lib +if NOT exist "%PRODUCT_INSTALL%\include" mkdir %PRODUCT_INSTALL%\include +REM clean BUILD directory +if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR% +mkdir %BUILD_DIR% + +mkdir %PRODUCT_INSTALL% + +cd %SOURCE_DIR% +xcopy amd64\include\* %PRODUCT_INSTALL%\include /E /I /Q +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on xcopy + exit 1 +) +xcopy amd64\*.lib %PRODUCT_INSTALL%\lib /E /I /Q +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on xcopy of openssl static libraries + exit 1 +) +xcopy amd64\*.dll %PRODUCT_INSTALL%\lib /E /I /Q +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on xcopy of openssl dll files + exit 1 +) + +xcopy amd64\*.pdb %PRODUCT_INSTALL%\lib /E /I /Q +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on xcopy of openssl pdb fils + exit 1 +) + +cd %PRODUCT_INSTALL%\lib +copy /Y /B libcrypto-1.1.dll libcrypto.dll +copy /Y /B libssl-1.1.dll libssl.dll + +echo. +echo ########## END diff --git a/products/compil_scripts/qt-5.12.10.bat b/products/compil_scripts/qt-5.12.10.bat index 0626f75..bf4b6d7 100644 --- a/products/compil_scripts/qt-5.12.10.bat +++ b/products/compil_scripts/qt-5.12.10.bat @@ -28,7 +28,14 @@ echo -------------------------------------------------------------------------- set QT_OPTIONS=-platform win32-msvc2017 set QT_OPTIONS=%QT_OPTIONS% -opensource -confirm-license %PRODUCT_BUILD_TYPE% set QT_OPTIONS=%QT_OPTIONS% -no-angle -opengl desktop -nomake examples -nomake tests -set QT_OPTIONS=%QT_OPTIONS% -skip qtwebengine -skip wayland -skip qtgamepad -no-openssl +set QT_OPTIONS=%QT_OPTIONS% -skip qtwebengine -skip wayland -skip qtgamepad + +IF DEFINED OPENSSL_ROOT_DIR ( + set QT_OPTIONS=%QT_OPTIONS% -ssl -openssl -openssl-linked OPENSSL_PREFIX=%OPENSSL_ROOT_DIR% +) else ( + set QT_OPTIONS=%QT_OPTIONS% -no-openssl +) + set QT_OPTIONS=%QT_OPTIONS% -mp set QT_OPTIONS=%QT_OPTIONS% -prefix %PRODUCT_INSTALL% diff --git a/products/compil_scripts/qt-5.15.2.bat b/products/compil_scripts/qt-5.15.2.bat index 0626f75..bf4b6d7 100644 --- a/products/compil_scripts/qt-5.15.2.bat +++ b/products/compil_scripts/qt-5.15.2.bat @@ -28,7 +28,14 @@ echo -------------------------------------------------------------------------- set QT_OPTIONS=-platform win32-msvc2017 set QT_OPTIONS=%QT_OPTIONS% -opensource -confirm-license %PRODUCT_BUILD_TYPE% set QT_OPTIONS=%QT_OPTIONS% -no-angle -opengl desktop -nomake examples -nomake tests -set QT_OPTIONS=%QT_OPTIONS% -skip qtwebengine -skip wayland -skip qtgamepad -no-openssl +set QT_OPTIONS=%QT_OPTIONS% -skip qtwebengine -skip wayland -skip qtgamepad + +IF DEFINED OPENSSL_ROOT_DIR ( + set QT_OPTIONS=%QT_OPTIONS% -ssl -openssl -openssl-linked OPENSSL_PREFIX=%OPENSSL_ROOT_DIR% +) else ( + set QT_OPTIONS=%QT_OPTIONS% -no-openssl +) + set QT_OPTIONS=%QT_OPTIONS% -mp set QT_OPTIONS=%QT_OPTIONS% -prefix %PRODUCT_INSTALL% diff --git a/products/env_scripts/openssl.py b/products/env_scripts/openssl.py new file mode 100644 index 0000000..450f3c3 --- /dev/null +++ b/products/env_scripts/openssl.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +import os.path +import platform + +def set_env(env, prereq_dir, version): + env.set('OPENSSL_ROOT_DIR', prereq_dir) + env.set('OPENSSL_DIR', prereq_dir) + if platform.system() == "Windows" : + env.prepend('PATH', os.path.join(prereq_dir), 'lib') + +def set_nativ_env(env): + pass diff --git a/products/openssl.pyconf b/products/openssl.pyconf index 4f2fa00..e5c4b02 100644 --- a/products/openssl.pyconf +++ b/products/openssl.pyconf @@ -2,6 +2,7 @@ default : { name : "openssl" get_source : "native" + compil_script : $name + $VARS.scriptExtension system_info : { rpm : [] @@ -9,9 +10,29 @@ default : apt : [] apt_dev : ["libssl-dev"] } + environ : + { + env_script : $name + ".py" + } depend : [] properties : { incremental : "yes" } } + +default_win : +{ + get_source : "archive" + build_source : "script" +} + +version_1_1_1n : +{ +} + +version_1_1_1n_win : +{ + archive_info : {archive_name : "openssl-1.1.1n_windows.tar.gz"} + compil_script : "openssl-1.1.bat" +} diff --git a/products/qt.pyconf b/products/qt.pyconf index 9fbc0b0..8e01825 100644 --- a/products/qt.pyconf +++ b/products/qt.pyconf @@ -35,6 +35,7 @@ version_5_15_2_win : { depend : ["freetype"] build_depend : ["llvm"] + opt_depend : ['openssl'] } version_5_12_10 : @@ -55,6 +56,7 @@ version_5_12_10_win : { depend : ["freetype"] build_depend : ["llvm"] + opt_depend : ['openssl'] patches : [] } -- 2.39.2