verilator: wrap with glibc LOCALE_ARCHIVE iff stdenv.isLinux

Signed-off-by: Austin Seipp <aseipp@pobox.com>
This commit is contained in:
Austin Seipp 2023-04-28 02:01:08 -05:00
parent 853ab9b4bd
commit 6a086197c2

View File

@ -1,6 +1,7 @@
{ lib, stdenv, fetchFromGitHub
, perl, flex, bison, python3, autoconf
, which, cmake, help2man
, makeWrapper, glibcLocales
}:
stdenv.mkDerivation rec {
@ -16,7 +17,7 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
buildInputs = [ perl ];
nativeBuildInputs = [ flex bison python3 autoconf help2man ];
nativeBuildInputs = [ makeWrapper flex bison python3 autoconf help2man ];
nativeCheckInputs = [ which ];
doCheck = stdenv.isLinux; # darwin tests are broken for now...
@ -28,6 +29,12 @@ stdenv.mkDerivation rec {
patchShebangs bin/* src/{flexfix,vlcovgen} test_regress/{driver.pl,t/*.pl}
'';
postInstall = lib.optionalString stdenv.isLinux ''
for x in $(ls $out/bin/verilator*); do
wrapProgram "$x" --set LOCALE_ARCHIVE "${glibcLocales}/lib/locale/locale-archive"
done
'';
meta = with lib; {
description = "Fast and robust (System)Verilog simulator/compiler";
homepage = "https://www.veripool.org/wiki/verilator";