fork
Configure Feed
Select the types of activity you want to include in your feed.
nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
fork
Configure Feed
Select the types of activity you want to include in your feed.
1{ stdenv, fetchFromGitHub, fetchpatch, callPackage, gnat, zlib, llvm, lib
2, backend ? "mcode" }:
3
4assert backend == "mcode" || backend == "llvm";
5
6stdenv.mkDerivation rec {
7 pname = "ghdl-${backend}";
8 version = "1.0.0";
9
10 src = fetchFromGitHub {
11 owner = "ghdl";
12 repo = "ghdl";
13 rev = "v${version}";
14 sha256 = "1gyh0xckwbzgslbpw9yrpj4gqs9fm1a2qpbzl0sh143fk1kwjlly";
15 };
16
17 patches = [
18 # Allow compilation with GNAT 11, picked from master
19 (fetchpatch {
20 name = "fix-gnat-11-compilation.patch";
21 url = "https://github.com/ghdl/ghdl/commit/8356ea3bb4e8d0e5ad8638c3d50914b64fc360ec.patch";
22 sha256 = "04pzn8g7xha8000wbjjmry6h1grfqyn3bjvj47hi4qwgl21wfjra";
23 })
24 ];
25
26 LIBRARY_PATH = "${stdenv.cc.libc}/lib";
27
28 buildInputs = [ gnat zlib ] ++ lib.optional (backend == "llvm") [ llvm ];
29 propagatedBuildInputs = lib.optionals (backend == "llvm") [ zlib ];
30
31 preConfigure = ''
32 # If llvm 7.0 works, 7.x releases should work too.
33 sed -i 's/check_version 7.0/check_version 7/g' configure
34 '';
35
36 configureFlags = [ "--enable-synth" ] ++ lib.optional (backend == "llvm")
37 "--with-llvm-config=${llvm.dev}/bin/llvm-config";
38
39 hardeningDisable = [ "format" ];
40
41 enableParallelBuilding = true;
42
43 passthru = {
44 # run with either of
45 # nix-build -A ghdl-mcode.passthru.tests
46 # nix-build -A ghdl-llvm.passthru.tests
47 tests = {
48 simple = callPackage ./test-simple.nix { inherit backend; };
49 };
50 };
51
52 meta = with lib; {
53 homepage = "https://github.com/ghdl/ghdl";
54 description = "VHDL 2008/93/87 simulator";
55 maintainers = with maintainers; [ lucus16 thoughtpolice ];
56 platforms = platforms.linux;
57 license = licenses.gpl2;
58 };
59}