2014-07-29 08:04:52 +00:00
|
|
|
require "formula"
|
2011-08-13 06:11:05 +00:00
|
|
|
|
|
|
|
class CabalInstall < Formula
|
2014-07-29 08:04:52 +00:00
|
|
|
homepage "http://www.haskell.org/haskellwiki/Cabal-Install"
|
2014-06-15 08:48:45 +00:00
|
|
|
url "http://hackage.haskell.org/package/cabal-install-1.20.0.2/cabal-install-1.20.0.2.tar.gz"
|
|
|
|
sha1 "e9b3843270b8f5969a4e1205263e59439bc35692"
|
2014-07-29 08:01:29 +00:00
|
|
|
revision 1
|
2011-08-13 06:11:05 +00:00
|
|
|
|
2013-10-03 08:55:52 +00:00
|
|
|
bottle do
|
2013-12-05 06:58:17 +00:00
|
|
|
cellar :any
|
2014-07-29 11:24:12 +00:00
|
|
|
sha1 "98a2b33c24cf095f5647dd294319b2391d88636d" => :mavericks
|
|
|
|
sha1 "6de72c12c3d0eaa7e2b0ee4f5227a834ba7c7a5b" => :mountain_lion
|
|
|
|
sha1 "7c2d5603cf554037c397a1adfa844caf94cef444" => :lion
|
2013-10-03 08:55:52 +00:00
|
|
|
end
|
|
|
|
|
2014-07-29 08:04:52 +00:00
|
|
|
depends_on "ghc"
|
2011-08-13 06:11:05 +00:00
|
|
|
|
2014-07-29 08:04:52 +00:00
|
|
|
conflicts_with "haskell-platform"
|
2013-05-28 19:24:50 +00:00
|
|
|
|
2011-08-13 06:11:05 +00:00
|
|
|
def install
|
2013-09-09 12:09:06 +00:00
|
|
|
# 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"
|
2013-09-09 12:09:06 +00:00
|
|
|
|
2014-07-29 08:04:52 +00:00
|
|
|
system "sh", "bootstrap.sh"
|
2013-09-09 12:09:06 +00:00
|
|
|
bin.install "bin/cabal"
|
2014-07-29 08:04:52 +00:00
|
|
|
bash_completion.install "bash-completion/cabal"
|
2011-08-13 06:11:05 +00:00
|
|
|
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
|
2011-08-13 06:11:05 +00:00
|
|
|
end
|