Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / pyspice / default.nix
blob0119c38099ccb600639987e31b72a11fdbcbbe79
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     inherit pname version;
23     sha256 = "d28448accad98959e0f5932af8736e90a1f3f9ff965121c6881d24cdfca23d22";
24   };
26   propagatedBuildInputs = [
27     setuptools
28     requests
29     pyyaml
30     cffi
31     matplotlib
32     numpy
33     ply
34     scipy
35     libngspice
36   ];
38   doCheck = false;
39   pythonImportsCheck = [ "PySpice" ];
41   postPatch = ''
42     substituteInPlace PySpice/Spice/NgSpice/Shared.py --replace \
43         "ffi.dlopen(self.library_path)" \
44         "ffi.dlopen('${libngspice}/lib/libngspice${stdenv.hostPlatform.extensions.sharedLibrary}')"
45   '';
47   meta = with lib; {
48     description = "Simulate electronic circuit using Python and the Ngspice / Xyce simulators";
49     homepage = "https://github.com/FabriceSalvaire/PySpice";
50     license = licenses.gpl3Only;
51     maintainers = with maintainers; [ matthuszagh ];
52   };