mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-22 14:45:27 +00:00
Merge #18566: ghdl: add support for llvm backend
This commit is contained in:
commit
9eb91323bd
|
@ -1,16 +1,28 @@
|
|||
{ stdenv, fetchurl, gnat, zlib }:
|
||||
{ stdenv, fetchFromGitHub, gnat, zlib, llvm_35, ncurses, clang, flavour ? "mcode" }:
|
||||
|
||||
# mcode only works on x86, while the llvm flavour works on both x86 and x86_64.
|
||||
|
||||
|
||||
assert flavour == "llvm" || flavour == "mcode";
|
||||
|
||||
let
|
||||
inherit (stdenv.lib) optional;
|
||||
inherit (stdenv.lib) optionals;
|
||||
version = "0.33";
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
name = "ghdl-mcode-${version}";
|
||||
name = "ghdl-${flavour}-${version}";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/tgingold/ghdl/archive/v${version}.tar.gz";
|
||||
sha256 = "09yvgqyglbakd74v2dgr470clzm744i232nixyffcds55vkij5da";
|
||||
src = fetchFromGitHub {
|
||||
owner = "tgingold";
|
||||
repo = "ghdl";
|
||||
rev = "v${version}";
|
||||
sha256 = "0g72rk2yzr0lrpncq2c1qcv71w3mi2hjq84r1yzgjr6d0qm87r2a";
|
||||
};
|
||||
|
||||
buildInputs = [ gnat zlib ];
|
||||
buildInputs = [ gnat zlib ] ++ optionals (flavour == "llvm") [ clang ncurses ];
|
||||
|
||||
configureFlags = optional (flavour == "llvm") "--with-llvm=${llvm_35}";
|
||||
|
||||
patchPhase = ''
|
||||
# Disable warnings-as-errors, because there are warnings (unused things)
|
||||
|
@ -23,11 +35,10 @@ stdenv.mkDerivation rec {
|
|||
|
||||
meta = {
|
||||
homepage = "http://sourceforge.net/p/ghdl-updates/wiki/Home/";
|
||||
description = "Free VHDL simulator, mcode flavour";
|
||||
description = "Free VHDL simulator";
|
||||
maintainers = with stdenv.lib.maintainers; [viric];
|
||||
# I think that mcode can only generate x86 code,
|
||||
# so it fails to link pieces on x86_64.
|
||||
platforms = with stdenv.lib.platforms; [ "i686-linux" ];
|
||||
platforms = with stdenv.lib.platforms; (if flavour == "llvm" then [ "i686-linux" "x86_64-linux" ]
|
||||
else [ "i686-linux" ]);
|
||||
license = stdenv.lib.licenses.gpl2Plus;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -4717,7 +4717,13 @@ in
|
|||
profiledCompiler = false;
|
||||
});
|
||||
|
||||
ghdl_mcode = callPackage_i686 ../development/compilers/ghdl { };
|
||||
ghdl_mcode = callPackage_i686 ../development/compilers/ghdl {
|
||||
flavour = "mcode";
|
||||
};
|
||||
|
||||
ghdl_llvm = callPackage ../development/compilers/ghdl {
|
||||
flavour = "llvm";
|
||||
};
|
||||
|
||||
gcl = callPackage ../development/compilers/gcl {
|
||||
gmp = gmp4;
|
||||
|
|
Loading…
Reference in a new issue