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