From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZGlq-00036p-0f for guix-patches@gnu.org; Sun, 23 Jul 2017 09:18:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dZGlm-0002hD-PE for guix-patches@gnu.org; Sun, 23 Jul 2017 09:18:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:50283) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dZGlm-0002h0-Kb for guix-patches@gnu.org; Sun, 23 Jul 2017 09:18:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dZGlm-0003M9-48 for guix-patches@gnu.org; Sun, 23 Jul 2017 09:18:02 -0400 Subject: [bug#27344] [PATCH v2 08/12] gnu: Add ngspice. Resent-Message-ID: Date: Sun, 23 Jul 2017 15:16:46 +0200 From: Danny Milosavljevic Message-ID: <20170723151646.013b6408@scratchpost.org> In-Reply-To: <20170723133712.2239b7d9@scratchpost.org> References: <20170622191005.25422-1-theodoros.for@openmailbox.org> <20170622191005.25422-8-theodoros.for@openmailbox.org> <20170723133712.2239b7d9@scratchpost.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Theodoros Foradis Cc: 27344@debbugs.gnu.org My current version of your patch is below. After it, the following duplicates remain: * ./bin/cmpp * ./lib/ngspice/analog.cm * ./lib/ngspice/digital.cm * ./lib/ngspice/spice2poly.cm * ./lib/ngspice/xtradev.cm * ./lib/ngspice/xtraevt.cm * ./share/ngspice/dlmain.c * ./share/ngspice/scripts/setplot * ./share/ngspice/scripts/spectrum * ./share/ngspice/scripts/spinit Also, how can other programs find libngspice? There's no pkg-config file and also no replacement (a la gtk-config) that I can see. cmpp seems to be a preprocessor for xspice extensions - should it be part of ngspice or libngspice ? Is libngspice useful without cmpp being there ? diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index 650ac2b89..2687b5758 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -59,6 +59,7 @@ #:use-module (gnu packages linux) ;FIXME: for pcb #:use-module (gnu packages m4) #:use-module (gnu packages maths) + #:use-module (gnu packages mpi) #:use-module (gnu packages ncurses) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) @@ -1013,3 +1014,87 @@ specified in high-level description language into ready-to-compile C code for the API of spice simulators. Based on transformations specified in XML language, ADMS transforms Verilog-AMS code into other target languages.") (license license:gpl3))) + +(define-public 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 + `(;; No tests for libngspice exist. + ;; The transient tests for ngspice fail. + #:tests? #f + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-timestamps + (lambda _ + (substitute* "configure" + (("`date`") "Do 1. Jan 00:00:00 UTC 1970")) + #t)) + (add-after 'unpack 'delete-program-manuals + (lambda _ + (substitute* "man/man1/Makefile.in" + (("^man_MANS = ngspice\\.1 ngnutmeg\\.1 ngsconvert\\.1 ngmultidec\\.1") + "man_MANS = ")) + #t))) + #: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 +@code{Spice3f5}, 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) + `(modify-phases ,phases + (add-after 'unpack 'delete-include-files + (lambda _ + (substitute* "src/Makefile.in" + (("^SUBDIRS = misc maths frontend spicelib include/ngspice") + "SUBDIRS = misc maths frontend spicelib")) + #t)) + (delete 'delete-program-manuals))))) + (inputs + `(("libngspice" ,libngspice) + ("readline" ,readline)))))