Merge pull request #256087 from raboof/gnucap-update

gnucap: update to 20240130-dev and add gnucap-modelgen-verilog
This commit is contained in:
Arnout Engelen 2024-02-20 23:43:07 +01:00 committed by GitHub
commit 8b1ad909bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 102 additions and 12 deletions

View File

@ -1,16 +1,15 @@
{ lib, stdenv, fetchurl }:
stdenv.mkDerivation rec {
pname = "gnucap";
version = "20210107";
src = fetchurl {
url = "https://git.savannah.gnu.org/cgit/gnucap.git/snapshot/${pname}-${version}.tar.gz";
sha256 = "12rlwd4mfc54qq1wrx5k8qk578xls5z4isf94ybkf2z6qxk4mhnj";
};
doCheck = true;
{ lib
, stdenv
, fetchurl
, readline
, termcap
, gnucap
, callPackage
, writeScript
}:
let
version = "20240130-dev";
meta = with lib; {
description = "Gnu Circuit Analysis Package";
longDescription = ''
@ -23,5 +22,52 @@ It performs nonlinear dc and transient analyses, fourier analysis, and ac analys
platforms = platforms.all;
broken = stdenv.isDarwin; # Relies on LD_LIBRARY_PATH
maintainers = [ maintainers.raboof ];
mainProgram = "gnucap";
};
in
stdenv.mkDerivation rec {
pname = "gnucap";
inherit version;
src = fetchurl {
url = "https://git.savannah.gnu.org/cgit/gnucap.git/snapshot/${pname}-${version}.tar.gz";
hash = "sha256-MUCtGw3BxGWgXgUwzklq5T1y9kjBTnFBa0/GK0hhl0E=";
};
buildInputs = [
readline
termcap
];
doCheck = true;
inherit meta;
} // {
plugins = callPackage ./plugins.nix {};
withPlugins = p:
let
selectedPlugins = p gnucap.plugins;
wrapper = writeScript "gnucap" ''
export GNUCAP_PLUGPATH=${gnucap}/lib/gnucap
for plugin in ${builtins.concatStringsSep " " selectedPlugins}; do
export GNUCAP_PLUGPATH=$plugin/lib/gnucap:$GNUCAP_PLUGPATH
done
${lib.getExe gnucap}
'';
in
stdenv.mkDerivation {
pname = "gnucap-with-plugins";
inherit version;
propagatedBuildInputs = selectedPlugins;
phases = [ "installPhase" "fixupPhase" ];
installPhase = ''
mkdir -p $out/bin
cp ${wrapper} $out/bin/gnucap
'';
inherit meta;
};
}

View File

@ -0,0 +1,37 @@
{ lib
, stdenv
, fetchurl
, gnucap
}:
stdenv.mkDerivation rec {
pname = "gnucap-modelgen-verilog";
version = "20240130-dev";
src = fetchurl {
url = "https://git.savannah.gnu.org/cgit/gnucap/gnucap-modelgen-verilog.git/snapshot/${pname}-${version}.tar.gz";
hash = "sha256-7w0eWUJKVRYFicQgDvKrJTkZ6fzgwxvcCKj78KrHj8E=";
};
propagatedBuildInputs = [ gnucap ];
doCheck = true;
preInstall = ''
export GNUCAP_EXEC_PREFIX=$out
export GNUCAP_DATA=$out/share/gnucap
mkdir -p $out/include/gnucap
export GNUCAP_INCLUDEDIR=$out/include/gnucap
export GNUCAP_PKGLIBDIR=$out/lib/gnucap
'';
meta = with lib; {
description = "gnucap modelgen to preprocess, parse and dump vams files.";
homepage = "http://www.gnucap.org/";
changelog = "https://git.savannah.gnu.org/cgit/gnucap.git/plain/NEWS?h=v${version}";
mainProgram = "gnucap-mg-vams";
license = licenses.gpl3Plus;
platforms = platforms.all;
maintainers = [ maintainers.raboof ];
};
}

View File

@ -0,0 +1,6 @@
{ callPackage
}:
{
verilog = callPackage ./modelgen-verilog.nix {};
}

View File

@ -8642,6 +8642,7 @@ with pkgs;
};
gnucap = callPackage ../applications/science/electronics/gnucap { };
gnucap-full = gnucap.withPlugins(p: [ p.verilog ]);
gnu-cim = callPackage ../development/compilers/gnu-cim { };