2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, flex
|
|
|
|
, bison
|
|
|
|
, fftw
|
|
|
|
, withNgshared ? true
|
|
|
|
, libXaw
|
|
|
|
, libXext
|
2024-09-19 14:19:46 +00:00
|
|
|
, llvmPackages
|
|
|
|
, readline
|
2023-07-15 17:15:38 +00:00
|
|
|
}:
|
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-09-19 14:19:46 +00:00
|
|
|
version = "43";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/ngspice/ngspice-${version}.tar.gz";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-FN1qbwhTHyBRwTrmN5CkVwi9Q/PneIamqEiYwpexNpk=";
|
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
|
2024-09-19 14:19:46 +00:00
|
|
|
readline
|
2023-07-15 17:15:38 +00:00
|
|
|
] ++ lib.optionals (!withNgshared) [
|
|
|
|
libXaw
|
|
|
|
libXext
|
2024-09-26 11:04:55 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2024-09-19 14:19:46 +00:00
|
|
|
llvmPackages.openmp
|
2023-07-15 17:15:38 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
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; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "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
|
|
|
};
|
|
|
|
}
|