2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2020-09-25 04:45:31 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, bison
|
|
|
|
, flex
|
|
|
|
, verilog
|
2021-08-08 23:34:03 +00:00
|
|
|
, which
|
2020-09-25 04:45:31 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "vhd2vl";
|
|
|
|
version = "unstable-2018-09-01";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ldoolitt";
|
|
|
|
repo = pname;
|
|
|
|
rev = "37e3143395ce4e7d2f2e301e12a538caf52b983c";
|
|
|
|
sha256 = "17va2pil4938j8c93anhy45zzgnvq3k71a7glj02synfrsv6fs8n";
|
|
|
|
};
|
|
|
|
|
2021-01-17 00:15:33 +00:00
|
|
|
patches = lib.optionals (!stdenv.isAarch64) [
|
2022-05-18 14:49:53 +00:00
|
|
|
# fix build with verilog 11.0
|
|
|
|
./test.patch
|
2020-11-19 00:13:47 +00:00
|
|
|
];
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
bison
|
|
|
|
flex
|
2021-08-08 23:34:03 +00:00
|
|
|
which
|
2020-09-25 04:45:31 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
verilog
|
|
|
|
];
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
# the "translate" target both (a) builds the software and (b) runs
|
|
|
|
# the tests (without validating the results)
|
|
|
|
buildTargets = [ "translate" ];
|
|
|
|
|
|
|
|
# the "diff" target examines the test results
|
|
|
|
checkTarget = "diff";
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
installPhase = ''
|
2021-08-08 23:34:03 +00:00
|
|
|
runHook preInstall
|
|
|
|
install -D -m755 src/vhd2vl $out/bin/vdh2vl
|
|
|
|
runHook postInstall
|
2020-09-25 04:45:31 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-09-25 04:45:31 +00:00
|
|
|
description = "VHDL to Verilog converter";
|
|
|
|
homepage = "https://github.com/ldoolitt/vhd2vl";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = with maintainers; [ matthuszagh ];
|
|
|
|
};
|
|
|
|
}
|