Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

ghc 7.8.2 with --devel #29084

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 39 additions & 40 deletions Library/Formula/ghc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,38 @@ class Ghc < Formula
option "32-bit"
option "tests", "Verify the build using the testsuite."

devel do
# This block should largely translate over for 7.8.1 when GM.
url "http://www.haskell.org/ghc/dist/7.8.1-rc2/ghc-7.8.0.20140228-src.tar.bz2"
sha1 "8bd8eb3410a7fccc322c0e23e8045fcb5793ea5a"
# http://hackage.haskell.org/trac/ghc/ticket/6009
depends_on :macos => :snow_leopard
depends_on "gmp"

depends_on "gcc" if build.build_32_bit?
depends_on :macos => :mountain_lion
devel do
url "https://www.haskell.org/ghc/dist/7.8.2/ghc-7.8.2-src.tar.xz"
sha1 "fe86ae790b7e8e5b4c78db7a914ee375bc6d9fc3"

resource "binary" do
url "https://www.haskell.org/ghc/dist/7.8.1-rc2/ghc-7.8.0.20140228-x86_64-apple-darwin-lion.tar.bz2"
sha1 "0b5d9a25afc516682dcae62e9955552ce857e715"
resource "testsuite" do
url "https://www.haskell.org/ghc/dist/7.8.2/ghc-7.8.2-testsuite.tar.xz"
sha1 "3abe4e0ebbed17e825573f0f34be0eca9179f9e4"
end
end

resource "binary-32" do
url "http://www.haskell.org/ghc/dist/7.6.3/ghc-7.6.3-i386-apple-darwin.tar.bz2"
sha1 "6a312263fef41e06003f0676b879f2d2d5a1f30c"
end
resource "binary_7.8" do
url "https://www.haskell.org/ghc/dist/7.8.2/ghc-7.8.2-x86_64-apple-darwin-mavericks.tar.xz"
sha1 "5219737fb38f882532712047f6af32fc73a91f0f"
end

resource "testsuite" do
url "http://www.haskell.org/ghc/dist/7.8.1-rc2/ghc-7.8.0.20140228-testsuite.tar.bz2"
sha1 "0c52e15c699b1c624fbc218b98ddfb44bc43cec8"
end
resource "binary" do
url "http://www.haskell.org/ghc/dist/7.4.2/ghc-7.4.2-x86_64-apple-darwin.tar.bz2"
sha1 "7c655701672f4b223980c3a1068a59b9fbd08825"
end

resource "binary32" do
url "http://www.haskell.org/ghc/dist/7.4.2/ghc-7.4.2-i386-apple-darwin.tar.bz2"
sha1 "60f749893332d7c22bb4905004a67510992d8ef6"
end

# These don't work inside of a `stable do` block
if build.stable?
if build.stable? || build.build_32_bit? || !MacOS.prefer_64_bit? || MacOS.version < :mavericks
depends_on "gcc" if MacOS.version >= :mountain_lion
env :std

fails_with :clang do
Expand All @@ -52,21 +58,6 @@ class Ghc < Formula
end

stable do
# http://hackage.haskell.org/trac/ghc/ticket/6009
depends_on :macos => :snow_leopard
depends_on "gcc" if MacOS.version >= :mountain_lion
depends_on "gmp"

resource "binary" do
url "http://www.haskell.org/ghc/dist/7.4.2/ghc-7.4.2-x86_64-apple-darwin.tar.bz2"
sha1 "7c655701672f4b223980c3a1068a59b9fbd08825"
end

resource "binary32" do
url "http://www.haskell.org/ghc/dist/7.4.2/ghc-7.4.2-i386-apple-darwin.tar.bz2"
sha1 "60f749893332d7c22bb4905004a67510992d8ef6"
end

resource "testsuite" do
url "https://github.com/ghc/testsuite/archive/ghc-7.6.3-release.tar.gz"
sha1 "6a1973ae3cccdb2f720606032ae84ffee8680ca1"
Expand All @@ -80,10 +71,12 @@ def install
# Move the main tarball contents into a subdirectory
(buildpath+"Ghcsource").install Dir["*"]

if (Hardware.is_64_bit? and not build.build_32_bit?)
binary_resource = "binary"
else
if build.build_32_bit? || !MacOS.prefer_64_bit?
binary_resource = "binary32"
elsif MacOS.version >= :mavericks && build.devel?
binary_resource = "binary_7.8"
else
binary_resource = "binary"
end

resource(binary_resource).stage do
Expand Down Expand Up @@ -112,11 +105,11 @@ def install
# https://github.com/Homebrew/homebrew/issues/13650
ENV["LD"] = "ld"

if Hardware.is_64_bit? and not build.build_32_bit?
arch = "x86_64"
else
if build.build_32_bit? || !MacOS.prefer_64_bit?
ENV.m32 # Need to force this to fix build error on internal libgmp_ar.
arch = "i386"
else
arch = "x86_64"
end

# ensure configure does not use Xcode 5 "gcc" which is actually clang
Expand Down Expand Up @@ -144,11 +137,17 @@ def install
system "make"
# -j1 fixes an intermittent race condition
system "make", "-j1", "install"
if build.devel?
# use clang, even when gcc was used to build ghc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, seems potentially weird. Can clang not be used to build too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, because a binary ghc 7.8 is required to booststrap the build, and it is available to download only for mavericks 64 bit

settings = Dir[lib/"ghc-*/settings"][0]
inreplace settings, "\"#{ENV.cc}\"", "\"clang\""
end
end
end

def caveats; <<-EOS.undent
This brew is for GHC only; you might also be interested in haskell-platform.
This brew is for GHC only; you might also be interested in cabal-install
or haskell-platform.
EOS
end

Expand Down