Skip to content

Commit

Permalink
[open62541] Add OpenSSL encryption, update Julia compat and increase …
Browse files Browse the repository at this point in the history
…version number (1.4.0) (#7889)

* [open62541] Add TLS encryption to v1.3.9 build

* add MbedTLS_jll dependency

* Add compat for MbedTLS

Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com>

* 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 <giordano@users.noreply.github.com>
  • Loading branch information
thomvet and giordano authored Apr 18, 2024
1 parent 39388ea commit d88cdf9
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
19 changes: 15 additions & 4 deletions O/open62541/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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} \
Expand All @@ -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 \
Expand All @@ -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.
Expand Down
25 changes: 25 additions & 0 deletions O/open62541/bundled/0001-freebsd.patch
Original file line number Diff line number Diff line change
@@ -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 <errno.h>
#include <arpa/inet.h>
+#include <netinet/in.h>
#include <netinet/tcp.h>
#include <netdb.h>
#include <sys/ioctl.h>
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

0 comments on commit d88cdf9

Please sign in to comment.