From b805579a0bba8bb72ee26218651e2b60ff73cfaf Mon Sep 17 00:00:00 2001 From: Alexis Gaget Date: Wed, 20 Dec 2023 17:07:11 +0100 Subject: [PATCH] add ESS ADS driver support (Beckhoff TwinCAT) --- lib/maintainers/maintainer-list.nix | 4 +++ pkgs/default.nix | 1 + pkgs/epnix/support/ads/default.nix | 45 +++++++++++++++++++++++++++++ pkgs/epnix/support/ads/fixDep.patch | 12 ++++++++ 4 files changed, 62 insertions(+) create mode 100644 pkgs/epnix/support/ads/default.nix create mode 100644 pkgs/epnix/support/ads/fixDep.patch diff --git a/lib/maintainers/maintainer-list.nix b/lib/maintainers/maintainer-list.nix index 0061c4fb..a324399d 100644 --- a/lib/maintainers/maintainer-list.nix +++ b/lib/maintainers/maintainer-list.nix @@ -62,4 +62,8 @@ See `` for an ex email = "stephane.tzvetkov@cea.fr"; name = "Stéphane Tzvetkov"; }; + agaget = { + email = "alexis.gaget@cea.fr"; + name = "Alexis Gaget"; + }; } diff --git a/pkgs/default.nix b/pkgs/default.nix index 0d1e908c..671cee26 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -25,6 +25,7 @@ in # EPICS support modules support = recurseExtensible (_self: { + ads = callPackage ./epnix/support/ads {}; asyn = callPackage ./epnix/support/asyn {}; autosave = callPackage ./epnix/support/autosave {}; calc = callPackage ./epnix/support/calc {}; diff --git a/pkgs/epnix/support/ads/default.nix b/pkgs/epnix/support/ads/default.nix new file mode 100644 index 00000000..0e939d59 --- /dev/null +++ b/pkgs/epnix/support/ads/default.nix @@ -0,0 +1,45 @@ +{ + lib, + epnixLib, + epnix, + mkEpicsPackage, + fetchFromGitLab, + local_config_site ? {}, + local_release ? {}, +}: +mkEpicsPackage rec { + pname = "ads"; + version = "2023.08.20"; + varname = "ADS"; + + inherit local_config_site local_release; + + src = fetchFromGitLab { + domain = "gitlab.esss.lu.se"; + owner = "epics-modules"; + repo = "epics-twincat-ads"; + rev = "f07f73cd20320e40e908ed281527a81a4799bbce"; + fetchSubmodules = true; + sha256 = "sha256-NCuT2EpEBEVMzQw4cU8l0AUYVXa9fUtEOGpynG5Z85M="; + }; + + # Patch used to fix parallelization compilation issue caused by EPNix compare to standard compilation. + # Wait for PR https://gitlab.esss.lu.se/epics-modules/epics-twincat-ads/-/merge_requests/3 + patches = [./fixDep.patch]; + + propagatedBuildInputs = with epnix.support; [asyn calc]; + + preBuild = '' + touch configure/RELEASE_PATHS.local + touch configure/RELEASE_LIBS.local + ''; + + meta = { + description = "Module providing EPICS support for ADS Protocol (Automation Device Specification)"; + homepage = "https://www.beckhoff.com/en-en/products/automation/twincat/tc1xxx-twincat-3-base/tc1000.html"; + # Wait for ESS team answer about the license : https://gitlab.esss.lu.se/epics-modules/epics-twincat-ads/-/issues/1 + # lib.licenses.free don't work in EPNIX for now + license = epnixLib.licenses.epics; + maintainers = with epnixLib.maintainers; [agaget]; + }; +} diff --git a/pkgs/epnix/support/ads/fixDep.patch b/pkgs/epnix/support/ads/fixDep.patch new file mode 100644 index 00000000..10dfb791 --- /dev/null +++ b/pkgs/epnix/support/ads/fixDep.patch @@ -0,0 +1,12 @@ +diff --git a/Makefile.epics b/Makefile.epics +index ef5c909..a709c05 100644 +--- a/Makefile.epics ++++ b/Makefile.epics +@@ -10,6 +10,7 @@ endef + $(foreach dir, $(filter-out configure,$(DIRS)),$(eval $(call DIR_template,$(dir)))) + + iocBoot_DEPEND_DIRS += $(filter %App,$(DIRS)) ++adsExApp_DEPEND_DIRS += adsApp + + include $(TOP)/configure/RULES_TOP +