diff --git a/pkgs/default.nix b/pkgs/default.nix index aa651b9..0d5d8a9 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -22,6 +22,7 @@ in pvxslibs = final.callPackage ./epnix/python-modules/pvxslibs {}; aioca = final.callPackage ./epnix/python-modules/aioca/default.nix {}; epicsdbbuilder = final.callPackage ./epnix/python-modules/epicsdbbuilder {}; + softioc = final.callPackage ./epnix/python-modules/softioc {}; # epicscorelibs needs at least 2.11. # TODO: remove for NixOS 24.11 @@ -93,7 +94,7 @@ in channel-finder-service = callPackage ./epnix/tools/channel-finder/service {}; - inherit (final.python3Packages) lewis pyepics aioca; + inherit (final.python3Packages) lewis pyepics aioca softioc; inherit (callPackage ./epnix/tools/lewis/lib.nix {}) mkLewisSimulator; pcas = callPackage ./epnix/tools/pcas {}; diff --git a/pkgs/epnix/python-modules/softioc/default.nix b/pkgs/epnix/python-modules/softioc/default.nix new file mode 100644 index 0000000..8bf8d14 --- /dev/null +++ b/pkgs/epnix/python-modules/softioc/default.nix @@ -0,0 +1,38 @@ +{ + lib, + buildPythonPackage, + fetchgit, + setuptools, + epicscorelibs, + pvxslibs, + epicsdbbuilder, + epnixLib, +}: +buildPythonPackage rec { + pname = "softioc"; + version = "4.5.0"; + + pyproject = true; + + src = fetchgit { + url = "https://github.com/DiamondLightSource/pythonSoftIOC.git"; + rev = version; + fetchSubmodules = true; + hash = "sha256-JXfFkA3MzipqUw0riMTZmgCP9qe4Tfj8vZaFBwqoO+c="; + }; + + # Set correct version instead of automatically detected version: + postPatch = '' + awk -i inplace "/__version__/ && !x {print; print \"__version__ = '${version}'\"; x=1; next} 1" setup.py + ''; + + build-system = [setuptools]; + dependencies = [setuptools epicscorelibs epicsdbbuilder pvxslibs]; + + meta = { + description = "Embed an EPICS IOC in a Python process"; + homepage = "https://DiamondLightSource.github.io/pythonSoftIOC"; + license = lib.licenses.asl20; + maintainers = with epnixLib.maintainers; [synthetica]; + }; +}