From b9fd4b6b279bd10846ea10f9046550dd92f1726b Mon Sep 17 00:00:00 2001 From: jnozsc <470215+jnozsc@users.noreply.github.com> Date: Fri, 15 May 2020 13:07:31 -0700 Subject: [PATCH] nvc: use llvm as runtime dependency --- Formula/nvc.rb | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/Formula/nvc.rb b/Formula/nvc.rb index 2ee07be3c6a58..fec921acf2c8e 100644 --- a/Formula/nvc.rb +++ b/Formula/nvc.rb @@ -1,8 +1,20 @@ class Nvc < Formula desc "VHDL compiler and simulator" homepage "https://github.com/nickg/nvc" - url "https://github.com/nickg/nvc/releases/download/r1.4.0/nvc-1.4.0.tar.gz" - sha256 "1a874bde284408c137a93b22f8f12b5b8c3368cefe30f3a5458ccdeffa0c6ad6" + revision 1 + + stable do + url "https://github.com/nickg/nvc/releases/download/r1.4.0/nvc-1.4.0.tar.gz" + sha256 "1a874bde284408c137a93b22f8f12b5b8c3368cefe30f3a5458ccdeffa0c6ad6" + # Upstream issue, only fix on master branch + # at the end of installation, nvc tries to donwload from IEEE, + # however the IEEE website changes the download path + # this patch fixes this issue + patch do + url "https://github.com/nickg/nvc/commit/db4565c33f7effcab4c8b886d664398a85b653f6.patch?full_index=1" + sha256 "41a7de8c78730cbf674246abdc3e824ba26723db963536cb019ed9deb77dc0a3" + end + end bottle do sha256 "b80db7d1bf860cf294e21504ca5016949379eb09f5e91f2ada221f7c93e0a470" => :mojave @@ -19,8 +31,10 @@ class Nvc < Formula end depends_on "check" => :build - depends_on "llvm" => :build depends_on "pkg-config" => :build + # llvm 8+ is not supported https://github.com/nickg/nvc/commit/c3d1ae5700cfba6070293ad1bb5a6c198c631195 + # and llvm 7 has issue on stable https://github.com/nickg/nvc/commit/dfd5606a182e00d5f7a9e28902234b374c7b2863 + depends_on "llvm@6" resource "vim-hdl-examples" do url "https://github.com/suoto/vim-hdl-examples.git", @@ -30,7 +44,7 @@ class Nvc < Formula def install system "./autogen.sh" if build.head? system "./tools/fetch-ieee.sh" - system "./configure", "--with-llvm=#{Formula["llvm"].opt_bin}/llvm-config", + system "./configure", "--with-llvm=#{Formula["llvm@6"].opt_bin}/llvm-config", "--prefix=#{prefix}", "--with-system-cc=/usr/bin/clang" system "make"