Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Sep 2014 21:21:02 +0000 (UTC)
From:      Kris Moore <kmoore@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r367607 - in head/games/minecraft-client: . files
Message-ID:  <201409072121.s87LL29u015762@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kmoore
Date: Sun Sep  7 21:21:01 2014
New Revision: 367607
URL: http://svnweb.freebsd.org/changeset/ports/367607
QAT: https://qat.redports.org/buildarchive/r367607/

Log:
  - Update minecraft client to work with the recent 1.8 client patch
  - Change first-run script to only warn the user about changing the profile
  - Bump PORTREV

Added:
  head/games/minecraft-client/files/Notifier.java
     - copied, changed from r367605, head/games/minecraft-client/files/Notifer.java
Deleted:
  head/games/minecraft-client/files/Notifer.java
Modified:
  head/games/minecraft-client/Makefile
  head/games/minecraft-client/files/minecraft-client
  head/games/minecraft-client/pkg-plist

Modified: head/games/minecraft-client/Makefile
==============================================================================
--- head/games/minecraft-client/Makefile	Sun Sep  7 21:17:11 2014	(r367606)
+++ head/games/minecraft-client/Makefile	Sun Sep  7 21:21:01 2014	(r367607)
@@ -3,7 +3,7 @@
 
 PORTNAME=	minecraft-client
 PORTVERSION=	1.7.9
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	games java
 MASTER_SITES=	http://s3.amazonaws.com/Minecraft.Download/launcher/:minecraft \
 		http://media-mcw.cursecdn.com/c/c5/:icon
@@ -41,8 +41,10 @@ do-install:
 		-e 's|PREFIX|${PREFIX}|' \
 		-e 's|JAVA_CMD|${JAVA}|' ${FILESDIR}/minecraft-client \
 		> ${WRKDIR}/minecraft-client
+	${SED} -e 's|%%PREFIX%%|${PREFIX}|' ${FILESDIR}/Notifier.java \
+		> ${WRKDIR}/Notifier.java
 	${INSTALL_SCRIPT} ${WRKDIR}/minecraft-client ${STAGEDIR}${PREFIX}/bin
 	${INSTALL_SCRIPT} ${FILESDIR}/minecraft-runtime ${STAGEDIR}${DATADIR}
-	${INSTALL_DATA} ${FILESDIR}/Notifer.java ${STAGEDIR}${DATADIR}
+	${INSTALL_DATA} ${WRKDIR}/Notifier.java ${STAGEDIR}${DATADIR}
 
 .include <bsd.port.mk>

Copied and modified: head/games/minecraft-client/files/Notifier.java (from r367605, head/games/minecraft-client/files/Notifer.java)
==============================================================================
--- head/games/minecraft-client/files/Notifer.java	Sun Sep  7 20:26:55 2014	(r367605, copy source)
+++ head/games/minecraft-client/files/Notifier.java	Sun Sep  7 21:21:01 2014	(r367607)
@@ -4,7 +4,7 @@ import javax.swing.UIManager;
 import javax.swing.Icon;
 import java.awt.EventQueue;
 
-public class Notifer extends JFrame{
+public class Notifier extends JFrame{
     
     //Using a standard Java icon
     private Icon optionIcon = UIManager.getIcon("FileView.computerIcon");
@@ -16,13 +16,13 @@ public class Notifer extends JFrame{
          public void run()
          {
              //create GUI frame
-             new Notifer().setVisible(true);          
+             new Notifier().setVisible(true);          
          }
      });
               
     }
     
-    public Notifer()
+    public Notifier()
     {
         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         //setTitle("Simple Dialog Box Example");
@@ -31,7 +31,7 @@ public class Notifer extends JFrame{
         setLocationRelativeTo(null); 
         
         // Show our warning to first time users
-        JOptionPane.showMessageDialog(this, "After the first time logging in with a new user, you will need to close the Minecraft Launcher and restart before the game will run." 
+        JOptionPane.showMessageDialog(this, "Before starting MineCraft, be sure to open your Profile and set the Java Executable to: '%%PREFIX%%/share/minecraft-client/minecraft-runtime'" 
                 ,"Important Notification", JOptionPane.PLAIN_MESSAGE);
 
 	System.exit(0);

Modified: head/games/minecraft-client/files/minecraft-client
==============================================================================
--- head/games/minecraft-client/files/minecraft-client	Sun Sep  7 21:17:11 2014	(r367606)
+++ head/games/minecraft-client/files/minecraft-client	Sun Sep  7 21:21:01 2014	(r367607)
@@ -1,43 +1,18 @@
 #!/bin/sh
 export JAVA_HOME=JAVA_HOME
 
-# Look for launcher_profiles to fix
-if [ -e "${HOME}/.minecraft/launcher_profiles.json" ] ; then
-   rm ${HOME}/.minecraft/launcher_profiles.json.new 2>/dev/null
-
-   # Lets make sure we set the fixed java executable script
-   while IFS='' read -r line
-   do
-     # Skip old javaDir lines
-     echo $line | grep -q '"javaDir": "'
-     if [ $? -eq 0 ] ; then continue ; fi
-
-     # If not a name line, add and continue
-     echo $line | grep -q '"name": "'
-     if [ $? -ne 0 ] ; then 
-       printf "%s\n" "$line" >> ${HOME}/.minecraft/launcher_profiles.json.new
-       continue
-     fi
-
-     # Found a profile entry, lets add the correct runtime
-     printf "%s\n" "$line" >> ${HOME}/.minecraft/launcher_profiles.json.new
-     echo '      "javaDir": "/usr/local/share/minecraft-client/minecraft-runtime",' >> ${HOME}/.minecraft/launcher_profiles.json.new
-     
-   done < ${HOME}/.minecraft/launcher_profiles.json
-
-   # See if we have dangling }
-   tail -1 ${HOME}/.minecraft/launcher_profiles.json.new | grep -q "^}"
-   if [ $? -ne 0 ] ; then
-     printf "}" >> ${HOME}/.minecraft/launcher_profiles.json.new
+# The first time warn the user to set the runtime executable in place of java
+if [ ! -e "${HOME}/.minecraft/notified-runtime" ] ; then
+   if [ ! -d "${HOME}/.minecraft" ] ; then
+      mkdir ${HOME}/.minecraft
    fi
+   touch ${HOME}/.minecraft/notified-runtime 2>/dev/null
 
-   mv ${HOME}/.minecraft/launcher_profiles.json.new ${HOME}/.minecraft/launcher_profiles.json
-else
    # No .minecraft dir, lets display the first time notification
-   javac -d /tmp /usr/local/share/minecraft-client/Notifer.java
+   javac -d /tmp /usr/local/share/minecraft-client/Notifier.java
    cd /tmp
-   java Notifer
-   rm Notifer*.class
+   # Run this as a background task, so that it appears over the launcher
+   ( sleep 3; java Notifier ; rm Notifier*.class ) &
 fi
 
 exec ${JAVA_HOME}/bin/java -Djava.nio.file.spi.DefaultFileSystemProvider=sun.nio.fs.BsdFileSystemProvider \

Modified: head/games/minecraft-client/pkg-plist
==============================================================================
--- head/games/minecraft-client/pkg-plist	Sun Sep  7 21:17:11 2014	(r367606)
+++ head/games/minecraft-client/pkg-plist	Sun Sep  7 21:21:01 2014	(r367607)
@@ -1,6 +1,6 @@
 bin/minecraft-client
 %%DATADIR%%/Minecraft.jar
 %%DATADIR%%/minecraft-runtime
-%%DATADIR%%/Notifer.java
+%%DATADIR%%/Notifier.java
 share/pixmaps/minecraft-client.png
 @dirrm %%DATADIR%%



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409072121.s87LL29u015762>