FreeBSD Bugzilla – Attachment 143945 Details for
Bug 189028
games/minecraft-client requires custom script from Mojang launcher
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch against svn ports head, based and copied on previous attachment
minecraft_1.7.9_2.diff (text/plain), 7.46 KB, created by
Sean Bruno
on 2014-06-19 23:10:38 UTC
(
hide
)
Description:
Patch against svn ports head, based and copied on previous attachment
Filename:
MIME Type:
Creator:
Sean Bruno
Created:
2014-06-19 23:10:38 UTC
Size:
7.46 KB
patch
obsolete
>Index: Makefile >=================================================================== >--- Makefile (revision 28161) >+++ Makefile (working copy) >@@ -3,6 +3,7 @@ > > PORTNAME= minecraft-client > PORTVERSION= 1.7.9 >+PORTREVISION= 2 > CATEGORIES= games java > MASTER_SITES= http://s3.amazonaws.com/Minecraft.Download/launcher/:minecraft \ > http://media-mcw.cursecdn.com/c/c5/:icon >@@ -14,12 +15,15 @@ > MAINTAINER= ports@FreeBSD.org > COMMENT= Client for the block building game > >+RUN_DEPENDS= ${JAVALIBDIR}/lwjgl/lwjgl.jar:${PORTSDIR}/games/lwjgl \ >+ bash:${PORTSDIR}/shells/bash >+ > WRKSRC= ${WRKDIR} > NO_BUILD= yes > USE_JAVA= yes > JAVA_OS= native > JAVA_VENDOR= openjdk >-JAVA_VERSION= 1.7+ >+JAVA_VERSION= 1.8+ > DESKTOP_ENTRIES="Minecraft" \ > "Block building game" \ > "${PREFIX}/share/pixmaps/minecraft-client.png" \ >@@ -38,5 +42,7 @@ > -e 's|JAVA_CMD|${JAVA}|' ${FILESDIR}/minecraft-client \ > > ${WRKDIR}/minecraft-client > ${INSTALL_SCRIPT} ${WRKDIR}/minecraft-client ${STAGEDIR}${PREFIX}/bin >+ ${INSTALL_SCRIPT} ${FILESDIR}/minecraft-runtime ${STAGEDIR}${DATADIR} >+ ${INSTALL_DATA} ${FILESDIR}/Notifer.java ${STAGEDIR}${DATADIR} > > .include <bsd.port.mk> >Index: files/minecraft-client >=================================================================== >--- files/minecraft-client (revision 28161) >+++ files/minecraft-client (working copy) >@@ -1,50 +1,44 @@ > #!/bin/sh > export JAVA_HOME=JAVA_HOME >-/bin/cat << EOF >-When starting a version for the first time, select the version you want in your >-profile, start Minecraft, close Minecraft and launcher, run minecraft-client >-again, then select version "x-freebsd" in your profile. > >-If you run versions older than 1.6.1 in the Launcher, add >--Djava.net.preferIPv4Stack=true to JVM Arguments in the profile. >+# Look for launcher_profiles to fix >+if [ -e "${HOME}/.minecraft/launcher_profiles.json" ] ; then >+ rm ${HOME}/.minecraft/launcher_profiles.json.new 2>/dev/null > >-EOF >-LIBDIR="${HOME}/.minecraft/libraries/" >+ # 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 > >-for i in ${LIBDIR}/org/lwjgl/lwjgl/lwjgl-platform/*/lwjgl-platform-*-natives-linux.jar; do >- if [ -f "${i}" ]; then >- cmp -s "PREFIX/share/minecraft-client/lwjgl-native-libs.jar" "${i%linux.jar}freebsd.jar" >- if [ $? -ne 0 ]; then >- cp -v "PREFIX/share/minecraft-client/lwjgl-native-libs.jar" "${i%linux.jar}freebsd.jar" >- fi >- fi >-done >+ # 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 > >-versions_base="${HOME}/.minecraft/versions" >+ # 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 > >-for i in ${HOME}/.minecraft/versions/*; do >- if [ "${i}" != "${i%-freebsd}" -o "${i}" == "${HOME}"'/.minecraft/versions/*' ]; then continue; fi >- OLDIFS=$IFS >- IFS=/ >- for x in ${i}; do >- version="${x}" >- done >- IFS=${OLDIFS} >+ # 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 >+ fi > >- native_path="${versions_base}/${version}-freebsd/" >- mkdir -p "${native_path}" >+ 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 >+ cd /tmp >+ java Notifer >+ rm Notifer*.class >+fi > >- vendor_file="${versions_base}/${version}/${version}" >- native_file="${native_path}/${version}-freebsd" >- >- if [ -f "${vendor_file}.jar" -a ! -f "${native_file}.jar" ]; then >- cp -v "${vendor_file}.jar" "${native_file}.jar" >- fi >- if [ -f "${vendor_file}.json" -a ! -f "${native_file}.json" ]; then >- sed -e '/"id"/s/",/-freebsd",/' -e '/lwjgl/,/extract/s/natives-linux/natives-freebsd/' \ >- < "${vendor_file}.json" > "${native_file}.json" >- fi >-done >- >-exec JAVA_CMD -Djava.nio.file.spi.DefaultFileSystemProvider=sun.nio.fs.BsdFileSystemProvider \ >- -Dos.name=Linux -jar PREFIX/share/minecraft-client/Minecraft.jar >+exec ${JAVA_HOME}/bin/java -Djava.nio.file.spi.DefaultFileSystemProvider=sun.nio.fs.BsdFileSystemProvider \ >+ -Dos.name=Linux -jar /usr/local/share/minecraft-client/Minecraft.jar >Index: files/Notifer.java >=================================================================== >--- files/Notifer.java (revision 0) >+++ files/Notifer.java (revision 28165) >@@ -0,0 +1,40 @@ >+import javax.swing.JFrame; >+import javax.swing.JOptionPane; >+import javax.swing.UIManager; >+import javax.swing.Icon; >+import java.awt.EventQueue; >+ >+public class Notifer extends JFrame{ >+ >+ //Using a standard Java icon >+ private Icon optionIcon = UIManager.getIcon("FileView.computerIcon"); >+ >+ public static void main(String[] args) { >+ >+ EventQueue.invokeLater(new Runnable() >+ { >+ public void run() >+ { >+ //create GUI frame >+ new Notifer().setVisible(true); >+ } >+ }); >+ >+ } >+ >+ public Notifer() >+ { >+ setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); >+ //setTitle("Simple Dialog Box Example"); >+ //setSize(500,500); >+ >+ 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." >+ ,"Important Notification", JOptionPane.PLAIN_MESSAGE); >+ >+ System.exit(0); >+ >+ } >+} >Index: files/minecraft-runtime >=================================================================== >--- files/minecraft-runtime (revision 0) >+++ files/minecraft-runtime (revision 28165) >@@ -0,0 +1,46 @@ >+#!/usr/local/bin/bash >+ >+LWJGL_JLP_OVRD="/usr/local/lib/lwjgl2.9.1" >+LWJGL_OVRD="/usr/local/share/java/classes/lwjgl/lwjgl.jar" >+LWJGL_UTIL_OVRD="/usr/local/share/java/classes/lwjgl/lwjgl_util.jar" >+ >+export JAVA_HOME=/usr/local/openjdk8 >+ >+build_classpath() { >+ j=0 >+ ocp=`echo ${1} | sed 's/:/ /g'` >+ for p in ${ocp} >+ do >+ if [[ $p == *lwjgl-* ]] >+ then >+ ncp[$j]=${LWJGL_OVRD} >+ elif [[ $p == *lwjgl_util* ]] >+ then >+ ncp[$j]=${LWJGL_UTIL_OVRD} >+ else >+ ncp[$j]=${p} >+ fi >+ j=$(( j + 1 )) >+ done >+ >+ cp=`echo ${ncp[@]} | sed 's/ /:/g'` >+} >+ >+ >+i=0 >+for var in "${@}" >+do >+ if [[ "$var" == -Djava.library* ]] >+ then >+ args[$i]="-Djava.library.path=${LWJGL_JLP_OVRD}" >+ elif [[ "$var" == *lwjgl_util* ]] >+ then >+ build_classpath "${var}" >+ args[$i]="$cp" >+ else >+ args[$i]=$var >+ fi >+ i=$(( i + 1 )) >+done >+ >+${JAVA_HOME}/jre/bin/java ${args[@]} >Index: pkg-plist >=================================================================== >--- pkg-plist (revision 28161) >+++ pkg-plist (working copy) >@@ -1,4 +1,6 @@ > bin/minecraft-client > %%DATADIR%%/Minecraft.jar >+%%DATADIR%%/minecraft-runtime >+%%DATADIR%%/Notifer.java > share/pixmaps/minecraft-client.png > @dirrm %%DATADIR%%
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 189028
:
142065
| 143945 |
143996