diff --git a/lib/maintainers/maintainer-list.nix b/lib/maintainers/maintainer-list.nix index b875cc1e..8a293113 100644 --- a/lib/maintainers/maintainer-list.nix +++ b/lib/maintainers/maintainer-list.nix @@ -72,4 +72,8 @@ See `` for an ex github = "Synthetica9"; githubId = 7075751; }; + vivien = { + email = "vivien.loriot@cea.fr"; + name = "Vivien Loriot"; + }; } diff --git a/pkgs/default.nix b/pkgs/default.nix index c81dfa20..7a8353de 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -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 {}; diff --git a/pkgs/epnix/support/gtest/default.nix b/pkgs/epnix/support/gtest/default.nix new file mode 100644 index 00000000..6b83bdbd --- /dev/null +++ b/pkgs/epnix/support/gtest/default.nix @@ -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]; + }; +} diff --git a/pkgs/epnix/support/opcua/default.nix b/pkgs/epnix/support/opcua/default.nix new file mode 100644 index 00000000..73eaa9f3 --- /dev/null +++ b/pkgs/epnix/support/opcua/default.nix @@ -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]; + }; +} diff --git a/pkgs/epnix/support/opcua/dir_xml2.patch b/pkgs/epnix/support/opcua/dir_xml2.patch new file mode 100644 index 00000000..1184c861 --- /dev/null +++ b/pkgs/epnix/support/opcua/dir_xml2.patch @@ -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