Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verilog: cleanup & test #97613

Merged
merged 2 commits into from
Sep 25, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 33 additions & 7 deletions pkgs/applications/science/electronics/verilog/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
{ stdenv, fetchFromGitHub, autoconf, gperf, flex, bison, readline, ncurses
, bzip2, zlib
# Test inputs
, perl
}:

let
iverilog-test = fetchFromGitHub {
owner = "steveicarus";
repo = "ivtest";
rev = "6882cb8ec08926c4e356c6092f0c5f8c23328d5c";
sha256 = "04sj5nqzwls1y760kgnd9c2whkcrr8kvj9lisd5rvk0w580kjb2x";
};
in
stdenv.mkDerivation rec {
pname = "iverilog";
version = "unstable-2020-08-24";
Expand All @@ -15,11 +25,6 @@ stdenv.mkDerivation rec {

enableParallelBuilding = true;
drewrisinger marked this conversation as resolved.
Show resolved Hide resolved

prePatch = ''
substituteInPlace configure.in \
--replace "AC_CHECK_LIB(termcap, tputs)" "AC_CHECK_LIB(termcap, tputs)"
'';

preConfigure = ''
chmod +x $PWD/autoconf.sh
$PWD/autoconf.sh
Expand All @@ -29,11 +34,32 @@ stdenv.mkDerivation rec {

buildInputs = [ readline ncurses bzip2 zlib ];

# tests from .travis.yml
doCheck = true; # runs ``make check``
# most tests pass, but some that rely on exact text of floating-point numbers fail on aarch64.
doInstallCheck = !stdenv.isAarch64;
installCheckInputs = [ perl ];

installCheckPhase = ''
# copy tests to allow writing results
export TESTDIR=$(mktemp -d)
cp -r ${iverilog-test}/* $TESTDIR

pushd $TESTDIR

# Run & check tests
PATH=$out/bin:$PATH perl vvp_reg.pl
# Check the tests, will error if unexpected tests fail. Some failures MIGHT be normal.
diff regression_report-devel.txt regression_report.txt
PATH=$out/bin:$PATH perl vpi_reg.pl

popd
'';

meta = with stdenv.lib; {
description = "Icarus Verilog compiler";
repositories.git = "https://github.com/steveicarus/iverilog.git";
homepage = "http://iverilog.icarus.com/";
license = licenses.lgpl21;
license = with licenses; [ gpl2Plus lgpl21Plus] ;
maintainers = with maintainers; [ winden ];
platforms = platforms.all;
};
Expand Down