about summary refs log tree commit diff
path: root/pkgs/development/libraries/libngspice
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2023-05-25 11:16:36 +0300
committerWeijia Wang <9713184+wegank@users.noreply.github.com>2023-05-25 11:16:36 +0300
commit8a7c32b8cb3da2abe2e12e3f677f7488185113b9 (patch)
tree9aaad0855c01aaa0e7b0bc1eab895a6a0ef06675 /pkgs/development/libraries/libngspice
parent94dca479f497270a7be9157768fa8dc6cd68e2da (diff)
ngspice: 37 -> 40
Diffstat (limited to 'pkgs/development/libraries/libngspice')
-rw-r--r--pkgs/development/libraries/libngspice/default.nix39
1 files changed, 30 insertions, 9 deletions
diff --git a/pkgs/development/libraries/libngspice/default.nix b/pkgs/development/libraries/libngspice/default.nix
index d394621be1172..5537bb0ca4b17 100644
--- a/pkgs/development/libraries/libngspice/default.nix
+++ b/pkgs/development/libraries/libngspice/default.nix
@@ -1,26 +1,47 @@
-{lib, stdenv, fetchurl, bison, flex, fftw}:
+{ lib
+, stdenv
+, fetchurl
+, flex
+, bison
+, fftw
+, withNgshared ? true
+, libXaw
+, libXext
+}:
 
-# Note that this does not provide the ngspice command-line utility. For that see
-# the ngspice derivation.
 stdenv.mkDerivation rec {
-  pname = "libngspice";
+  pname = "${lib.optionalString withNgshared "lib"}ngspice";
   version = "40";
 
   src = fetchurl {
     url = "mirror://sourceforge/ngspice/ngspice-${version}.tar.gz";
-    sha256 = "sha256-4wPKe8D1lOLWqoT2h4VCPmvwyNrQCbsgvk1XQliOiQ0=";
+    hash = "sha256-4wPKe8D1lOLWqoT2h4VCPmvwyNrQCbsgvk1XQliOiQ0=";
   };
 
-  nativeBuildInputs = [ flex bison ];
-  buildInputs = [ fftw ];
+  nativeBuildInputs = [
+    flex
+    bison
+  ];
 
-  configureFlags = [ "--with-ngshared" "--enable-xspice" "--enable-cider" ];
+  buildInputs = [
+    fftw
+  ] ++ lib.optionals (!withNgshared) [
+    libXaw
+    libXext
+  ];
+
+  configureFlags = lib.optionals withNgshared [
+    "--with-ngshared"
+  ] ++ [
+    "--enable-xspice"
+    "--enable-cider"
+  ];
 
   meta = with lib; {
     description = "The Next Generation Spice (Electronic Circuit Simulator)";
     homepage = "http://ngspice.sourceforge.net";
     license = with licenses; [ bsd3 gpl2Plus lgpl2Plus ]; # See https://sourceforge.net/p/ngspice/ngspice/ci/master/tree/COPYING
-    maintainers = with maintainers; [ bgamari ];
+    maintainers = with maintainers; [ bgamari rongcuid ];
     platforms = platforms.unix;
   };
 }