2009-12-25 22:18:52 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class SwiProlog < Formula
|
2009-12-25 22:18:52 +00:00
|
|
|
homepage 'http://www.swi-prolog.org/'
|
2011-11-27 17:13:48 +00:00
|
|
|
url 'http://www.swi-prolog.org/download/stable/src/pl-5.10.5.tar.gz'
|
|
|
|
sha256 '38d938d6a64e894685aa44bf9ea34b5505764cd084e07e6b4c21a9dd89b579d5'
|
2011-08-18 10:12:00 +00:00
|
|
|
head 'git://www.swi-prolog.org/home/pl/git/pl.git'
|
2009-12-25 22:18:52 +00:00
|
|
|
|
2011-03-21 21:24:22 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2010-10-16 13:11:47 +00:00
|
|
|
depends_on 'readline'
|
|
|
|
depends_on 'gmp'
|
|
|
|
depends_on 'jpeg'
|
|
|
|
depends_on 'mcrypt'
|
|
|
|
depends_on 'gawk'
|
|
|
|
|
2011-01-03 20:15:09 +00:00
|
|
|
# 10.5 versions of these are too old
|
2011-04-08 18:16:37 +00:00
|
|
|
if MacOS.leopard?
|
|
|
|
depends_on 'fontconfig'
|
|
|
|
depends_on 'expat'
|
|
|
|
end
|
2011-01-03 20:15:09 +00:00
|
|
|
|
2011-03-21 21:24:22 +00:00
|
|
|
fails_with_llvm "Exported procedure chr_translate:chr_translate_line_info/3 is not defined"
|
|
|
|
|
2010-10-16 13:11:47 +00:00
|
|
|
def options
|
2010-10-23 20:13:13 +00:00
|
|
|
[['--lite', "Don't install any packages; overrides --with-jpl"],
|
2011-01-03 20:15:09 +00:00
|
|
|
['--without-jpl', "Include JPL, the Java-Prolog Bridge"]]
|
2010-10-16 13:11:47 +00:00
|
|
|
end
|
2009-12-25 22:18:52 +00:00
|
|
|
|
|
|
|
def install
|
2010-10-23 20:13:13 +00:00
|
|
|
args = ["--prefix=#{prefix}", "--mandir=#{man}"]
|
2011-01-03 20:15:09 +00:00
|
|
|
ENV.append 'DISABLE_PKGS', "jpl" if ARGV.include? "--without-jpl"
|
2010-10-23 20:13:13 +00:00
|
|
|
|
|
|
|
if x11_installed?
|
|
|
|
# SWI-Prolog requires X11 for XPCE
|
|
|
|
ENV.x11
|
2010-10-16 13:11:47 +00:00
|
|
|
else
|
2010-10-23 20:13:13 +00:00
|
|
|
opoo "It appears that X11 is not installed. The XPCE packages will not be built."
|
|
|
|
ENV.append 'DISABLE_PKGS', "xpce"
|
2010-10-16 13:11:47 +00:00
|
|
|
end
|
2009-12-25 22:18:52 +00:00
|
|
|
|
2010-10-23 20:13:13 +00:00
|
|
|
# SWI-Prolog's Makefiles don't add CPPFLAGS to the compile command, but do
|
|
|
|
# include CIFLAGS. Setting it here. Also, they clobber CFLAGS, so including
|
|
|
|
# the Homebrew-generated CFLAGS into COFLAGS here.
|
|
|
|
ENV['CIFLAGS'] = ENV['CPPFLAGS']
|
|
|
|
ENV['COFLAGS'] = ENV['CFLAGS']
|
|
|
|
|
|
|
|
# Build the packages unless --lite option specified
|
|
|
|
args << "--with-world" unless ARGV.include? "--lite"
|
|
|
|
|
2010-11-12 22:56:09 +00:00
|
|
|
# './prepare' prompts the user to build documentation
|
|
|
|
# (which requires other modules). '3' is the option
|
|
|
|
# to ignore documentation.
|
|
|
|
system "echo '3' | ./prepare" if ARGV.build_head?
|
2010-10-23 20:13:13 +00:00
|
|
|
system "./configure", *args
|
2009-12-25 22:18:52 +00:00
|
|
|
system "make"
|
|
|
|
system "make install"
|
|
|
|
end
|
2011-01-03 20:15:09 +00:00
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
By default, this formula installs the JPL bridge.
|
|
|
|
On 10.6, this requires the "Java Developer Update" from Apple:
|
|
|
|
* https://github.com/mxcl/homebrew/wiki/new-issue
|
|
|
|
|
|
|
|
Use the "--without-jpl" switch to skip installing this component.
|
|
|
|
EOS
|
|
|
|
end
|
2009-12-25 22:18:52 +00:00
|
|
|
end
|