Merge pull request #200145 from hzeller/20221107-update-surelog-uhdm-plugin

Fix for darwin build.
This commit is contained in:
Artturi 2022-11-09 02:09:35 +02:00 committed by GitHub
commit 3e2445be79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 49 additions and 15 deletions

View file

@ -7,20 +7,33 @@
, libuuid
, openjdk11
, gperftools
, flatbuffers
, fetchpatch
}:
stdenv.mkDerivation rec {
pname = "surelog";
version = "1.40";
version = "1.45";
src = fetchFromGitHub {
owner = "chipsalliance";
repo = pname;
rev = "v${version}";
hash = "sha256-5nhJilFIJJDCnJUEUgyPNtWSQUgWcvM6LDFgFatAl/k=";
hash = "sha256-/SSKcEIhmWDOKN4v3djWTwZ5/nQvR8ibflzSVFDt/rM=";
fetchSubmodules = true;
};
# 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";
})
];
nativeBuildInputs = [
cmake
pkg-config
@ -34,6 +47,11 @@ stdenv.mkDerivation rec {
buildInputs = [
libuuid
gperftools
flatbuffers
];
cmakeFlags = [
"-DSURELOG_USE_HOST_FLATBUFFERS=On"
];
doCheck = true;

View file

@ -3,26 +3,46 @@
, fetchFromGitHub
, cmake
, python3
, gtest
, fetchpatch
}:
stdenv.mkDerivation rec {
pname = "UHDM";
version = "0.9.1.40";
version = "1.45";
src = fetchFromGitHub {
owner = "chipsalliance";
repo = pname;
rev = "v${version}";
hash = "sha256-CliKU2WM8B9012aDcS/mTyIf+JcsVsc4uRRi9+FRWbM=";
hash = "sha256-mxQRmI8yUUrSUYa4kUT9URgfqYvuz3V9e1IGjtiHyhc=";
fetchSubmodules = true;
};
# Add ability to use local googletest provided from nix instead of
# the version from the submodule in third_party/. The third_party/ version
# is slightly older and does not work with our hydra Darwin builds that needs
# to set a particular temp directory.
# This patch allows to choose UHDM_USE_HOST_GTEST=On in the cflags.
patches = [
(fetchpatch {
url = "https://github.com/chipsalliance/UHDM/commit/ad60fdb65a7c49fdc8ee3fffdca791f9364af4f5.patch";
sha256 = "sha256-IkwnepWWmBychJ0mu+kaddUEc9jkldIRq+GyJkhrO8A=";
name = "allow-local-gtest.patch";
})
];
nativeBuildInputs = [
cmake
];
buildInputs = [
(python3.withPackages (p: with p; [ orderedmultidict ]))
gtest
];
cmakeFlags = [
"-DUHDM_USE_HOST_GTEST=On"
];
doCheck = true;
@ -33,12 +53,6 @@ stdenv.mkDerivation rec {
rm -rf $out/lib/uhdm
'';
prePatch = ''
substituteInPlace CMakeLists.txt --replace \
'capnp compile' \
'capnp compile --src-prefix=''${GENDIR}/..'
'';
meta = {
description = "Universal Hardware Data Model";
homepage = "https://github.com/chipsalliance/UHDM";

View file

@ -9,16 +9,17 @@
, yosys-symbiflow
, uhdm
, surelog
, flatbuffers
}: let
src = fetchFromGitHub {
owner = "chipsalliance";
repo = "yosys-f4pga-plugins";
rev = "27208ce08200a5e89e3bd4f466bc68824df38c32";
hash = "sha256-S7txjzlIp+idWIfp/DDOznluA3aMFfosMUt5dvi+g44=";
rev = "e23ff6db487da9ceea576c53ac33853566c3a84e";
hash = "sha256-HJ4br6lQwRrcnkLgV3aecr3T3zcPzA11MfxhRjwIb0I=";
};
version = "2022.09.27";
version = "2022.11.07";
# Supported symbiflow plugins.
#
@ -60,6 +61,7 @@ in lib.genAttrs plugins (plugin: stdenv.mkDerivation (rec {
patches = lib.optional ( plugin == "ql-qlf" ) ./symbiflow-pmgen.patch;
preBuild = ''
export LDFLAGS="-L${flatbuffers}/lib"
mkdir -p ql-qlf-plugin/pmgen
''
+ lib.optionalString ( plugin == "ql-qlf" ) ''
@ -68,8 +70,8 @@ in lib.genAttrs plugins (plugin: stdenv.mkDerivation (rec {
# Providing a symlink avoids the need for patching the test makefile
postUnpack = ''
mkdir -p source/third_party/googletest/googletest/build/
ln -s ${static_gtest}/lib source/third_party/googletest/googletest/build/lib
mkdir -p source/third_party/googletest/build/
ln -s ${static_gtest}/lib source/third_party/googletest/build/lib
'';
makeFlags = [