swi-prolog: use new dsl

master
Adam Vandenberg 2012-08-25 09:57:36 -07:00
parent 9a107068ae
commit 4bbed8cee0
1 changed files with 7 additions and 17 deletions

View File

@ -4,8 +4,12 @@ class SwiProlog < Formula
homepage 'http://www.swi-prolog.org/'
url 'http://www.swi-prolog.org/download/stable/src/pl-6.0.2.tar.gz'
sha256 '9dbc4d3aef399204263f168583e54468078528bff75c48c7895ae3efe5499b75'
head 'git://www.swi-prolog.org/home/pl/git/pl.git'
option 'lite', "Don't install any packages"
option 'without-jpl', "Don't include JPL, the Java-Prolog Bridge"
depends_on 'pkg-config' => :build
depends_on 'readline'
depends_on 'gmp'
@ -25,14 +29,9 @@ class SwiProlog < Formula
cause "Exported procedure chr_translate:chr_translate_line_info/3 is not defined"
end
def options
[['--lite', "Don't install any packages; overrides --with-jpl"],
['--without-jpl', "Include JPL, the Java-Prolog Bridge"]]
end
def install
args = ["--prefix=#{prefix}", "--mandir=#{man}"]
ENV.append 'DISABLE_PKGS', "jpl" if ARGV.include? "--without-jpl"
ENV.append 'DISABLE_PKGS', "jpl" if build.include? "without-jpl"
unless MacOS::X11.installed?
# SWI-Prolog requires X11 for XPCE
@ -47,23 +46,14 @@ class SwiProlog < Formula
ENV['COFLAGS'] = ENV['CFLAGS']
# Build the packages unless --lite option specified
args << "--with-world" unless ARGV.include? "--lite"
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.
system "echo '3' | ./prepare" if ARGV.build_head?
system "echo '3' | ./prepare" if build.head?
system "./configure", *args
system "make"
system "make install"
end
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
end