Skip to content

Commit

Permalink
Merge pull request #73 from vivienCEA/feat-add-opcua-support
Browse files Browse the repository at this point in the history
Add opcua EPICS support module
  • Loading branch information
minijackson authored Apr 29, 2024
2 parents 7339827 + f663d91 commit 60bafc4
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,8 @@ See `<nixpkgs/maintainers/scripts/check-maintainer-github-handles.sh>` for an ex
github = "Synthetica9";
githubId = 7075751;
};
vivien = {
email = "[email protected]";
name = "Vivien Loriot";
};
}
2 changes: 2 additions & 0 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ in
calc = callPackage ./epnix/support/calc {};
devlib2 = callPackage ./epnix/support/devlib2 {};
epics-systemd = callPackage ./epnix/support/epics-systemd {};
gtest = callPackage ./epnix/support/gtest {};
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
29 changes: 29 additions & 0 deletions pkgs/epnix/support/gtest/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
lib,
epnixLib,
mkEpicsPackage,
fetchFromGitHub,
local_config_site ? {},
local_release ? {},
}:
mkEpicsPackage {
pname = "gtest";
version = "1.0.1";
varname = "GTEST";

src = fetchFromGitHub {
owner = "epics-modules";
repo = "gtest";
rev = "v1.0.1";
hash = "sha256-cDZ4++AkUiOvsw4KkobyqKWLk2GzUSdDdWjLL7dr1ac=";
};

inherit local_release local_config_site;

meta = {
description = "EPICS module to adds the Google Test and Google Mock frameworks to EPICS";
homepage = "https://github.com/epics-modules/gtest";
license = epnixLib.licenses.epics;
maintainers = with epnixLib.maintainers; [vivien];
};
}
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 60bafc4

Please sign in to comment.