2022-11-04 12:27:35 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, python3
|
|
|
|
, pkg-config
|
|
|
|
, libuuid
|
2022-11-27 09:42:12 +00:00
|
|
|
, openjdk
|
2022-11-04 12:27:35 +00:00
|
|
|
, gperftools
|
2022-11-21 17:40:18 +00:00
|
|
|
, flatbuffers
|
|
|
|
, fetchpatch
|
2022-11-04 12:27:35 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "surelog";
|
2022-11-21 17:40:18 +00:00
|
|
|
version = "1.45";
|
2022-11-04 12:27:35 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "chipsalliance";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-11-21 17:40:18 +00:00
|
|
|
hash = "sha256-/SSKcEIhmWDOKN4v3djWTwZ5/nQvR8ibflzSVFDt/rM=";
|
2022-11-04 12:27:35 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
# This prevents race conditions in unit tests that surface since we run
|
|
|
|
# ctest in parallel.
|
|
|
|
# This patch can be removed with the next version of surelog
|
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/chipsalliance/Surelog/commit/9a54efbd156becf65311a4272104810f36041fa6.patch";
|
|
|
|
sha256 = "sha256-rU1Z/0wlVTgnPLqTN/87n+gI1iJ+6k/+sunVVd0ulhQ=";
|
|
|
|
name = "parallel-test-running.patch";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
2022-11-27 09:42:12 +00:00
|
|
|
openjdk
|
2022-11-04 12:27:35 +00:00
|
|
|
(python3.withPackages (p: with p; [
|
|
|
|
psutil
|
|
|
|
orderedmultidict
|
|
|
|
]))
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libuuid
|
|
|
|
gperftools
|
2022-11-21 17:40:18 +00:00
|
|
|
flatbuffers
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DSURELOG_USE_HOST_FLATBUFFERS=On"
|
2022-11-04 12:27:35 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
make -j $NIX_BUILD_CORES UnitTests
|
|
|
|
ctest --output-on-failure
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mv $out/lib/surelog/* $out/lib/
|
|
|
|
mv $out/lib/pkg $out/lib/surelog/
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "SystemVerilog 2017 Pre-processor, Parser, Elaborator, UHDM Compiler";
|
|
|
|
homepage = "https://github.com/chipsalliance/Surelog";
|
|
|
|
license = lib.licenses.asl20;
|
|
|
|
maintainers = with lib.maintainers; [ matthuszagh ];
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|