2019-06-02 21:40:01 +00:00
|
|
|
{ stdenv, fetchFromGitHub, gnat, zlib, llvm, lib
|
|
|
|
, backend ? "mcode" }:
|
|
|
|
|
|
|
|
assert backend == "mcode" || backend == "llvm";
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ghdl-${backend}";
|
2021-01-15 05:52:23 +00:00
|
|
|
# NOTE(aseipp): move to 0.38 when it comes out, since it should support a stable
|
|
|
|
# version of the yosys plugin
|
|
|
|
version = "unstable-2021.01.14";
|
2019-06-02 21:40:01 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-01-15 05:52:23 +00:00
|
|
|
owner = "ghdl";
|
|
|
|
repo = "ghdl";
|
|
|
|
rev = "4868294436574660552ccef50a5b0849559393de";
|
|
|
|
sha256 = "1wqjf0qc66dam1n2mskmlvj53bcsdwwk5rq9gimq6ah1vcwi222p";
|
2019-06-02 21:40:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
LIBRARY_PATH = "${stdenv.cc.libc}/lib";
|
|
|
|
|
|
|
|
buildInputs = [ gnat zlib ];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
# If llvm 7.0 works, 7.x releases should work too.
|
|
|
|
sed -i 's/check_version 7.0/check_version 7/g' configure
|
|
|
|
'';
|
|
|
|
|
2021-01-15 05:52:23 +00:00
|
|
|
configureFlags = [ "--enable-synth" ] ++ lib.optional (backend == "llvm")
|
2019-06-02 21:40:01 +00:00
|
|
|
"--with-llvm-config=${llvm}/bin/llvm-config";
|
|
|
|
|
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/ghdl/ghdl";
|
|
|
|
description = "VHDL 2008/93/87 simulator";
|
2021-01-15 05:52:23 +00:00
|
|
|
maintainers = with maintainers; [ lucus16 thoughtpolice ];
|
2019-06-02 21:40:01 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.gpl2;
|
|
|
|
};
|
|
|
|
}
|