python312Packages.fnllm: 0.0.11 -> 0.0.12 (#364582)
[NixPkgs.git] / pkgs / development / python-modules / pyspice / default.nix
blobc88331be6880a3491da7c7e8ab8de2b0d4dce130
2   lib,
3   stdenv,
4   buildPythonPackage,
5   pythonOlder,
6   fetchPypi,
7   libngspice,
8   numpy,
9   ply,
10   scipy,
11   pyyaml,
12   cffi,
13   requests,
14   matplotlib,
15   setuptools,
18 buildPythonPackage rec {
19   pname = "pyspice";
20   version = "1.5";
21   disabled = pythonOlder "3.6";
23   src = fetchPypi {
24     pname = "PySpice";
25     inherit version;
26     sha256 = "d28448accad98959e0f5932af8736e90a1f3f9ff965121c6881d24cdfca23d22";
27   };
29   propagatedBuildInputs = [
30     setuptools
31     requests
32     pyyaml
33     cffi
34     matplotlib
35     numpy
36     ply
37     scipy
38     libngspice
39   ];
41   doCheck = false;
42   pythonImportsCheck = [ "PySpice" ];
44   postPatch = ''
45     substituteInPlace PySpice/Spice/NgSpice/Shared.py --replace \
46         "ffi.dlopen(self.library_path)" \
47         "ffi.dlopen('${libngspice}/lib/libngspice${stdenv.hostPlatform.extensions.sharedLibrary}')"
48   '';
50   meta = with lib; {
51     description = "Simulate electronic circuit using Python and the Ngspice / Xyce simulators";
52     homepage = "https://github.com/FabriceSalvaire/PySpice";
53     license = licenses.gpl3Only;
54     maintainers = with maintainers; [ matthuszagh ];
55   };