ports/devel/sbt/files/patch-bin_sbt
2019-10-15 08:58:50 +00:00

57 lines
2.3 KiB
Text

--- bin/sbt.orig 2019-10-14 14:34:15 UTC
+++ bin/sbt
@@ -76,7 +76,7 @@ cygwinpath() {
declare -r sbt_bin_dir="$(dirname "$(realpathish "$0")")"
-declare -r sbt_home="$(dirname "$sbt_bin_dir")"
+declare -r sbt_home="$sbt_bin_dir"
echoerr () {
echo 1>&2 "$@"
@@ -89,7 +89,7 @@ dlog () {
}
jar_file () {
- echo "$(cygwinpath "${sbt_home}/bin/sbt-launch.jar")"
+ echo "$(cygwinpath "${sbt_home}/sbt-launch.jar")"
}
acquire_sbt_jar () {
@@ -281,14 +281,14 @@ getPreloaded() {
}
syncPreloaded() {
- local source_preloaded="$sbt_home/lib/local-preloaded/"
+ local source_preloaded="$sbt_home/local-preloaded/"
local target_preloaded="$(getPreloaded)"
if [[ "$init_sbt_version" == "" ]]; then
# FIXME: better $init_sbt_version detection
init_sbt_version="$(ls -1 "$source_preloaded/org/scala-sbt/sbt/")"
fi
[[ -f "$target_preloaded/org.scala-sbt/sbt/$init_sbt_version/jars/sbt.jar" ]] || {
- # lib/local-preloaded exists (This is optional)
+ # local-preloaded exists (This is optional)
[[ -d "$source_preloaded" ]] && {
command -v rsync >/dev/null 2>&1 && {
mkdir -p "$target_preloaded"
@@ -408,8 +408,8 @@ run() {
declare -r noshare_opts="-Dsbt.global.base=project/.sbtboot -Dsbt.boot.directory=project/.boot -Dsbt.ivy.home=project/.ivy"
declare -r sbt_opts_file=".sbtopts"
-declare -r etc_sbt_opts_file="/etc/sbt/sbtopts"
-# this allows /etc/sbt/sbtopts location to be changed
+declare -r etc_sbt_opts_file="%%PREFIX%%/etc/sbt/sbtopts"
+# this allows %%PREFIX%%/etc/sbt/sbtopts location to be changed
declare -r etc_file="${SBT_ETC_FILE:-$etc_sbt_opts_file}"
declare -r dist_sbt_opts_file="${sbt_home}/conf/sbtopts"
declare -r win_sbt_opts_file="${sbt_home}/conf/sbtconfig.txt"
@@ -459,7 +459,7 @@ Usage: `basename "$0"` [options]
SBT_OPTS environment variable, if unset uses "$default_sbt_opts"
.sbtopts if this file exists in the current directory, its contents
are prepended to the runner args
- /etc/sbt/sbtopts if this file exists, it is prepended to the runner args
+ %%PREFIX%%/etc/sbt/sbtopts if this file exists, it is prepended to the runner args
-Dkey=val pass -Dkey=val directly to the java runtime
-J-X pass option -X directly to the java runtime
(-J is stripped)