From 0b4f25832b9d3716225fcd3ddd6df9cfb462343a Mon Sep 17 00:00:00 2001 From: Eric Flumerfelt Date: Thu, 18 Dec 2025 13:52:57 -0600 Subject: [PATCH 1/2] Initial version of epics-asyn and epics-streamdevice Spack package implementations --- packages/epics-asyn/package.py | 33 ++++++++++++++++++++++ packages/epics-streamdevice/package.py | 38 ++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 packages/epics-asyn/package.py create mode 100644 packages/epics-streamdevice/package.py diff --git a/packages/epics-asyn/package.py b/packages/epics-asyn/package.py new file mode 100644 index 0000000..fee48d2 --- /dev/null +++ b/packages/epics-asyn/package.py @@ -0,0 +1,33 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class EpicsAsyn(MakefilePackage): + """A general purpose facility for interfacing device specific code to low level drivers. asynDriver allows non-blocking device support that works with both blocking and non-blocking drivers.""" + + homepage = "https://epics-modules.github.io/master/asyn/" + url = "https://github.com/epics-modules/asyn/archive/R4-43.tar.gz" + + # https://github.com/epics-modules/asyn/blob/master/LICENSE + license("Other", checked_by="eflumerf") + + version("4-43", sha256="2cd1da9bafc6e09d18992d00797ea4b966d7404be2fb0d309bc3f542e6b3c7ba") + + depends_on("c", type="build") + depends_on("cxx", type="build") + + depends_on("epics-base") + depends_on("libtirpc") + + def edit(self, spec, prefix): + release = FileFilter("configure/RELEASE") + release.filter("^#EPICS_BASE *=.*", f"EPICS_BASE = {spec['epics-base'].prefix}") + config_site = FileFilter("configure/CONFIG_SITE") + config_site.filter("^# TIRPC=YES", "TIRPC=YES") + pass + + def install(self, spec, prefix): + make("INSTALL_LOCATION=" + prefix, "install") diff --git a/packages/epics-streamdevice/package.py b/packages/epics-streamdevice/package.py new file mode 100644 index 0000000..351955c --- /dev/null +++ b/packages/epics-streamdevice/package.py @@ -0,0 +1,38 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class EpicsStreamdevice(MakefilePackage): + """StreamDevice is a generic EPICS device support for devices with a "byte stream" based communication interface. + That means devices that can be controlled by sending and receiving strings (in the broadest sense, including non-printable characters and even null-bytes). + Examples for this type of communication interface are serial line (RS-232, RS-485, ...), IEEE-488 (also known as GPIB or HP-IB), and telnet-like TCP/IP.""" + + homepage = "https://paulscherrerinstitute.github.io/StreamDevice/" + url = "https://github.com/paulscherrerinstitute/StreamDevice/archive/refs/tags/2.8.26.tar.gz" + + license("LGPL-3.0-only", checked_by="eflumerf") + + version("2.8.26", sha256="0c212245fb4626a94e291a6744f5483343b3b896907693c6a71048de68faabc4") + + variant("asyn", default=True, description="Enable asyn support") + variant("pcre", default=True, description="Enable pcre support") + + depends_on("epics-base") + depends_on("epics-asyn", when="+asyn") + depends_on("pcre", when="+pcre") + + def edit(self, spec, prefix): + release = FileFilter("configure/RELEASE") + release.filter("^EPICS_BASE *=.*", f"EPICS_BASE = {spec['epics-base'].prefix}") + if "+asyn" in spec: + release.filter("^ASYN *=.*", f"ASYN = {spec['epics-asyn'].prefix}") + if "+pcre" in spec: + release.filter("^PCRE *=.*", f"PCRE_INCLUDE = {spec['pcre'].prefix.include}\nPCRE_LIB = {spec['pcre'].prefix.lib}") + release.filter("CALC *=.*", "#CALC") # No CALC support for now + pass + + def install(self, spec, prefix): + make("INSTALL_LOCATION=" + prefix, "install") From fb367f404f560c5403264a540134b4a7016b4d48 Mon Sep 17 00:00:00 2001 From: Eric Flumerfelt Date: Thu, 18 Dec 2025 13:54:57 -0600 Subject: [PATCH 2/2] Fix whitespace --- packages/epics-streamdevice/package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/epics-streamdevice/package.py b/packages/epics-streamdevice/package.py index 351955c..c5afd20 100644 --- a/packages/epics-streamdevice/package.py +++ b/packages/epics-streamdevice/package.py @@ -6,8 +6,8 @@ class EpicsStreamdevice(MakefilePackage): - """StreamDevice is a generic EPICS device support for devices with a "byte stream" based communication interface. - That means devices that can be controlled by sending and receiving strings (in the broadest sense, including non-printable characters and even null-bytes). + """StreamDevice is a generic EPICS device support for devices with a "byte stream" based communication interface. + That means devices that can be controlled by sending and receiving strings (in the broadest sense, including non-printable characters and even null-bytes). Examples for this type of communication interface are serial line (RS-232, RS-485, ...), IEEE-488 (also known as GPIB or HP-IB), and telnet-like TCP/IP.""" homepage = "https://paulscherrerinstitute.github.io/StreamDevice/"