updated to jedit_build-20181025 according to patches/macos (Java 11), patches/putenv;
authorwenzelm
Thu Oct 25 22:42:17 2018 +0200 (10 months ago)
changeset 691882fd73a1a0937
parent 69187 d8849cfad60f
child 69189 f714114b0571
updated to jedit_build-20181025 according to patches/macos (Java 11), patches/putenv;
proper update of jEdit environment -- avoid warnings in Java 11;
activate jdk-11+28;
Admin/components/components.sha1
Admin/components/main
src/Pure/Tools/main.scala
src/Tools/jEdit/patches/putenv
     1.1 --- a/Admin/components/components.sha1	Thu Oct 25 21:29:08 2018 +0200
     1.2 +++ b/Admin/components/components.sha1	Thu Oct 25 22:42:17 2018 +0200
     1.3 @@ -134,6 +134,7 @@
     1.4  d806c1c26b571b5b4ef05ea11e8b9cf936518e06  jedit_build-20170319.tar.gz
     1.5  7bcb202e13358dd750e964b2f747664428b5d8b3  jedit_build-20180417.tar.gz
     1.6  23c8a05687d05a6937f7d600ac3aa19e3ce59c9c  jedit_build-20180504.tar.gz
     1.7 +9c64ee0705e5284b507ca527196081979d689519  jedit_build-20181025.tar.gz
     1.8  0bd2bc2d9a491ba5fc8dd99df27c04f11a72e8fa  jfreechart-1.0.14-1.tar.gz
     1.9  8122526f1fc362ddae1a328bdbc2152853186fee  jfreechart-1.0.14.tar.gz
    1.10  d911f63a5c9b4c7335bb73f805cb1711ce017a84  jfreechart-1.5.0.tar.gz
     2.1 --- a/Admin/components/main	Thu Oct 25 21:29:08 2018 +0200
     2.2 +++ b/Admin/components/main	Thu Oct 25 22:42:17 2018 +0200
     2.3 @@ -5,8 +5,8 @@
     2.4  cvc4-1.5-4
     2.5  e-2.0-2
     2.6  isabelle_fonts-20180113
     2.7 -jdk-8u181
     2.8 -jedit_build-20180504
     2.9 +jdk-11+28
    2.10 +jedit_build-20181025
    2.11  jfreechart-1.5.0
    2.12  jortho-1.0-2
    2.13  kodkodi-1.5.2-1
     3.1 --- a/src/Pure/Tools/main.scala	Thu Oct 25 21:29:08 2018 +0200
     3.2 +++ b/src/Pure/Tools/main.scala	Thu Oct 25 22:42:17 2018 +0200
     3.3 @@ -90,14 +90,31 @@
     3.4          }
     3.5  
     3.6  
     3.7 -        /* main startup */
     3.8 +        /* environment */
     3.9  
    3.10 -        update_environment()
    3.11 +        def putenv(name: String, value: String)
    3.12 +        {
    3.13 +          val misc =
    3.14 +            Class.forName("org.gjt.sp.jedit.MiscUtilities", true, ClassLoader.getSystemClassLoader)
    3.15 +          val putenv = misc.getMethod("putenv", classOf[String], classOf[String])
    3.16 +          putenv.invoke(null, name, value)
    3.17 +        }
    3.18 +
    3.19 +        for (name <- List("ISABELLE_HOME", "ISABELLE_HOME_USER", "JEDIT_HOME", "JEDIT_SETTINGS")) {
    3.20 +          putenv(name, File.platform_path(Isabelle_System.getenv(name)))
    3.21 +        }
    3.22 +        putenv("ISABELLE_ROOT", null)
    3.23 +
    3.24 +
    3.25 +        /* properties */
    3.26  
    3.27          System.setProperty("jedit.home", File.platform_path(Path.explode("$JEDIT_HOME/dist")))
    3.28          System.setProperty("scala.home", File.platform_path(Path.explode("$SCALA_HOME")))
    3.29          System.setProperty("scala.color", "false")
    3.30  
    3.31 +
    3.32 +        /* main startup */
    3.33 +
    3.34          val jedit =
    3.35            Class.forName("org.gjt.sp.jedit.jEdit", true, ClassLoader.getSystemClassLoader)
    3.36          val jedit_main = jedit.getMethod("main", classOf[Array[String]])
    3.37 @@ -114,46 +131,4 @@
    3.38      }
    3.39      start()
    3.40    }
    3.41 -
    3.42 -
    3.43 -  /* adhoc update of JVM environment variables */
    3.44 -
    3.45 -  def update_environment()
    3.46 -  {
    3.47 -    val update =
    3.48 -    {
    3.49 -      val isabelle_home = Isabelle_System.getenv("ISABELLE_HOME")
    3.50 -      val isabelle_home_user = Isabelle_System.getenv("ISABELLE_HOME_USER")
    3.51 -      val jedit_home = Isabelle_System.getenv("JEDIT_HOME")
    3.52 -      val jedit_settings = Isabelle_System.getenv("JEDIT_SETTINGS")
    3.53 -
    3.54 -      (env0: Any) => {
    3.55 -        val env = env0.asInstanceOf[java.util.Map[String, String]]
    3.56 -        env.put("ISABELLE_HOME", File.platform_path(isabelle_home))
    3.57 -        env.put("ISABELLE_HOME_USER", File.platform_path(isabelle_home_user))
    3.58 -        env.put("JEDIT_HOME", File.platform_path(jedit_home))
    3.59 -        env.put("JEDIT_SETTINGS", File.platform_path(jedit_settings))
    3.60 -        env.remove("ISABELLE_ROOT")
    3.61 -      }
    3.62 -    }
    3.63 -
    3.64 -    classOf[java.util.Collections].getDeclaredClasses
    3.65 -      .find(c => c.getName == "java.util.Collections$UnmodifiableMap") match
    3.66 -    {
    3.67 -      case Some(c) =>
    3.68 -        val m = c.getDeclaredField("m")
    3.69 -        m.setAccessible(true)
    3.70 -        update(m.get(System.getenv()))
    3.71 -
    3.72 -        if (Platform.is_windows) {
    3.73 -          val ProcessEnvironment = Class.forName("java.lang.ProcessEnvironment")
    3.74 -          val field = ProcessEnvironment.getDeclaredField("theCaseInsensitiveEnvironment")
    3.75 -          field.setAccessible(true)
    3.76 -          update(field.get(null))
    3.77 -        }
    3.78 -
    3.79 -      case None =>
    3.80 -        error("Failed to update JVM environment -- platform incompatibility")
    3.81 -    }
    3.82 -  }
    3.83  }
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/src/Tools/jEdit/patches/putenv	Thu Oct 25 22:42:17 2018 +0200
     4.3 @@ -0,0 +1,51 @@
     4.4 +diff -ru 5.5.0/jEdit/org/gjt/sp/jedit/MiscUtilities.java 5.5.0/jEdit-patched/org/gjt/sp/jedit/MiscUtilities.java
     4.5 +--- 5.5.0/jEdit/org/gjt/sp/jedit/MiscUtilities.java	2018-04-09 01:57:06.000000000 +0200
     4.6 ++++ 5.5.0/jEdit-patched/org/gjt/sp/jedit/MiscUtilities.java	2018-10-25 22:06:22.258705636 +0200
     4.7 +@@ -126,6 +126,20 @@
     4.8 + 	static final Pattern winPattern = Pattern.compile(winPatternString);
     4.9 + 
    4.10 + 
    4.11 ++	private static Map<String,String> environ =
    4.12 ++		Collections.synchronizedMap(new HashMap(System.getenv()));
    4.13 ++
    4.14 ++	public static String getenv(String varName)
    4.15 ++	{
    4.16 ++		return environ.get(varName);
    4.17 ++	}
    4.18 ++
    4.19 ++	public static void putenv(String varName, String value)
    4.20 ++	{
    4.21 ++		environ.put(varName, value);
    4.22 ++	}
    4.23 ++	
    4.24 ++
    4.25 + 	/** A helper function for expandVariables when handling Windows paths on non-windows systems.
    4.26 + 	*/
    4.27 + 	private static String win2unix(String winPath)
    4.28 +@@ -135,7 +149,7 @@
    4.29 + 		if (m.find())
    4.30 + 		{
    4.31 + 			String varName = m.group(2);
    4.32 +-			String expansion = System.getenv(varName);
    4.33 ++			String expansion = getenv(varName);
    4.34 + 			if (expansion != null)
    4.35 + 				return m.replaceFirst(expansion);
    4.36 + 		}
    4.37 +@@ -174,7 +188,7 @@
    4.38 + 				return arg;
    4.39 + 		}
    4.40 + 		String varName = m.group(2);
    4.41 +-		String expansion = System.getenv(varName);
    4.42 ++		String expansion = getenv(varName);
    4.43 + 		if (expansion == null) {
    4.44 + 			if (varName.equalsIgnoreCase("jedit_settings") && jEdit.getSettingsDirectory() != null) {
    4.45 + 				expansion = jEdit.getSettingsDirectory();
    4.46 +@@ -184,7 +198,7 @@
    4.47 + 				varName = varName.toUpperCase();
    4.48 + 				String uparg = arg.toUpperCase();
    4.49 + 				m = p.matcher(uparg);
    4.50 +-				expansion = System.getenv(varName);
    4.51 ++				expansion = getenv(varName);
    4.52 + 			}
    4.53 + 		}
    4.54 + 		if (expansion != null) {