2010-02-28 13:29:19 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Smlnj < Formula
|
2010-02-28 13:29:19 +00:00
|
|
|
homepage 'http://www.smlnj.org/'
|
2012-03-02 23:24:37 +00:00
|
|
|
url 'http://smlnj.cs.uchicago.edu/dist/working/110.74/config.tgz'
|
|
|
|
version '110.74'
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 '8879133ba94be1b44e7b97a04c9e23070335284a'
|
2010-02-28 13:29:19 +00:00
|
|
|
|
|
|
|
def targets
|
|
|
|
<<-EOS
|
|
|
|
request ml-ulex
|
|
|
|
request ml-ulex-mllex-tool
|
|
|
|
request ml-lex
|
|
|
|
request ml-lex-lex-ext
|
|
|
|
request ml-yacc
|
|
|
|
request ml-yacc-grm-ext
|
|
|
|
request ml-antlr
|
|
|
|
request ml-lpt-lib
|
|
|
|
request ml-burg
|
|
|
|
request smlnj-lib
|
|
|
|
request tdp-util
|
|
|
|
request cml
|
|
|
|
request cml-lib
|
|
|
|
request mlrisc
|
|
|
|
request ckit
|
|
|
|
request heap2asm
|
|
|
|
EOS
|
|
|
|
end
|
2010-07-08 05:09:36 +00:00
|
|
|
|
2012-04-04 14:27:26 +00:00
|
|
|
# fixes the install.sh script to use the correct SDK for Lion. See:
|
|
|
|
# https://smlnj-gforge.cs.uchicago.edu/tracker/index.php?func=detail&aid=89&group_id=33&atid=215
|
|
|
|
# https://github.com/mxcl/homebrew/issues/11370
|
|
|
|
# https://github.com/mxcl/homebrew/pull/11443
|
|
|
|
def patches
|
|
|
|
DATA
|
|
|
|
end
|
|
|
|
|
2010-07-08 05:09:36 +00:00
|
|
|
def install
|
|
|
|
ENV.deparallelize
|
|
|
|
# smlnj is much easier to build if we do so in the directory where it
|
|
|
|
# will be installed. Thus, we're moving it to the prefix to be built
|
|
|
|
# there.
|
2012-02-21 06:04:21 +00:00
|
|
|
cd '..'
|
2010-07-08 05:09:36 +00:00
|
|
|
libexec.install 'config'
|
2010-07-08 20:05:55 +00:00
|
|
|
rm (libexec+'config/targets') # Rewrite targets list
|
2010-07-08 05:09:36 +00:00
|
|
|
(libexec+'config/targets').write targets
|
2012-02-21 06:04:21 +00:00
|
|
|
cd libexec
|
2010-07-08 05:09:36 +00:00
|
|
|
system 'config/install.sh'
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats
|
|
|
|
<<-EOS.undent
|
|
|
|
This formula spews ML files all over lib, and puts hidden subfolders in bin.
|
|
|
|
Because of this, we've installed it to:
|
|
|
|
#{libexec}
|
|
|
|
and we haven't linked it into #{HOMEBREW_PREFIX}
|
|
|
|
|
|
|
|
You'll need to add:
|
|
|
|
#{libexec}/bin
|
|
|
|
to your PATH.
|
|
|
|
|
|
|
|
Improvements are welcome.
|
|
|
|
EOS
|
|
|
|
end
|
2010-02-28 13:29:19 +00:00
|
|
|
end
|
2012-04-04 14:27:26 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/install.sh b/install.sh
|
|
|
|
index ea5f8c3..0108774 100755
|
|
|
|
--- a/install.sh
|
|
|
|
+++ b/install.sh
|
|
|
|
@@ -290,6 +290,11 @@ case $ARCH in
|
|
|
|
esac
|
|
|
|
|
|
|
|
case $OPSYS in
|
|
|
|
+ darwin)
|
|
|
|
+ # finding the correct SDK
|
|
|
|
+ SDKVERSION=`/usr/bin/sw_vers -productVersion | grep -o ^[0-9][0-9]\.[0-9]`
|
|
|
|
+ EXTRA_DEFS="SDK=-isysroot /Developer/SDKs/MacOSX$SDKVERSION.sdk -mmacosx-version-min=$SDKVERSION"
|
|
|
|
+ ;;
|
|
|
|
solaris)
|
|
|
|
MAKE=/usr/ccs/bin/make
|
|
|
|
;;
|
|
|
|
@@ -338,7 +343,7 @@ else
|
|
|
|
"$CONFIGDIR"/unpack "$ROOT" runtime
|
|
|
|
cd "$BASEDIR"/runtime/objs
|
|
|
|
echo $this: Compiling the run-time system.
|
|
|
|
- $MAKE -f mk.$ARCH-$OPSYS $EXTRA_DEFS
|
|
|
|
+ $MAKE -f mk.$ARCH-$OPSYS "$EXTRA_DEFS"
|
|
|
|
if [ -x run.$ARCH-$OPSYS ]; then
|
|
|
|
mv run.$ARCH-$OPSYS "$RUNDIR"
|
|
|
|
if [ -f runx.$ARCH-$OPSYS ]; then
|
2012-09-27 08:53:11 +00:00
|
|
|
--- a/_arch-n-opsys.orig 2012-09-27 10:30:34.000000000 +0200
|
|
|
|
+++ b/_arch-n-opsys 2012-09-27 10:30:49.000000000 +0200
|
|
|
|
@@ -65,6 +65,7 @@
|
|
|
|
9*) OPSYS=darwin; HEAP_OPSYS=darwin ;; # MacOS X 10.5
|
|
|
|
10*) OPSYS=darwin; HEAP_OPSYS=darwin ;; # MacOS X 10.6
|
|
|
|
11*) OPSYS=darwin; HEAP_OPSYS=darwin ;; # MacOS X 10.7
|
|
|
|
+ 12*) OPSYS=darwin; HEAP_OPSYS=darwin ;; # MacOS X 10.8
|
|
|
|
*) exit 1;;
|
|
|
|
esac;;
|
|
|
|
esac
|