uhdm: 0.9.1.40 -> 1.45

Update UHDM and also fix for Darwin build.
The gtest version used in the project unconditionally uses
/tmp as temporary directory in Darwin and does not honor the
environment variables introduced in gtest 1.12.
Use that gtest version so that it will work in the Hydra
build environment.

Related: #199919 as this is fixing the Darwin build.

Signed-off-by: Henner Zeller <h.zeller@acm.org>
This commit is contained in:
Henner Zeller 2022-11-07 21:16:38 -08:00
parent 295778ad21
commit 568398e338

View file

@ -3,26 +3,46 @@
, fetchFromGitHub , fetchFromGitHub
, cmake , cmake
, python3 , python3
, gtest
, fetchpatch
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "UHDM"; pname = "UHDM";
version = "0.9.1.40"; version = "1.45";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "chipsalliance"; owner = "chipsalliance";
repo = pname; repo = pname;
rev = "v${version}"; rev = "v${version}";
hash = "sha256-CliKU2WM8B9012aDcS/mTyIf+JcsVsc4uRRi9+FRWbM="; hash = "sha256-mxQRmI8yUUrSUYa4kUT9URgfqYvuz3V9e1IGjtiHyhc=";
fetchSubmodules = true; 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 = [ nativeBuildInputs = [
cmake cmake
]; ];
buildInputs = [ buildInputs = [
(python3.withPackages (p: with p; [ orderedmultidict ])) (python3.withPackages (p: with p; [ orderedmultidict ]))
gtest
];
cmakeFlags = [
"-DUHDM_USE_HOST_GTEST=On"
]; ];
doCheck = true; doCheck = true;
@ -33,12 +53,6 @@ stdenv.mkDerivation rec {
rm -rf $out/lib/uhdm rm -rf $out/lib/uhdm
''; '';
prePatch = ''
substituteInPlace CMakeLists.txt --replace \
'capnp compile' \
'capnp compile --src-prefix=''${GENDIR}/..'
'';
meta = { meta = {
description = "Universal Hardware Data Model"; description = "Universal Hardware Data Model";
homepage = "https://github.com/chipsalliance/UHDM"; homepage = "https://github.com/chipsalliance/UHDM";