From 3c2052bd2006e5a718df0a8e6193b72dc654012d Mon Sep 17 00:00:00 2001 From: Henner Zeller Date: Sat, 13 Jul 2024 11:31:14 -0700 Subject: [PATCH] verilator: 5.022 -> 5.026 * Properly output version with verilator --version (set VERILATOR_SRC_VERSION at compile time) * No need to wrap the binaries anymore. * Fix verilator --gdbbt --- .../science/electronics/verilator/default.nix | 28 +++++++------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/pkgs/applications/science/electronics/verilator/default.nix b/pkgs/applications/science/electronics/verilator/default.nix index 3e7ee0be98e0..c467bdfc547b 100644 --- a/pkgs/applications/science/electronics/verilator/default.nix +++ b/pkgs/applications/science/electronics/verilator/default.nix @@ -2,7 +2,6 @@ lib, stdenv, fetchFromGitHub, - fetchpatch, perl, flex, bison, @@ -17,28 +16,24 @@ systemc, git, numactl, + coreutils, }: stdenv.mkDerivation rec { pname = "verilator"; - version = "5.022"; + version = "5.026"; + + # Verilator gets the version from this environment variable + # if it can't do git describe while building. + VERILATOR_SRC_VERSION = "v${version}"; src = fetchFromGitHub { owner = pname; repo = pname; rev = "v${version}"; - hash = "sha256-Ya3lqK8BfvMVLZUrD2Et6OmptteWXp5VmZb2x2G/V/E="; + hash = "sha256-Ds6w95tqlKjIFnkq2kKyslprKCwMOtBOoy7LuTon3KM="; }; - patches = [ - (fetchpatch { - # Fix try-lock spuriously fail in V3ThreadPool destructor - # https://github.com/verilator/verilator/pull/4938 - url = "https://github.com/verilator/verilator/commit/4b9cce4369c78423779238e585ed693c456d464e.patch"; - hash = "sha256-sGrk/pxqZqUcmJdzQoPlzXMmYqHCOmd9Y2n6ieVNg1U="; - }) - ]; - enableParallelBuilding = true; buildInputs = [ perl @@ -57,6 +52,7 @@ stdenv.mkDerivation rec { nativeCheckInputs = [ which numactl + coreutils # cmake ]; @@ -69,16 +65,12 @@ stdenv.mkDerivation rec { patchShebangs bin/* src/* nodist/* docs/bin/* examples/xml_py/* \ test_regress/{driver.pl,t/*.{pl,pf}} \ ci/* ci/docker/run/* ci/docker/run/hooks/* ci/docker/buildenv/build.sh + # verilator --gdbbt uses /bin/echo to test if gdb works. + sed -i 's|/bin/echo|${coreutils}\/bin\/echo|' bin/verilator ''; # grep '^#!/' -R . | grep -v /nix/store | less # (in nix-shell after patchPhase) - postInstall = lib.optionalString stdenv.isLinux '' - for x in $(ls $out/bin/verilator*); do - wrapProgram "$x" --set LOCALE_ARCHIVE "${glibcLocales}/lib/locale/locale-archive" - done - ''; - env = { SYSTEMC_INCLUDE = "${lib.getDev systemc}/include"; SYSTEMC_LIBDIR = "${lib.getLib systemc}/lib";