Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / pyspice / default.nix
blob94fa032085c9d180909d001cb444735db852d7b0
1 { lib, stdenv
2 , buildPythonPackage
3 , pythonOlder
4 , fetchPypi
5 , libngspice
6 , numpy
7 , ply
8 , scipy
9 , pyyaml
10 , cffi
11 , requests
12 , matplotlib
13 , setuptools
16 buildPythonPackage rec {
17   pname = "pyspice";
18   version = "1.5";
19   disabled = pythonOlder "3.6";
21   src = fetchPypi {
22     pname = "PySpice";
23     inherit version;
24     sha256 = "d28448accad98959e0f5932af8736e90a1f3f9ff965121c6881d24cdfca23d22";
25   };
27   propagatedBuildInputs = [
28     setuptools
29     requests
30     pyyaml
31     cffi
32     matplotlib
33     numpy
34     ply
35     scipy
36     libngspice
37   ];
39   doCheck = false;
40   pythonImportsCheck = [ "PySpice" ];
42   postPatch = ''
43     substituteInPlace PySpice/Spice/NgSpice/Shared.py --replace \
44         "ffi.dlopen(self.library_path)" \
45         "ffi.dlopen('${libngspice}/lib/libngspice${stdenv.hostPlatform.extensions.sharedLibrary}')"
46   '';
48   meta = with lib; {
49     description = "Simulate electronic circuit using Python and the Ngspice / Xyce simulators";
50     homepage = "https://github.com/FabriceSalvaire/PySpice";
51     license = licenses.gpl3Only;
52     maintainers = with maintainers; [ matthuszagh ];
53   };