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/'
|
2012-09-22 14:15:39 +00:00
|
|
|
url 'http://www.swi-prolog.org/download/stable/src/pl-6.2.1.tar.gz'
|
|
|
|
sha256 'c5ceac0a23e6a2ab706a10987cb87a0cfe4e5c3d01600f6c5e178846310ea7e8'
|
2012-08-25 16:57:36 +00:00
|
|
|
|
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
|
|
|
|
2012-09-02 08:13:33 +00:00
|
|
|
option 'lite', "Disable all packages"
|
|
|
|
option 'with-jpl', "Enable JPL (Java Prolog Bridge)"
|
|
|
|
option 'with-xpce', "Enable XPCE (Prolog Native GUI Library)"
|
2012-08-25 16:57:36 +00:00
|
|
|
|
2010-10-16 13:11:47 +00:00
|
|
|
depends_on 'readline'
|
|
|
|
depends_on 'gmp'
|
2012-09-02 08:13:33 +00:00
|
|
|
|
|
|
|
if build.include? 'with-xpce'
|
|
|
|
depends_on 'pkg-config' => :build
|
|
|
|
depends_on :x11
|
|
|
|
depends_on 'jpeg'
|
|
|
|
end
|
2010-10-16 13:11:47 +00:00
|
|
|
|
2011-01-03 20:15:09 +00:00
|
|
|
# 10.5 versions of these are too old
|
2012-09-05 04:04:01 +00:00
|
|
|
if MacOS.version == :leopard
|
2011-04-08 18:16:37 +00:00
|
|
|
depends_on 'fontconfig'
|
|
|
|
depends_on 'expat'
|
|
|
|
end
|
2011-01-03 20:15:09 +00:00
|
|
|
|
2012-03-18 20:33:24 +00:00
|
|
|
fails_with :llvm do
|
|
|
|
build 2335
|
|
|
|
cause "Exported procedure chr_translate:chr_translate_line_info/3 is not defined"
|
|
|
|
end
|
2011-03-21 21:24:22 +00:00
|
|
|
|
2009-12-25 22:18:52 +00:00
|
|
|
def install
|
2010-10-23 20:13:13 +00:00
|
|
|
args = ["--prefix=#{prefix}", "--mandir=#{man}"]
|
2012-09-02 08:13:33 +00:00
|
|
|
ENV.append 'DISABLE_PKGS', "jpl" unless build.include? "with-jpl"
|
|
|
|
ENV.append 'DISABLE_PKGS', "xpce" unless build.include? 'with-xpce'
|
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
|
2012-08-25 16:57:36 +00:00
|
|
|
args << "--with-world" unless build.include? "lite"
|
2010-10-23 20:13:13 +00:00
|
|
|
|
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.
|
2012-08-25 16:57:36 +00:00
|
|
|
system "echo '3' | ./prepare" if 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
|
2012-09-02 08:13:33 +00:00
|
|
|
|
|
|
|
def test
|
|
|
|
system "#{bin}/swipl", "--version"
|
|
|
|
end
|
2009-12-25 22:18:52 +00:00
|
|
|
end
|