summary refs log tree commit diff
diff options
context:
space:
mode:
authorLars Jellema <lars.jellema@gmail.com>2019-06-02 23:40:01 +0200
committerMilan <me@pbb.lc>2020-04-20 14:41:22 +0200
commitb674acee6ef4e24dd14f7dc63b380b94c4ccd19d (patch)
tree5fd07bbf331157784d21b1cd7f6cb56a079f8da6
parent8e795835106519f48b106232978b2c46952d61d9 (diff)
downloadnixpkgs-b674acee6ef4e24dd14f7dc63b380b94c4ccd19d.tar
nixpkgs-b674acee6ef4e24dd14f7dc63b380b94c4ccd19d.tar.gz
nixpkgs-b674acee6ef4e24dd14f7dc63b380b94c4ccd19d.tar.bz2
nixpkgs-b674acee6ef4e24dd14f7dc63b380b94c4ccd19d.tar.lz
nixpkgs-b674acee6ef4e24dd14f7dc63b380b94c4ccd19d.tar.xz
nixpkgs-b674acee6ef4e24dd14f7dc63b380b94c4ccd19d.tar.zst
nixpkgs-b674acee6ef4e24dd14f7dc63b380b94c4ccd19d.zip
ghdl: init at 0.37
-rw-r--r--pkgs/development/compilers/ghdl/default.nix40
-rw-r--r--pkgs/top-level/all-packages.nix10
2 files changed, 50 insertions, 0 deletions
diff --git a/pkgs/development/compilers/ghdl/default.nix b/pkgs/development/compilers/ghdl/default.nix
new file mode 100644
index 00000000000..6d1fae33734
--- /dev/null
+++ b/pkgs/development/compilers/ghdl/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchFromGitHub, gnat, zlib, llvm, lib
+, backend ? "mcode" }:
+
+assert backend == "mcode" || backend == "llvm";
+
+stdenv.mkDerivation rec {
+  pname = "ghdl-${backend}";
+  version = "0.37";
+
+  src = fetchFromGitHub {
+    owner = "ghdl";
+    repo = "ghdl";
+    rev = "v${version}";
+    sha256 = "0b53yl4im33c1cd4mdyc4ks9cmrpixym17gzchfmplrl22w3l17y";
+  };
+
+  LIBRARY_PATH = "${stdenv.cc.libc}/lib";
+
+  buildInputs = [ gnat zlib ];
+
+  preConfigure = ''
+    # If llvm 7.0 works, 7.x releases should work too.
+    sed -i 's/check_version 7.0/check_version 7/g' configure
+  '';
+
+  configureFlags = lib.optional (backend == "llvm")
+    "--with-llvm-config=${llvm}/bin/llvm-config";
+
+  hardeningDisable = [ "format" ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/ghdl/ghdl";
+    description = "VHDL 2008/93/87 simulator";
+    maintainers = with maintainers; [ lucus16 ];
+    platforms = platforms.linux;
+    license = licenses.gpl2;
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index a869ce066bf..e2c0391d0a3 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -8429,6 +8429,16 @@ in
     profiledCompiler = false;
   });
 
+  ghdl = ghdl-mcode;
+
+  ghdl-mcode = callPackage ../development/compilers/ghdl {
+    backend = "mcode";
+  };
+
+  ghdl-llvm = callPackage ../development/compilers/ghdl {
+    backend = "llvm";
+  };
+
   gcl = callPackage ../development/compilers/gcl {
     gmp = gmp4;
   };