sane environment defaults for Mac OS X, based on former App1/script -- e.g. relevant for MacTeX PATH;
authorwenzelm
Fri Jun 27 11:30:42 2014 +0200 (2014-06-27)
changeset 574119444489766a1
parent 57394 7621a3b42ce7
child 57412 b441f330078b
sane environment defaults for Mac OS X, based on former App1/script -- e.g. relevant for MacTeX PATH;
Admin/MacOS/Info.plist-part2
lib/scripts/getsettings
src/Pure/System/isabelle_system.scala
     1.1 --- a/Admin/MacOS/Info.plist-part2	Fri Jun 27 00:21:11 2014 +0100
     1.2 +++ b/Admin/MacOS/Info.plist-part2	Fri Jun 27 11:30:42 2014 +0200
     1.3 @@ -1,4 +1,5 @@
     1.4  <string>-Disabelle.home=$APP_ROOT/Contents/Resources/{ISABELLE_NAME}</string>
     1.5 +<string>-Disabelle.app=true</string>
     1.6  </array>
     1.7  <key>JVMArguments</key>
     1.8  <array>
     2.1 --- a/lib/scripts/getsettings	Fri Jun 27 00:21:11 2014 +0100
     2.2 +++ b/lib/scripts/getsettings	Fri Jun 27 11:30:42 2014 +0200
     2.3 @@ -16,6 +16,11 @@
     2.4    function tar() { /usr/bin/gnutar "$@"; }
     2.5  fi
     2.6  
     2.7 +#sane environment defaults (notably on Mac OS X)
     2.8 +if [ "$ISABELLE_APP" = true -a -x /usr/libexec/path_helper ]; then
     2.9 +  eval $(/usr/libexec/path_helper -s)
    2.10 +fi
    2.11 +
    2.12  #Cygwin vs. POSIX
    2.13  if [ "$OSTYPE" = cygwin ]
    2.14  then
     3.1 --- a/src/Pure/System/isabelle_system.scala	Fri Jun 27 00:21:11 2014 +0100
     3.2 +++ b/src/Pure/System/isabelle_system.scala	Fri Jun 27 11:30:42 2014 +0200
     3.3 @@ -75,12 +75,22 @@
     3.4        }
     3.5  
     3.6        set_cygwin_root()
     3.7 -      val env0 = sys.env + ("ISABELLE_JDK_HOME" -> posix_path(jdk_home()))
     3.8 +
     3.9 +      val env =
    3.10 +      {
    3.11 +        val user_home = System.getProperty("user.home", "")
    3.12 +        val isabelle_app = System.getProperty("isabelle.app", "")
    3.13  
    3.14 -      val user_home = System.getProperty("user.home", "")
    3.15 -      val env =
    3.16 -        if (user_home == "" || env0.isDefinedAt("HOME")) env0
    3.17 -        else env0 + ("HOME" -> user_home)
    3.18 +        val env0 = sys.env + ("ISABELLE_JDK_HOME" -> posix_path(jdk_home()))
    3.19 +        val env1 =
    3.20 +          if (user_home == "" || env0.isDefinedAt("HOME")) env0
    3.21 +          else env0 + ("HOME" -> user_home)
    3.22 +        val env2 =
    3.23 +          if (isabelle_app == "") env1
    3.24 +          else env1 + ("ISABELLE_APP" -> "true")
    3.25 +
    3.26 +        env2
    3.27 +      }
    3.28  
    3.29        val system_home =
    3.30          if (isabelle_home != null && isabelle_home != "") isabelle_home