zipline: refactor environment variables (#377101)
[NixPkgs.git] / pkgs / by-name / li / libngspice / package.nix
blob18720937e01bbfb6a24b12103cf7d395e13aa610
2   lib,
3   stdenv,
4   fetchurl,
5   flex,
6   bison,
7   fftw,
8   withNgshared ? true,
9   libXaw,
10   libXext,
11   llvmPackages,
12   readline,
15 stdenv.mkDerivation rec {
16   pname = "${lib.optionalString withNgshared "lib"}ngspice";
17   version = "43";
19   src = fetchurl {
20     url = "mirror://sourceforge/ngspice/ngspice-${version}.tar.gz";
21     hash = "sha256-FN1qbwhTHyBRwTrmN5CkVwi9Q/PneIamqEiYwpexNpk=";
22   };
24   nativeBuildInputs = [
25     flex
26     bison
27   ];
29   buildInputs =
30     [
31       fftw
32       readline
33     ]
34     ++ lib.optionals (!withNgshared) [
35       libXaw
36       libXext
37     ]
38     ++ lib.optionals stdenv.hostPlatform.isDarwin [
39       llvmPackages.openmp
40     ];
42   configureFlags =
43     lib.optionals withNgshared [
44       "--with-ngshared"
45     ]
46     ++ [
47       "--enable-xspice"
48       "--enable-cider"
49       "--enable-osdi"
50     ];
52   enableParallelBuilding = true;
54   meta = with lib; {
55     description = "Next Generation Spice (Electronic Circuit Simulator)";
56     mainProgram = "ngspice";
57     homepage = "http://ngspice.sourceforge.net";
58     license = with licenses; [
59       bsd3
60       gpl2Plus
61       lgpl2Plus
62     ]; # See https://sourceforge.net/p/ngspice/ngspice/ci/master/tree/COPYING
63     maintainers = with maintainers; [ bgamari ];
64     platforms = platforms.unix;
65   };