homebrew-core/Formula/swi-prolog.rb

66 lines
1.9 KiB
Ruby
Raw Normal View History

require 'formula'
2011-03-10 05:11:03 +00:00
class SwiProlog < Formula
homepage 'http://www.swi-prolog.org/'
2013-08-05 17:47:24 +00:00
url 'http://www.swi-prolog.org/download/stable/src/pl-6.4.1.tar.gz'
sha1 '37308983d438e364407b89e835f77a31e5474913'
2012-08-25 16:57:36 +00:00
devel do
url 'http://www.swi-prolog.org/download/devel/src/pl-6.5.2.tar.gz'
sha1 'fa448e1e59f901966de533140ce8bf6649e51b03'
end
head 'git://www.swi-prolog.org/home/pl/git/pl.git'
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
depends_on 'readline'
depends_on 'gmp'
if build.include? 'with-xpce'
depends_on 'pkg-config' => :build
depends_on :x11
depends_on 'jpeg'
end
# 10.5 versions of these are too old
2013-07-10 02:30:15 +00:00
if MacOS.version <= :leopard
2011-04-08 18:16:37 +00:00
depends_on 'fontconfig'
depends_on 'expat'
end
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
def install
args = ["--prefix=#{prefix}", "--mandir=#{man}"]
ENV.append 'DISABLE_PKGS', "jpl" unless build.include? "with-jpl"
ENV.append 'DISABLE_PKGS', "xpce" unless build.include? 'with-xpce'
# 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.
2013-06-24 03:50:03 +00:00
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"
# './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?
system "./configure", *args
system "make"
system "make install"
end
def test
system "#{bin}/swipl", "--version"
end
end