2016-09-13 18:25:08 +01:00
|
|
|
{ stdenv, fetchFromGitHub, gnat, zlib, llvm_35, ncurses, clang, flavour ? "mcode" }:
|
2016-08-10 15:00:12 +01:00
|
|
|
|
|
|
|
# mcode only works on x86, while the llvm flavour works on both x86 and x86_64.
|
|
|
|
|
|
|
|
|
|
|
|
assert flavour == "llvm" || flavour == "mcode";
|
|
|
|
|
2014-04-16 09:33:27 +01:00
|
|
|
let
|
2016-08-10 15:00:12 +01:00
|
|
|
inherit (stdenv.lib) optional;
|
|
|
|
inherit (stdenv.lib) optionals;
|
2016-03-03 13:04:36 +00:00
|
|
|
version = "0.33";
|
2014-04-16 09:33:27 +01:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2016-08-10 15:00:12 +01:00
|
|
|
name = "ghdl-${flavour}-${version}";
|
2014-04-16 09:33:27 +01:00
|
|
|
|
2016-09-13 18:25:08 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tgingold";
|
|
|
|
repo = "ghdl";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0g72rk2yzr0lrpncq2c1qcv71w3mi2hjq84r1yzgjr6d0qm87r2a";
|
2014-04-16 09:33:27 +01:00
|
|
|
};
|
|
|
|
|
2016-08-10 15:00:12 +01:00
|
|
|
buildInputs = [ gnat zlib ] ++ optionals (flavour == "llvm") [ clang ncurses ];
|
|
|
|
|
|
|
|
configureFlags = optional (flavour == "llvm") "--with-llvm=${llvm_35}";
|
2014-04-16 09:33:27 +01:00
|
|
|
|
|
|
|
patchPhase = ''
|
2016-03-03 13:04:36 +00:00
|
|
|
# Disable warnings-as-errors, because there are warnings (unused things)
|
|
|
|
sed -i s/-gnatwae/-gnatwa/ Makefile.in ghdl.gpr.in
|
2014-04-16 09:33:27 +01:00
|
|
|
'';
|
|
|
|
|
2016-09-09 23:30:53 +01:00
|
|
|
hardeningDisable = [ "all" ];
|
|
|
|
|
2016-03-03 13:04:36 +00:00
|
|
|
enableParallelBuilding = true;
|
2014-04-16 09:33:27 +01:00
|
|
|
|
|
|
|
meta = {
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = http://sourceforge.net/p/ghdl-updates/wiki/Home/;
|
2016-08-10 15:00:12 +01:00
|
|
|
description = "Free VHDL simulator";
|
2014-04-16 09:33:27 +01:00
|
|
|
maintainers = with stdenv.lib.maintainers; [viric];
|
2016-08-10 15:00:12 +01:00
|
|
|
platforms = with stdenv.lib.platforms; (if flavour == "llvm" then [ "i686-linux" "x86_64-linux" ]
|
|
|
|
else [ "i686-linux" ]);
|
2014-06-19 05:19:00 +01:00
|
|
|
license = stdenv.lib.licenses.gpl2Plus;
|
2014-04-16 09:33:27 +01:00
|
|
|
};
|
|
|
|
}
|