diff options
author | kmoore <kmoore@FreeBSD.org> | 2014-09-08 05:21:01 +0800 |
---|---|---|
committer | kmoore <kmoore@FreeBSD.org> | 2014-09-08 05:21:01 +0800 |
commit | e7bb99971d0e09a9723fc64d8e1a45097145d8f8 (patch) | |
tree | 494df5be30f50ac6869d7986fb18d494d5327339 /games | |
parent | b56a1f56df8c61d3ce2755e030a29c7e72eed397 (diff) | |
download | freebsd-ports-gnome-e7bb99971d0e09a9723fc64d8e1a45097145d8f8.tar.gz freebsd-ports-gnome-e7bb99971d0e09a9723fc64d8e1a45097145d8f8.tar.zst freebsd-ports-gnome-e7bb99971d0e09a9723fc64d8e1a45097145d8f8.zip |
- 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
Diffstat (limited to 'games')
-rw-r--r-- | games/minecraft-client/Makefile | 6 | ||||
-rw-r--r-- | games/minecraft-client/files/Notifier.java (renamed from games/minecraft-client/files/Notifer.java) | 8 | ||||
-rw-r--r-- | games/minecraft-client/files/minecraft-client | 41 | ||||
-rw-r--r-- | games/minecraft-client/pkg-plist | 2 |
4 files changed, 17 insertions, 40 deletions
diff --git a/games/minecraft-client/Makefile b/games/minecraft-client/Makefile index b5c2a5bda77f..8c8ff1804444 100644 --- a/games/minecraft-client/Makefile +++ b/games/minecraft-client/Makefile @@ -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> diff --git a/games/minecraft-client/files/Notifer.java b/games/minecraft-client/files/Notifier.java index b31d7fd291d4..416896678207 100644 --- a/games/minecraft-client/files/Notifer.java +++ b/games/minecraft-client/files/Notifier.java @@ -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); diff --git a/games/minecraft-client/files/minecraft-client b/games/minecraft-client/files/minecraft-client index c585fbaae186..b66391b5f1eb 100644 --- a/games/minecraft-client/files/minecraft-client +++ b/games/minecraft-client/files/minecraft-client @@ -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 \ diff --git a/games/minecraft-client/pkg-plist b/games/minecraft-client/pkg-plist index f60eb4264a6a..ed52d70e1298 100644 --- a/games/minecraft-client/pkg-plist +++ b/games/minecraft-client/pkg-plist @@ -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%% |