From d88cdf9693de90e5496aa8ce490e7fedf5dfa20d Mon Sep 17 00:00:00 2001 From: Thomas Vetter <80452158+thomvet@users.noreply.github.com> Date: Fri, 19 Apr 2024 00:19:03 +0200 Subject: [PATCH] [open62541] Add OpenSSL encryption, update Julia compat and increase version number (1.4.0) (#7889) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [open62541] Add TLS encryption to v1.3.9 build * add MbedTLS_jll dependency * Add compat for MbedTLS Co-authored-by: Mosè Giordano * Update build_tarballs.jl * Use OpenSSL instead of MbedTLS; update to open62541 v1.4.0 * adjust version requirement for OpenSSL_jll * correct typo * check 1.4 independently of openssl * try without amalgamation * try * revert * try another OpenSSL version * Set OPENSSL_ROOT_DIR to fix build on x86 Windows * hotfix attempt * revert * patch attempt * patch attempt 2 * actually applying the patch would be good. * fix directory mistake * typo * Update O/open62541/build_tarballs.jl --------- Co-authored-by: Mosè Giordano --- O/open62541/build_tarballs.jl | 19 +++++++++++++++---- O/open62541/bundled/0001-freebsd.patch | 25 +++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 O/open62541/bundled/0001-freebsd.patch diff --git a/O/open62541/build_tarballs.jl b/O/open62541/build_tarballs.jl index ee47124107e..6dd1fc004f7 100644 --- a/O/open62541/build_tarballs.jl +++ b/O/open62541/build_tarballs.jl @@ -3,17 +3,27 @@ using BinaryBuilder, Pkg name = "open62541" -version = v"1.3.9" +version = v"1.4.0" # Collection of sources required to complete build sources = [ GitSource("https://github.com/open62541/open62541.git", - "70ff3501ddecd7e7594ebc63e2365994d59e010d") + "84347820c8550b5750f2cd581c14ab201611c579"), + DirectorySource("./bundled") ] # Bash recipe for building across all platforms script = raw""" +# Necessary for cmake to find openssl on Windows +if [[ ${target} == x86_64-*-mingw* ]]; then + export OPENSSL_ROOT_DIR=${prefix}/lib64 +fi + cd $WORKSPACE/srcdir/open62541/ +if [[ "${target}" == *-freebsd* ]]; then + # https://github.com/open62541/open62541/issues/6414 + atomic_patch -p1 ../0001-freebsd.patch +fi mkdir build && cd build/ cmake -DCMAKE_INSTALL_PREFIX=${prefix} \ -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \ @@ -23,7 +33,7 @@ cmake -DCMAKE_INSTALL_PREFIX=${prefix} \ -DUA_ENABLE_METHODCALLS=ON \ -DUA_ENABLE_PARSING=ON \ -DUA_ENABLE_NODEMANAGEMENT=ON \ - -DUA_ENABLE_AMALGAMATION=ON \ + -DUA_ENABLE_ENCRYPTION=OPENSSL \ -DUA_ENABLE_IMMUTABLE_NODES=ON \ -DUA_ENABLE_HISTORIZING=ON \ -DBUILD_SHARED_LIBS=ON \ @@ -44,7 +54,8 @@ products = [ ] # Dependencies that must be installed before this package can be built -dependencies = Dependency[ +dependencies = [ + Dependency("OpenSSL_jll"; compat="3.0.8") ] # Build the tarballs, and possibly a `build.jl` as well. diff --git a/O/open62541/bundled/0001-freebsd.patch b/O/open62541/bundled/0001-freebsd.patch new file mode 100644 index 00000000000..a4dcc9458a2 --- /dev/null +++ b/O/open62541/bundled/0001-freebsd.patch @@ -0,0 +1,25 @@ +diff --git a/arch/posix/ua_architecture.h b/arch/posix/ua_architecture.h +index c42768548..8e6159818 100644 +--- a/arch/posix/ua_architecture.h ++++ b/arch/posix/ua_architecture.h +@@ -14,6 +14,7 @@ + + #include + #include ++#include + #include + #include + #include +diff --git a/include/open62541/config.h.in b/include/open62541/config.h.in +index 5b20497ed..7758f2ab3 100644 +--- a/include/open62541/config.h.in ++++ b/include/open62541/config.h.in +@@ -127,7 +127,7 @@ + * header. */ + #ifdef UA_ARCHITECTURE_POSIX + # if !defined(_XOPEN_SOURCE) +-# define _XOPEN_SOURCE 600 ++// # define _XOPEN_SOURCE 600 + # endif + # ifndef _DEFAULT_SOURCE + # define _DEFAULT_SOURCE