homebrew-core/Formula/cabal-install.rb

43 lines
1.4 KiB
Ruby
Raw Normal View History

2014-07-29 08:04:52 +00:00
require "formula"
class CabalInstall < Formula
2014-07-29 08:04:52 +00:00
homepage "http://www.haskell.org/haskellwiki/Cabal-Install"
url "http://hackage.haskell.org/package/cabal-install-1.20.0.3/cabal-install-1.20.0.3.tar.gz"
sha1 "444448b0f704420e329e8fc1989b6743c1c8546d"
revision 1
2013-10-03 08:55:52 +00:00
bottle do
cellar :any
revision 1
sha1 "2e7eeaf5fa142dee42443e41e08774c6bb80df09" => :yosemite
sha1 "8a01264adc397dd6057cbfa1db4c709ecf9ce601" => :mavericks
sha1 "a5516ab7cfe110c0528da484a57124b8805f8ffd" => :mountain_lion
2013-10-03 08:55:52 +00:00
end
2014-07-29 08:04:52 +00:00
depends_on "ghc"
fails_with :clang if MacOS.version < :mavericks # Same as ghc.rb
def install
# use a temporary package database instead of ~/.cabal or ~/.ghc
pkg_db = "#{Dir.pwd}/package.conf.d"
2014-07-29 08:04:52 +00:00
system "ghc-pkg", "init", pkg_db
ENV["EXTRA_CONFIGURE_OPTS"] = "--package-db=#{pkg_db}"
ENV["PREFIX"] = Dir.pwd
inreplace "bootstrap.sh", "list --global",
"list --global --no-user-package-db"
# Avoid a nasty bug in Cabal by forcing the bootstrap script to pull a later version.
# (q.v. https://github.com/haskell/cabal/issues/1740)
inreplace "bootstrap.sh", 'CABAL_VER="1.20.0.0";', 'CABAL_VER="1.20.0.2";'
2014-07-29 08:04:52 +00:00
system "sh", "bootstrap.sh"
bin.install "bin/cabal"
2014-07-29 08:04:52 +00:00
bash_completion.install "bash-completion/cabal"
end
2013-10-03 09:19:41 +00:00
test do
2014-07-29 08:04:52 +00:00
system "#{bin}/cabal", "--config-file=#{testpath}/config", "info", "cabal"
2013-10-03 09:19:41 +00:00
end
end