yosys: use finalAttrs

This commit is contained in:
Luflosi 2023-11-08 14:39:42 +01:00
parent 9882bdee1e
commit e947b23190
No known key found for this signature in database
GPG key ID: 4E41E29EDCC345D0

View file

@ -69,14 +69,14 @@ let
} // (yosys-symbiflow);
in stdenv.mkDerivation rec {
in stdenv.mkDerivation (finalAttrs: {
pname = "yosys";
version = "0.34";
src = fetchFromGitHub {
owner = "YosysHQ";
repo = "yosys";
rev = "refs/tags/${pname}-${version}";
rev = "refs/tags/${finalAttrs.pname}-${finalAttrs.version}";
hash = "sha256-GHDsMBj7DRb9ffESgzd1HzDAA6Cyft5PomidvIMzn9g=";
};
@ -101,7 +101,7 @@ in stdenv.mkDerivation rec {
postPatch = ''
substituteInPlace ./Makefile \
--replace 'echo UNKNOWN' 'echo ${builtins.substring 0 10 src.rev}'
--replace 'echo UNKNOWN' 'echo ${builtins.substring 0 10 finalAttrs.src.rev}'
chmod +x ./misc/yosys-config.in
patchShebangs tests ./misc/yosys-config.in
@ -120,7 +120,7 @@ in stdenv.mkDerivation rec {
fi
if ! grep -q "YOSYS_VER := $version" Makefile; then
echo "ERROR: yosys version in Makefile isn't equivalent to version of the nix package (allegedly ${version}), failing."
echo "ERROR: yosys version in Makefile isn't equivalent to version of the nix package (allegedly ${finalAttrs.version}), failing."
exit 1
fi
'';
@ -152,4 +152,4 @@ in stdenv.mkDerivation rec {
platforms = platforms.all;
maintainers = with maintainers; [ shell thoughtpolice emily Luflosi ];
};
}
})