Skip to content

Instantly share code, notes, and snippets.

@xak2000
Forked from huynhjl/play_cygwin.patch
Last active December 22, 2015 07:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xak2000/6437577 to your computer and use it in GitHub Desktop.
Save xak2000/6437577 to your computer and use it in GitHub Desktop.
Patch for play and framework/build to run under cygwin and mingw32. Updated for play-2.1.3.
diff -r --unified play-2.1.3/framework/build play-2.1.3-cygwin/framework/build
--- play-2.1.3/framework/build 2013-08-06 12:29:56 +0000
+++ play-2.1.3-cygwin/framework/build 2013-09-04 13:44:05 +0000
@@ -10,4 +10,4 @@
DEBUG_PARAM="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=${JPDA_PORT}"
fi
-java ${DEBUG_PARAM} -Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=384M ${JAVA_OPTS} -Dfile.encoding=UTF-8 -Dplay.version="${PLAY_VERSION}" -Dsbt.ivy.home=`dirname $0`/../repository -Dplay.home=`dirname $0` -Dsbt.boot.properties=`dirname $0`/sbt/sbt.boot.properties -jar `dirname $0`/sbt/sbt-launch.jar "$@"
+java ${DEBUG_PARAM} -Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=384M ${JAVA_OPTS} -Dfile.encoding=UTF-8 -Dplay.version="${PLAY_VERSION}" -Dsbt.ivy.home=`dirname $0`/../repository -Dplay.home=`dirname $0` -Dsbt.boot.properties=$BOOTPROP`dirname $0`/sbt/sbt.boot.properties -jar `dirname $0`/sbt/sbt-launch.jar "$@"
diff -r --unified play-2.1.3/play play-2.1.3-cygwin/play
--- play-2.1.3/play 2013-09-04 02:44:05 +0000
+++ play-2.1.3-cygwin/play 2013-09-04 13:51:36 +0000
@@ -1,5 +1,23 @@
#! /usr/bin/env sh
+case `uname` in
+ CYGWIN*)
+ function dirname {
+ cygpath -m `command dirname $@`
+ }
+ typeset -fx dirname
+ export BOOTPROP="file:///"
+ ;;
+ MINGW32*)
+ function dirname { (cd `command dirname $@`; pwd -W) }
+ typeset -fx dirname
+ export BOOTPROP="file:///"
+ ;;
+ *)
+ export BOOTPROP=""
+ ;;
+esac
+
PRG="$0"
while [ -h "$PRG" ] ; do
PRG=`readlink "$PRG"`
@@ -61,5 +79,5 @@
fi
else
- "$JAVA" -Dsbt.ivy.home=$dir/repository -Dplay.home=$dir/framework -Dsbt.boot.properties=$dir/framework/sbt/play.boot.properties -jar $dir/framework/sbt/sbt-launch.jar "$@"
+ "$JAVA" -Dsbt.ivy.home=$dir/repository -Dplay.home=$dir/framework -Dsbt.boot.properties=$BOOTPROP$dir/framework/sbt/play.boot.properties -jar $dir/framework/sbt/sbt-launch.jar "$@"
fi
@xak2000
Copy link
Author

xak2000 commented Sep 4, 2013

  1. start mingw32
  2. cd /path/to/play-2.1.3
  3. patch -p1 < /path/to/play_cygwin.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment