2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
|
|
|
fetchPypi,
|
|
|
|
libngspice,
|
|
|
|
numpy,
|
|
|
|
ply,
|
|
|
|
scipy,
|
|
|
|
pyyaml,
|
|
|
|
cffi,
|
|
|
|
requests,
|
|
|
|
matplotlib,
|
|
|
|
setuptools,
|
2020-09-25 04:45:31 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2024-04-21 15:54:59 +00:00
|
|
|
pname = "pyspice";
|
2021-06-28 23:13:55 +00:00
|
|
|
version = "1.5";
|
2020-10-07 09:15:18 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
2024-04-21 15:54:59 +00:00
|
|
|
pname = "PySpice";
|
|
|
|
inherit version;
|
2021-06-28 23:13:55 +00:00
|
|
|
sha256 = "d28448accad98959e0f5932af8736e90a1f3f9ff965121c6881d24cdfca23d22";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
requests
|
|
|
|
pyyaml
|
|
|
|
cffi
|
|
|
|
matplotlib
|
|
|
|
numpy
|
|
|
|
ply
|
|
|
|
scipy
|
|
|
|
libngspice
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
pythonImportsCheck = [ "PySpice" ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace PySpice/Spice/NgSpice/Shared.py --replace \
|
|
|
|
"ffi.dlopen(self.library_path)" \
|
|
|
|
"ffi.dlopen('${libngspice}/lib/libngspice${stdenv.hostPlatform.extensions.sharedLibrary}')"
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-09-25 04:45:31 +00:00
|
|
|
description = "Simulate electronic circuit using Python and the Ngspice / Xyce simulators";
|
|
|
|
homepage = "https://github.com/FabriceSalvaire/PySpice";
|
|
|
|
license = licenses.gpl3Only;
|
|
|
|
maintainers = with maintainers; [ matthuszagh ];
|
|
|
|
};
|
|
|
|
}
|