Cabal: move fails_with to a class method
Fixes Homebrew/homebrew#39950.
This commit is contained in:
parent
102170b957
commit
0abe16673e
@ -2,6 +2,17 @@ module Language
|
|||||||
module Haskell
|
module Haskell
|
||||||
# module for formulas using cabal-install as build tool
|
# module for formulas using cabal-install as build tool
|
||||||
module Cabal
|
module Cabal
|
||||||
|
module ClassMethods
|
||||||
|
def setup_ghc_compilers
|
||||||
|
# Use llvm-gcc on Lion or below (same compiler used when building GHC).
|
||||||
|
fails_with(:clang) if MacOS.version <= :lion
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.included base
|
||||||
|
base.extend ClassMethods
|
||||||
|
end
|
||||||
|
|
||||||
def cabal_sandbox
|
def cabal_sandbox
|
||||||
pwd = Pathname.pwd
|
pwd = Pathname.pwd
|
||||||
# force cabal to put its stuff here instead of the home directory by
|
# force cabal to put its stuff here instead of the home directory by
|
||||||
@ -11,9 +22,6 @@ module Language
|
|||||||
home = ENV["HOME"]
|
home = ENV["HOME"]
|
||||||
ENV["HOME"] = pwd
|
ENV["HOME"] = pwd
|
||||||
|
|
||||||
# Use llvm-gcc on Lion or below (same compiler used when building GHC).
|
|
||||||
fails_with(:clang) if MacOS.version <= :lion
|
|
||||||
|
|
||||||
# use cabal's sandbox feature if available
|
# use cabal's sandbox feature if available
|
||||||
cabal_version = `cabal --version`[/[0-9.]+/].split('.').collect(&:to_i)
|
cabal_version = `cabal --version`[/[0-9.]+/].split('.').collect(&:to_i)
|
||||||
if (cabal_version <=> [1, 20]) > -1
|
if (cabal_version <=> [1, 20]) > -1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user