homebrew-core/Formula/cabal-install.rb

26 lines
784 B
Ruby

require 'formula'
class CabalInstall < Formula
homepage 'http://www.haskell.org/haskellwiki/Cabal-Install'
url 'http://hackage.haskell.org/packages/archive/cabal-install/1.18.0.1/cabal-install-1.18.0.1.tar.gz'
sha1 'ac403d580bd399d682e5d8f4fd8d6d07c03622d9'
depends_on 'ghc'
conflicts_with 'haskell-platform'
def install
# 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'
system 'sh', 'bootstrap.sh'
bin.install "bin/cabal"
bash_completion.install 'bash-completion/cabal'
end
end