2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-19 09:35:43 +00:00
|
|
|
|
2009-12-03 07:07:11 +00:00
|
|
|
# References:
|
|
|
|
# * http://smalltalk.gnu.org/wiki/building-gst-guides
|
2010-05-03 17:40:24 +00:00
|
|
|
#
|
|
|
|
# Note that we build 32-bit, which means that 64-bit
|
|
|
|
# optional dependencies will break the build. You may need
|
|
|
|
# to "brew unlink" these before installing GNU Smalltalk and
|
|
|
|
# "brew link" them afterwards:
|
|
|
|
# * gdbm
|
2009-12-03 07:07:11 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class GnuSmalltalk < Formula
|
2010-04-07 05:58:35 +00:00
|
|
|
url 'ftp://ftp.gnu.org/gnu/smalltalk/smalltalk-3.2.2.tar.gz'
|
2009-12-03 07:07:11 +00:00
|
|
|
homepage 'http://smalltalk.gnu.org/'
|
2010-04-07 05:58:35 +00:00
|
|
|
sha1 'a985d69e4760420614c9dfe4d3605e47c5eb8faa'
|
2009-09-19 09:35:43 +00:00
|
|
|
|
2010-09-13 22:16:09 +00:00
|
|
|
# 'gmp' is an optional dep, it is built 64-bit on Snow Leopard
|
|
|
|
# (and this brew is forced to build in 32-bit mode.)
|
2009-09-19 09:35:43 +00:00
|
|
|
|
2010-12-05 02:25:19 +00:00
|
|
|
depends_on 'readline'
|
|
|
|
|
2011-04-03 18:53:05 +00:00
|
|
|
fails_with_llvm "Codegen problems with LLVM"
|
2010-05-03 17:40:24 +00:00
|
|
|
|
2011-04-03 18:53:05 +00:00
|
|
|
def install
|
2009-12-03 07:07:11 +00:00
|
|
|
# 64-bit version doesn't build, so force 32 bits.
|
|
|
|
ENV.m32
|
2010-05-03 17:40:24 +00:00
|
|
|
|
2011-03-18 17:30:47 +00:00
|
|
|
if MacOS.prefer_64_bit? and Formula.factory('gdbm').installed?
|
2010-10-17 01:43:20 +00:00
|
|
|
onoe "A 64-bit gdbm will cause linker errors"
|
|
|
|
puts <<-EOS.undent
|
|
|
|
GNU Smalltak doesn't compile 64-bit clean on OS X, so having a
|
|
|
|
64-bit gdbm installed will break linking you may want to do:
|
|
|
|
$ brew unlink gdbm
|
|
|
|
$ brew install gnu-smalltalk
|
|
|
|
$ brew link gdbm
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
2010-12-05 02:25:19 +00:00
|
|
|
readline = Formula.factory('readline')
|
|
|
|
|
2010-05-04 16:34:59 +00:00
|
|
|
# GNU Smalltalk thinks it needs GNU awk, but it works fine
|
|
|
|
# with OS X awk, so let's trick configure.
|
|
|
|
here = Dir.pwd
|
|
|
|
system "ln -s /usr/bin/awk #{here}/gawk"
|
|
|
|
ENV['AWK'] = "#{here}/gawk"
|
|
|
|
|
2009-09-19 09:35:43 +00:00
|
|
|
ENV['FFI_CFLAGS'] = '-I/usr/include/ffi'
|
2010-04-07 05:58:35 +00:00
|
|
|
system "./configure", "--disable-debug", "--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}",
|
2010-12-05 02:25:19 +00:00
|
|
|
"--with-readline=#{readline.lib}"
|
2009-12-03 07:07:11 +00:00
|
|
|
system "make"
|
|
|
|
ENV.j1 # Parallel install doesn't work
|
2009-09-19 09:35:43 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|