homebrew-core/Formula/objective-caml.rb
Anil Madhavapeddy 05400d316d objective-caml: use /usr/local as prefix.
The compiler has a hardbaked location of its standard library that
can be queried with `ocamlc -where`.  For it to work correctly
with other formula like `camlp4`, it must not point to the Cellar.

This partially reverts c24d78416587da42ddba9f51006b0c0e9a086038
from Homebrew/homebrew#40677 (but should preserve the actual bug fix there)

Also:
- Add a test case for the correct compiler prefix (#41294)
- Install into the Cellar and symlink into `HOMEBREW_PREFIX`

Closes Homebrew/homebrew#41294.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-07-03 16:28:24 +01:00

37 lines
1.3 KiB
Ruby

class ObjectiveCaml < Formula
desc "General purpose programming language in the ML family"
homepage "https://ocaml.org/"
url "http://caml.inria.fr/pub/distrib/ocaml-4.02/ocaml-4.02.1.tar.gz"
sha256 "3cbc7af5a3886c8c5af8dab5568d6256a191d89ecbd4aea18eaf5b47034c6138"
revision 3
head "http://caml.inria.fr/svn/ocaml/trunk", :using => :svn
option "with-x11", "Install with the Graphics module"
depends_on :x11 => :optional
bottle do
revision 2
sha256 "f4d597281214ca019ab564cd0cebdcf18e428fc56ea81c9b289a42f4ec9da17c" => :yosemite
sha256 "5dc0b0515b58513c35a35b290eea8417f942ee1fdd1891bb8bfc62ddd5ea0889" => :mavericks
sha256 "3cd3841dec22d0b1309ad781376a4a509c5946cc77a32044dc9f306d906198fc" => :mountain_lion
end
def install
ENV.deparallelize # Builds are not parallel-safe, esp. with many cores
# the ./configure in this package is NOT a GNU autoconf script!
args = ["-prefix", "#{HOMEBREW_PREFIX}", "-with-debug-runtime", "-mandir", man]
args << "-no-graph" if build.without? "x11"
system "./configure", *args
system "make", "world.opt"
system "make", "install", "PREFIX=#{prefix}"
end
test do
assert_match "val x : int = 1", shell_output("echo 'let x = 1 ;;' | ocaml 2>&1")
assert_match "#{HOMEBREW_PREFIX}", shell_output("ocamlc -where")
end
end