Skip to content

Commit

Permalink
opcua: init at 0.10.0-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
vivienCEA committed Apr 29, 2024
1 parent 25d4892 commit f663d91
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ in
ipac = callPackage ./epnix/support/ipac {};
modbus = callPackage ./epnix/support/modbus {};
mrfioc2 = callPackage ./epnix/support/mrfioc2 {};
opcua = callPackage ./epnix/support/opcua {};
pvxs = callPackage ./epnix/support/pvxs {};
seq = callPackage ./epnix/support/seq {};
snmp = callPackage ./epnix/support/snmp {};
Expand Down
53 changes: 53 additions & 0 deletions pkgs/epnix/support/opcua/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
lib,
epnixLib,
mkEpicsPackage,
fetchFromGitHub,
pkg-config,
epnix,
open62541,
openssl,
libxml2,
local_config_site ? {},
local_release ? {},
}:
mkEpicsPackage {
pname = "opcua";
version = "0.10.0-dev";
varname = "OPCUA";

src = fetchFromGitHub {
owner = "epics-modules";
repo = "opcua";
rev = "3d10053";
hash = "sha256-EQra8PesO7Rlhj+pBlAfiqh5yjJwRkuh7gbGziY58iI=";
};

inherit local_release;
local_config_site =
local_config_site
// {
OPEN62541 = "${open62541}";
OPEN62541_DEPLOY_MODE = "PROVIDED";
OPEN62541_LIB_DIR = "${open62541}/lib";
OPEN62541_SHRLIB_DIR = "${open62541}/lib";
#for the moment, we're not able to use the last version of openssl to manage a safety connection with the open62541 librairy
OPEN62541_USE_CRYPTO = "NO";
OPEN62541_USE_XMLPARSER = "YES";
};

patches = [./dir_xml2.patch];

depsBuildBuild = [pkg-config];
nativeBuildInputs = [pkg-config open62541 openssl libxml2];
buildInputs = [open62541 openssl libxml2];
propagatedNativeBuildInputs = [pkg-config];
propagatedBuildInputs = [libxml2] ++ (with epnix.support; [gtest]);

meta = {
description = "EPICS support for communication with OPC UA protocol";
homepage = "https://github.com/epics-modules/opcua";
license = epnixLib.licenses.epics;
maintainers = with epnixLib.maintainers; [vivien];
};
}
29 changes: 29 additions & 0 deletions pkgs/epnix/support/opcua/dir_xml2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
diff --git a/devOpcuaSup/open62541/Makefile.config b/devOpcuaSup/open62541/Makefile.config
index d1b82cb..5d81dc2 100644
--- a/devOpcuaSup/open62541/Makefile.config
+++ b/devOpcuaSup/open62541/Makefile.config
@@ -25,7 +25,7 @@ USR_CXXFLAGS += -DHAS_XMLPARSER
ifneq ($(filter -D_MINGW,$(OP_SYS_CPPFLAGS)),)
USR_INCLUDES += -I$(MSYSTEM_PREFIX)/include/libxml2
else
-USR_INCLUDES += -I/usr/include/libxml2
+USR_INCLUDES += `pkg-config --cflags libxml-2.0`
endif

opcua_SRCS += Session.cpp
diff --git a/unitTestApp/src/Makefile b/unitTestApp/src/Makefile
index c52a727..8c2556b 100644
--- a/unitTestApp/src/Makefile
+++ b/unitTestApp/src/Makefile
@@ -28,9 +28,9 @@ USR_CXXFLAGS += -DHAS_SECURITY
endif
ifeq ($($(CLIENT)_USE_XMLPARSER),YES)
USR_CXXFLAGS += -DHAS_XMLPARSER
-USR_INCLUDES_Linux += -I/usr/include/libxml2
+USR_INCLUDES += `pkg-config --cflags libxml-2.0`
ifneq ($(filter -D_MINGW,$(OP_SYS_CPPFLAGS)),)
-USR_INCLUDES += -I$(MSYSTEM_PREFIX)/include/libxml2
+USR_INCLUDES += `pkg-config --cflags libxml-2.0`
USR_SYS_LIBS += xml2
endif
endif

0 comments on commit f663d91

Please sign in to comment.