2011-08-13 06:11:05 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class CabalInstall < Formula
|
|
|
|
homepage 'http://www.haskell.org/haskellwiki/Cabal-Install'
|
2013-10-02 22:11:16 +00:00
|
|
|
url 'http://hackage.haskell.org/package/cabal-install-1.18.0.2/cabal-install-1.18.0.2.tar.gz'
|
|
|
|
sha1 '2d1f7a48d17b1e02a1e67584a889b2ff4176a773'
|
2011-08-13 06:11:05 +00:00
|
|
|
|
2013-10-03 08:55:52 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
|
|
|
sha1 '6479272e2dcc61c0e240fb396baac1de96026655' => :mountain_lion
|
|
|
|
sha1 '72bc77c328690f89ce722fc7d7885fa91b0bf331' => :lion
|
|
|
|
sha1 '4f4ea54fb256df47bbbba5a8a21e5b3540300f69' => :snow_leopard
|
|
|
|
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
|