aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/swi-prolog.rb
diff options
context:
space:
mode:
authorJonathan Abourbih2010-10-23 21:13:13 +0100
committerAdam Vandenberg2010-10-24 21:10:03 -0700
commitf2304d2b5151e97d3ae1e244901699f1801ce58d (patch)
treefef080263238cc406b735c199b757b188c3eb894 /Library/Formula/swi-prolog.rb
parent34c99b0cc86fc2b84feee1aa39de46b04fac0fbc (diff)
downloadhomebrew-f2304d2b5151e97d3ae1e244901699f1801ce58d.tar.bz2
swi-prolog - fix jni.h issue & improve X11 support
Formula no longer includes JPL by default to get around an error that Apple's introduced in OSX 10.6 with broken symlinks to the JNI .h files. Also, now checks for X11 and disables xpce if required, and uses the Homebrew ENV.x11 system to include the appropriate libraries and headers. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula/swi-prolog.rb')
-rw-r--r--Library/Formula/swi-prolog.rb38
1 files changed, 30 insertions, 8 deletions
diff --git a/Library/Formula/swi-prolog.rb b/Library/Formula/swi-prolog.rb
index 5668c639d..14fb3c2ec 100644
--- a/Library/Formula/swi-prolog.rb
+++ b/Library/Formula/swi-prolog.rb
@@ -10,24 +10,46 @@ class SwiProlog <Formula
depends_on 'gmp'
depends_on 'jpeg'
depends_on 'fontconfig' if MACOS_VERSION < 10.6
- depends_on 'ncursesw'
depends_on 'mcrypt'
depends_on 'gawk'
def options
- [['--lite', "Don't install any packages"]]
+ [['--lite', "Don't install any packages; overrides --with-jpl"],
+ ['--with-jpl', "Include JPL, the Java-Prolog Bridge"]]
end
def install
- ENV['CIFLAGS'] = ENV['CPPFLAGS']
- if ARGV.include? '--lite'
- world = ''
+ args = ["--prefix=#{prefix}", "--mandir=#{man}"]
+
+ # It looks like Apple has borked the Java JNI headers in Java 1.6.0_22-b04-37.
+ # Will not install the JPL bridge by default, which depends on them.
+ unless ARGV.include? "--with-jpl"
+ ohai <<-EOS.undent
+ JPL, the Java-Prolog bridge, is not installed by this formula by default.
+ If you want to indclude the Java-Prolog bridge, add the --with-jpl option.
+ EOS
+
+ ENV.append 'DISABLE_PKGS', "jpl"
+ end
+
+ if x11_installed?
+ # SWI-Prolog requires X11 for XPCE
+ ENV.x11
else
- world = '--with-world'
+ opoo "It appears that X11 is not installed. The XPCE packages will not be built."
+ ENV.append 'DISABLE_PKGS', "xpce"
end
- system "./configure", "--prefix=#{prefix}", world, "--x-includes=/usr/X11/include",
- "--x-libraries=/usr/X11/lib", "--mandir=#{man}"
+ # 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"
+
+ system "./configure", *args
system "make"
system "make install"
end