Skip to content
Browse files

sml-nj: add patch for Lion

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
  • Loading branch information...
1 parent 4574cd4 commit 0ea048dbcc9fb5d82ba89f8cd83bc5a82d31ec1f @MrMarvin MrMarvin committed with adamv Apr 4, 2012
Showing with 35 additions and 0 deletions.
  1. +35 −0 Library/Formula/smlnj.rb
View
35 Library/Formula/smlnj.rb
@@ -27,6 +27,14 @@ def targets
EOS
end
+ # 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
+
def install
ENV.deparallelize
# smlnj is much easier to build if we do so in the directory where it
@@ -55,3 +63,30 @@ def caveats
EOS
end
end
+
+__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

0 comments on commit 0ea048d

Please sign in to comment.
Something went wrong with that request. Please try again.