homebrew-core/Formula/cabal-install.rb
Darin Morrison 5deb5dd0f4 cabal-install: update to 1.18.0.1, sandbox build.
Use sandboxing support rather than ~/.ghc for build.

Closes Homebrew/homebrew#22416.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2013-09-12 14:48:05 +01:00

25 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