2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, flex
|
|
|
|
, bison
|
|
|
|
, fftw
|
|
|
|
, withNgshared ? true
|
|
|
|
, libXaw
|
|
|
|
, libXext
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2023-07-15 17:15:38 +00:00
|
|
|
pname = "${lib.optionalString withNgshared "lib"}ngspice";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "42";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/ngspice/ngspice-${version}.tar.gz";
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-c3/jhGqyMzolDfrfHtbr4YYK8dil/154A8dyzEJW5Qo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
flex
|
|
|
|
bison
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
buildInputs = [
|
|
|
|
fftw
|
|
|
|
] ++ lib.optionals (!withNgshared) [
|
|
|
|
libXaw
|
|
|
|
libXext
|
|
|
|
];
|
|
|
|
|
|
|
|
configureFlags = lib.optionals withNgshared [
|
|
|
|
"--with-ngshared"
|
|
|
|
] ++ [
|
|
|
|
"--enable-xspice"
|
|
|
|
"--enable-cider"
|
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "The Next Generation Spice (Electronic Circuit Simulator)";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "ngspice";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://ngspice.sourceforge.net";
|
|
|
|
license = with licenses; [ bsd3 gpl2Plus lgpl2Plus ]; # See https://sourceforge.net/p/ngspice/ngspice/ci/master/tree/COPYING
|
2023-07-15 17:15:38 +00:00
|
|
|
maintainers = with maintainers; [ bgamari rongcuid ];
|
2020-08-20 17:08:02 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|