2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv
|
2020-05-23 14:34:17 +01:00
|
|
|
, buildPythonPackage
|
2020-10-06 00:24:47 +01:00
|
|
|
, pythonOlder
|
2020-05-23 14:34:17 +01:00
|
|
|
, fetchPypi
|
|
|
|
, libngspice
|
|
|
|
, numpy
|
|
|
|
, ply
|
|
|
|
, scipy
|
|
|
|
, pyyaml
|
|
|
|
, cffi
|
|
|
|
, requests
|
|
|
|
, matplotlib
|
|
|
|
, setuptools
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "PySpice";
|
|
|
|
version = "1.4.3";
|
2020-10-06 00:24:47 +01:00
|
|
|
disabled = pythonOlder "3.6";
|
2020-05-23 14:34:17 +01:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
|
|
|
sha256 = "0mnyy8nr06d1al99kniyqcm0p9a8dvkg719s42sajl8yf51sayc9";
|
|
|
|
};
|
|
|
|
|
|
|
|
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-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-05-23 14:34:17 +01: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 ];
|
|
|
|
};
|
|
|
|
}
|