mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-03-04 22:34:04 +00:00
Make the existing ghdl recipe more flexible, and introduce "ghdl_llvm" as a package in addition to "ghdl_mcode". This seems to specifically require llvm 3.5, though. The flavour is also encoded in the package name. cc @viric
43 lines
1.2 KiB
Nix
43 lines
1.2 KiB
Nix
{ stdenv, fetchurl, 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-${flavour}-${version}";
|
|
|
|
src = fetchurl {
|
|
url = "https://github.com/tgingold/ghdl/archive/v${version}.tar.gz";
|
|
sha256 = "09yvgqyglbakd74v2dgr470clzm744i232nixyffcds55vkij5da";
|
|
};
|
|
|
|
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)
|
|
sed -i s/-gnatwae/-gnatwa/ Makefile.in ghdl.gpr.in
|
|
'';
|
|
|
|
hardeningDisable = [ "all" ];
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
meta = {
|
|
homepage = "http://sourceforge.net/p/ghdl-updates/wiki/Home/";
|
|
description = "Free VHDL simulator";
|
|
maintainers = with stdenv.lib.maintainers; [viric];
|
|
platforms = with stdenv.lib.platforms; (if flavour == "llvm" then [ "i686-linux" "x86_64-linux" ]
|
|
else [ "i686-linux" ]);
|
|
license = stdenv.lib.licenses.gpl2Plus;
|
|
};
|
|
}
|