initial commit

This commit is contained in:
Jonas Rabenstein 2025-09-30 12:07:41 +02:00
commit e3b0136650
9 changed files with 245 additions and 0 deletions

4
package/current.nix Normal file
View file

@ -0,0 +1,4 @@
{
lib,
versions,
}:

View file

@ -0,0 +1,29 @@
let
v."1.10.0" = "sha256-deMxbLHnD1jDvQaAzhGiCF1vt11IpF6Ao2OF6zJuJ9A=";
in {
callPackage,
jetperch,
name ? "joulescope-driver",
version ? "1.10.0",
hash ? v.${version} or "",
stdenv,
#dependencies
cmake,
udev,
}: stdenv.mkDerivation {
pname = name;
version = version;
src = callPackage ../source.nix {
repo = "joulescope_driver";
inherit version;
inherit hash;
};
postPatch = ''
echo 'install(TARGETS jsdrv DESTINATION lib)' >>CMakeLists.txt
'';
nativeBuildInputs = [ cmake ];
hardeningDisable = [ "format" ];
buildInputs = [ udev.dev ];
}

18
package/pyjls/default.nix Normal file
View file

@ -0,0 +1,18 @@
let
v."0.15.0" = "sha256-lr23f8YDF/7f/dAJIiZdy69lzcnO0HRkbYS/GkOYwfo=";
in {
callPackage,
jetperch,
name ? "pyjls",
version ? "0.15.0",
hash ? v.${version} or "",
}: callPackage ../python.nix {
inherit name;
inherit jetperch;
inherit version;
inherit hash;
repo = "jls";
pydeps = py: with py; [
numpy
];
}

View file

@ -0,0 +1,33 @@
let
v."1.10.0" = "sha256-deMxbLHnD1jDvQaAzhGiCF1vt11IpF6Ao2OF6zJuJ9A=";
in {
callPackage,
jetperch,
name ? "pyjoulescope-driver",
version ? "1.10.0",
hash ? v.${version} or "",
udev,
}: (callPackage ../python.nix {
inherit name;
inherit jetperch;
inherit version;
inherit hash;
repo = "joulescope_driver";
pydeps = py: with py; [
numpy
requests
psutil
];
}
).overrideAttrs (final: prev: {
nativeBuildInputs = (prev.nativeBuildInputs or []) ++ [
[ udev udev.dev ]
];
NIX_CFLAGS_COMPILE = (prev.NIX_CFLAGS_COMPILE or []) ++ [
"-I${udev.dev}/include"
];
NIX_LDFLAGS = (prev.NIX_LDFLAGS or []) ++ [
"-L${udev}/lib"
];
dontUseCmakeConfigure = true;
})

View file

@ -0,0 +1,38 @@
let
v."1.3.9" = "sha256-9UDZxeuSsaWreoFq6hhRub+72IvDavN5Y2tfgpBUwTE=";
in {
callPackage,
jetperch,
name ? "pyjoulescope-ui",
version ? "1.3.9",
hash ? v.${version} or "",
# dependencies
pyjoulescope-driver,
pyjls,
...
}: callPackage ../python.nix {
inherit name;
inherit jetperch;
inherit version;
inherit hash;
repo = "pyjoulescope_ui";
pydeps = py: with py; [
numpy
polib
pyside6
psutil
pyjls
pyopengl
pyqtgraph
pyside6-qtads
python-dateutil
qtpy
requests
appnope
fs
markdown
watchdog
pyjoulescope-driver
];
}

36
package/python.nix Normal file
View file

@ -0,0 +1,36 @@
{
callPackage,
python3Packages,
name,
repo ? name,
version,
hash,
pydeps ? (_: []),
...
}: let
source = callPackage ./source.nix {
inherit repo;
inherit version;
inherit hash;
};
in python3Packages.buildPythonPackage {
pname = name;
inherit version;
src = callPackage ./source.nix {
inherit repo;
inherit version;
inherit hash;
};
build-system = [ python3Packages.setuptools ];
pyproject = true;
dependencies = let
common = with python3Packages; [
cython
];
in common ++ pydeps python3Packages;
}

12
package/source.nix Normal file
View file

@ -0,0 +1,12 @@
{
fetchFromGitHub,
repo,
version,
hash ? "",
owner ? "jetperch",
}: fetchFromGitHub {
owner = owner;
repo = repo;
tag = "v${version}";
inherit hash;
}