Skip to content

Commit

Permalink
ghc@9 9.0.1 (new formula)
Browse files Browse the repository at this point in the history
This does not have a gmp resource. It is no longer needed. [1]

[1] https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.0#integer-gmp-11-integer-simple-ghc-bignum-10
  • Loading branch information
carlocab committed Feb 17, 2021
1 parent 51a3d77 commit b226959
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
63 changes: 63 additions & 0 deletions Formula/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
class GhcAT9 < Formula
desc "Glorious Glasgow Haskell Compilation System"
homepage "https://haskell.org/ghc/"
url "https://downloads.haskell.org/~ghc/9.0.1/ghc-9.0.1-src.tar.xz"
sha256 "a5230314e4065f9fcc371dfe519748fd85c825b279abf72a24e09b83578a35f9"
license "BSD-3-Clause"

livecheck do
url "https://www.haskell.org/ghc/download.html"
regex(/href=.*?download[._-]ghc[._-][^"' >]+?\.html[^>]*?>\s*?v?(\d+(?:\.\d+)+)\s*?</i)
end

keg_only :versioned_formula

depends_on "[email protected]" => :build
depends_on "sphinx-doc" => :build

# https://www.haskell.org/ghc/download_ghc_9_0_1.html#macosx_x86_64
# "This is a distribution for Mac OS X, 10.7 or later."
# A binary of ghc is needed to bootstrap ghc
resource "binary" do
on_macos do
url "https://downloads.haskell.org/~ghc/9.0.1/ghc-9.0.1-x86_64-apple-darwin.tar.xz"
sha256 "122d60509147d0117779d275f0215bde2ff63a64cda9d88f149432d0cae71b22"
end

on_linux do
url "https://downloads.haskell.org/~ghc/8.10.3/ghc-9.0.1-x86_64-deb9-linux.tar.xz"
sha256 "4ca6252492f59fe589029fadca4b6f922d6a9f0ff39d19a2bd9886fde4e183d5"
end
end

def install
ENV["CC"] = ENV.cc
ENV["LD"] = "ld"
ENV["PYTHON"] = Formula["[email protected]"].opt_bin/"python3"

resource("binary").stage do
binary = buildpath/"binary"

system "./configure", "--prefix=#{binary}"
ENV.deparallelize { system "make", "install" }

ENV.prepend_path "PATH", binary/"bin"
end

system "./configure", "--prefix=#{prefix}"
system "make"

ENV.deparallelize { system "make", "install" }
Dir.glob(lib/"*/package.conf.d/package.cache") { |f| rm f }
Dir.glob(lib/"*/package.conf.d/package.cache.lock") { |f| rm f }
end

def post_install
system "#{bin}/ghc-pkg", "recache"
end

test do
(testpath/"hello.hs").write('main = putStrLn "Hello Homebrew"')
assert_match "Hello Homebrew", shell_output("#{bin}/runghc hello.hs")
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"ghc",
"[email protected]",
"[email protected]",
"ghc@9",
"go",
"[email protected]",
"[email protected]",
Expand Down

0 comments on commit b226959

Please sign in to comment.