From 9dacd525496005d315acd4557b3c84f205483264 Mon Sep 17 00:00:00 2001 From: Patrick Hilhorst Date: Fri, 15 Nov 2024 14:19:22 +0000 Subject: [PATCH 1/5] epicscorelibs: init at 7.0.7.99.1.1 --- pkgs/default.nix | 14 +++++++++ .../python-modules/epicscorelibs/default.nix | 30 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 pkgs/epnix/python-modules/epicscorelibs/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index 295b3041..cf081e0b 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -18,6 +18,20 @@ in pyepics = final.callPackage ./epnix/python-modules/pyepics {}; recceiver = final.callPackage ./epnix/tools/channel-finder/recceiver {}; scanf = final.callPackage ./epnix/tools/scanf {}; + epicscorelibs = final.callPackage ./epnix/python-modules/epicscorelibs {}; + + # epicscorelibs needs at least 2.11. + # TODO: remove for NixOS 24.11 + setuptools-dso = prev.setuptools-dso.overrideAttrs (old: + final.lib.optionalAttrs (final.lib.versionOlder old.version "2.11") rec { + name = "${old.pname}-${version}"; + version = "2.11"; + + src = old.src.override { + inherit version; + hash = "sha256-lT5mp0TiHbvkrXPiK5/uLke65znya8Y6s3RzpFuXVFY="; + }; + }); }) ]; diff --git a/pkgs/epnix/python-modules/epicscorelibs/default.nix b/pkgs/epnix/python-modules/epicscorelibs/default.nix new file mode 100644 index 00000000..334e0560 --- /dev/null +++ b/pkgs/epnix/python-modules/epicscorelibs/default.nix @@ -0,0 +1,30 @@ +{ + epnixLib, + buildPythonPackage, + fetchPypi, + setuptools, + setuptools-dso, + pip, + numpy, +}: +buildPythonPackage rec { + pname = "epicscorelibs"; + version = "7.0.7.99.1.1"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-+d0sAZE88TlZ6ILHwq/M1dVc1QhL1FlyAeoRn2V1IjE="; + }; + + dontConfigure = true; + + build-system = [setuptools]; + dependencies = [setuptools-dso pip numpy]; + + meta = { + description = "EPICS core libraries packaged as a Python module"; + homepage = "https://github.com/epics-base/epicscorelibs"; + license = epnixLib.licenses.epics; + maintainers = with epnixLib.maintainers; [synthetica]; + }; +} From dcecce54b4091095d488509f15356067c8b1380a Mon Sep 17 00:00:00 2001 From: Patrick Hilhorst Date: Fri, 15 Nov 2024 14:21:31 +0000 Subject: [PATCH 2/5] pvxslibs: init at 1.3.1 --- pkgs/default.nix | 1 + .../epnix/python-modules/pvxslibs/default.nix | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 pkgs/epnix/python-modules/pvxslibs/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index cf081e0b..f6dc064e 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -19,6 +19,7 @@ in recceiver = final.callPackage ./epnix/tools/channel-finder/recceiver {}; scanf = final.callPackage ./epnix/tools/scanf {}; epicscorelibs = final.callPackage ./epnix/python-modules/epicscorelibs {}; + pvxslibs = final.callPackage ./epnix/python-modules/pvxslibs {}; # epicscorelibs needs at least 2.11. # TODO: remove for NixOS 24.11 diff --git a/pkgs/epnix/python-modules/pvxslibs/default.nix b/pkgs/epnix/python-modules/pvxslibs/default.nix new file mode 100644 index 00000000..ce222137 --- /dev/null +++ b/pkgs/epnix/python-modules/pvxslibs/default.nix @@ -0,0 +1,22 @@ +{ + buildPythonPackage, + epnix, + fetchPypi, + setuptools_dso, + epicscorelibs, +}: +buildPythonPackage rec { + pname = "pvxslibs"; + inherit (epnix.support.pvxs) version; + + src = fetchPypi { + inherit pname version; + hash = "sha256-p9H6nK+iYJ5ML4x3wE0CmTq0sRFS4kGNgsyKEZPb2bU="; + }; + + configureScript = "true"; + + nativeBuildInputs = [setuptools_dso epicscorelibs]; + + inherit (epnix.support.pvxs) meta; +} From fddbe39ff9cf1d18f3d4cbf6b9552bd44a53aa07 Mon Sep 17 00:00:00 2001 From: Patrick Hilhorst Date: Fri, 15 Nov 2024 14:26:07 +0000 Subject: [PATCH 3/5] aioca: init at 1.8.1 --- pkgs/default.nix | 3 +- pkgs/epnix/python-modules/aioca/default.nix | 37 +++++++++++++++++++++ pkgs/tests/default.nix | 1 + 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 pkgs/epnix/python-modules/aioca/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index f6dc064e..242bf1fe 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -20,6 +20,7 @@ in scanf = final.callPackage ./epnix/tools/scanf {}; epicscorelibs = final.callPackage ./epnix/python-modules/epicscorelibs {}; pvxslibs = final.callPackage ./epnix/python-modules/pvxslibs {}; + aioca = final.callPackage ./epnix/python-modules/aioca/default.nix {}; # epicscorelibs needs at least 2.11. # TODO: remove for NixOS 24.11 @@ -91,7 +92,7 @@ in channel-finder-service = callPackage ./epnix/tools/channel-finder/service {}; - inherit (final.python3Packages) lewis pyepics; + inherit (final.python3Packages) lewis pyepics softioc; inherit (callPackage ./epnix/tools/lewis/lib.nix {}) mkLewisSimulator; pcas = callPackage ./epnix/tools/pcas {}; diff --git a/pkgs/epnix/python-modules/aioca/default.nix b/pkgs/epnix/python-modules/aioca/default.nix new file mode 100644 index 00000000..8f676992 --- /dev/null +++ b/pkgs/epnix/python-modules/aioca/default.nix @@ -0,0 +1,37 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + setuptools-scm, + numpy, + epicscorelibs, + epnixLib, +}: +buildPythonPackage rec { + pname = "aioca"; + version = "1.8.1"; + + pyproject = true; + + src = fetchFromGitHub { + owner = "DiamondLightSource"; + repo = "aioca"; + rev = "${version}"; + hash = "sha256-szM/sVqeWWUj84lq/wsxNCf/aZwoCySeTnuLD+hYLyc="; + }; + + build-system = [setuptools setuptools-scm]; + dependencies = [ + setuptools + numpy + epicscorelibs + ]; + + meta = { + description = "Asynchronous Channel Access client for asyncio and Python using libca via ctypes"; + homepage = "https://DiamondLightSource.github.io/aioca"; + license = lib.licenses.asl20; + maintainers = with epnixLib.maintainers; [synthetica]; + }; +} diff --git a/pkgs/tests/default.nix b/pkgs/tests/default.nix index 9181d16e..e7ad05d0 100644 --- a/pkgs/tests/default.nix +++ b/pkgs/tests/default.nix @@ -7,4 +7,5 @@ channelfinder-default-python = pkgs.python3Packages.channelfinder; mrf-driver-default-linux = pkgs.linuxPackages.mrf; recceiver-default-python = pkgs.python3Packages.recceiver; + aiaoca-default-python = pkgs.python3Packages.aioca; } From c21a3d98dbd501bb2ddb47ece8fff7f7ad780238 Mon Sep 17 00:00:00 2001 From: Patrick Hilhorst Date: Fri, 15 Nov 2024 14:32:01 +0000 Subject: [PATCH 4/5] epicsdbbuilder: init at 1.5 --- pkgs/default.nix | 1 + .../python-modules/epicsdbbuilder/default.nix | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 pkgs/epnix/python-modules/epicsdbbuilder/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index 242bf1fe..03fbc14b 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -21,6 +21,7 @@ in epicscorelibs = final.callPackage ./epnix/python-modules/epicscorelibs {}; pvxslibs = final.callPackage ./epnix/python-modules/pvxslibs {}; aioca = final.callPackage ./epnix/python-modules/aioca/default.nix {}; + epicsdbbuilder = final.callPackage ./epnix/python-modules/epicsdbbuilder {}; # epicscorelibs needs at least 2.11. # TODO: remove for NixOS 24.11 diff --git a/pkgs/epnix/python-modules/epicsdbbuilder/default.nix b/pkgs/epnix/python-modules/epicsdbbuilder/default.nix new file mode 100644 index 00000000..fe6b5d45 --- /dev/null +++ b/pkgs/epnix/python-modules/epicsdbbuilder/default.nix @@ -0,0 +1,24 @@ +{ + buildPythonPackage, + fetchFromGitHub, + lib, + epnixLib, +}: +buildPythonPackage rec { + pname = "epicsdbbuilder"; + version = "1.5"; + + src = fetchFromGitHub { + owner = "DiamondLightSource"; + repo = pname; + rev = version; + hash = "sha256-H+8dJY6nY/4ogxcoZVmZzI7STI4x0urQKddlTifAqGQ="; + }; + + meta = { + description = "Tool for building EPICS databases"; + homepage = "https://DiamondLightSource.github.io/epicsdbbuilder"; + license = lib.licenses.asl20; + maintainers = with epnixLib.maintainers; [synthetica]; + }; +} From 14bfefa85958e33ad9fbcd0e0b56f42cf6b126d0 Mon Sep 17 00:00:00 2001 From: Patrick Hilhorst Date: Fri, 15 Nov 2024 14:35:13 +0000 Subject: [PATCH 5/5] softioc: init at 4.5.0 --- pkgs/default.nix | 4 +- pkgs/epnix/python-modules/softioc/default.nix | 38 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 pkgs/epnix/python-modules/softioc/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index 03fbc14b..1352db8a 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,8 @@ in channel-finder-service = callPackage ./epnix/tools/channel-finder/service {}; - inherit (final.python3Packages) lewis pyepics softioc; + inherit (final.python3Packages) lewis pyepics; + pythonSoftIOC = final.python3Packages.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 00000000..8bf8d141 --- /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]; + }; +}