guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#27344] [PATCH 08/12] gnu: Add ngspice.


From: Theodoros Foradis
Subject: [bug#27344] [PATCH 08/12] gnu: Add ngspice.
Date: Mon, 12 Jun 2017 19:52:22 +0300

* gnu/packages/engineering.scm (ngspice): New variable.
---
 gnu/packages/engineering.scm | 74 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 74 insertions(+)

diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index b88dad3b3..1d7a3631e 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -1075,3 +1075,77 @@ language, ADMS transforms Verilog-AMS code into other 
target languages.")
      "ASCO brings circuit optimization capabilities to existing SPICE 
simulators using a
 high-performance parallel differential evolution (DE) optimization algorithm.")
     (license license:gpl2+)))
+
+(define libngspice
+  (package
+    (name "libngspice")
+    (version "26")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append 
"mirror://sourceforge/ngspice/ng-spice-rework/"
+                                  version "/ngspice-" version ".tar.gz"))
+              (sha256
+               (base32
+                "02019ndcl057nq9z41nxycqba7wxlb081ibvfj9jv010nz431qji"))
+              (modules '((guix build utils)))
+              ;; We remove the non-free cider and build without it
+              (snippet
+               '(begin
+                  (delete-file-recursively "src/ciderlib")
+                  (delete-file "src/ciderinit")
+                  (substitute* "configure"
+                    (("src/ciderlib/Makefile") "")
+                    (("src/ciderlib/input/Makefile") "")
+                    (("src/ciderlib/support/Makefile") "")
+                    (("src/ciderlib/oned/Makefile") "")
+                    (("src/ciderlib/twod/Makefile") ""))))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f
+       ; no tests for libngspice
+       ; transient tests for ngspice fail
+       #:phases %standard-phases
+       #:configure-flags
+       (list "--enable-openmp"
+             "--enable-xspice"
+             "--with-ngshared"
+             "--with-readline=yes")))
+    (native-inputs
+     `(("bison" ,bison)
+       ("flex" ,flex)))
+    (inputs
+     `(("libxaw" ,libxaw)
+       ("mpi" ,openmpi)
+       ("readline" ,readline)))
+    (home-page "http://ngspice.sourceforge.net/";)
+    (synopsis "Mixed-level/mixed-signal circuit simulator")
+    (description
+     "Ngspice is a mixed-level/mixed-signal circuit simulator.  It includes
address@hidden, a circuit simulator, and @code{Xspice}, an extension that
+provides code modeling support and simulation of digital components through
+an embedded event driven algorithm.")
+    (license (list license:lgpl2.0+ ; code in frontend/numparam
+                   (license:non-copyleft "file://COPYING") ; spice3 bsd-style
+                   license:public-domain)))) ; xspice
+
+(define-public ngspice
+  (package (inherit libngspice)
+    (name "ngspice")
+    (arguments
+     `(,@(substitute-keyword-arguments (package-arguments libngspice)
+           ((#:configure-flags flags)
+            `(delete "--with-ngshared" ,flags))
+           ((#:phases phases)
+            `(alist-cons-after 'install 'in-ng
+               (lambda* (#:key inputs outputs #:allow-other-keys)
+                 (map (lambda (lib)
+                        (copy-file
+                         (string-append (assoc-ref inputs "libngspice")
+                                        "/lib/" lib)
+                         (string-append (assoc-ref outputs "out")
+                                        "/lib/" lib)))
+                      '("libngspice.so.0" "libngspice.so"))
+                 #t)
+               ,phases)))))
+    (inputs `(("libngspice" ,libngspice)
+              ,@(package-inputs libngspice)))))
-- 
2.13.1






reply via email to

[Prev in Thread] Current Thread [Next in Thread]