2011-08-13 06:11:05 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class CabalInstall < Formula
|
|
|
|
homepage 'http://www.haskell.org/haskellwiki/Cabal-Install'
|
2014-05-09 19:56:19 +00:00
|
|
|
url "http://hackage.haskell.org/package/cabal-install-1.20.0.1/cabal-install-1.20.0.1.tar.gz"
|
|
|
|
sha1 "268eca309381d4de79b7fd5f69b6ca01a0d18030"
|
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-05-09 20:09:46 +00:00
|
|
|
sha1 "d66564529604739d153641fe7cdd1c43b04387c0" => :mavericks
|
|
|
|
sha1 "b4c53ae187560fe4b0d8cb70123230b0ac638ca6" => :mountain_lion
|
|
|
|
sha1 "487e8249f3d64ae28264c62c09dbabc9011a21d0" => :lion
|
2013-10-03 08:55:52 +00:00
|
|
|
end
|
|
|
|
|
2011-08-13 06:11:05 +00:00
|
|
|
depends_on 'ghc'
|
|
|
|
|
2013-05-28 19:24:50 +00:00
|
|
|
conflicts_with 'haskell-platform'
|
|
|
|
|
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"
|
|
|
|
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-05-28 19:24:50 +00:00
|
|
|
system 'sh', 'bootstrap.sh'
|
2013-09-09 12:09:06 +00:00
|
|
|
bin.install "bin/cabal"
|
2013-05-03 18:03:31 +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
|
|
|
|
system "#{bin}/cabal", "--config-file=#{testpath}/config", 'info', 'cabal'
|
|
|
|
end
|
2011-08-13 06:11:05 +00:00
|
|
|
end
|