aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Marino <marino@FreeBSD.org>2014-03-31 20:23:56 +0000
committerJohn Marino <marino@FreeBSD.org>2014-03-31 20:23:56 +0000
commit8b192c83a2c3e89796a295a3377a838cda3d2025 (patch)
tree2593cce1d15500dd1a278e77d6735bc54e40d273
parentdbeab6dea0b1761e47a7da37f694fee8fb858a49 (diff)
downloadports-8b192c83a2c3e89796a295a3377a838cda3d2025.tar.gz
ports-8b192c83a2c3e89796a295a3377a838cda3d2025.zip
Notes
-rw-r--r--games/minecraft-client/Makefile113
-rw-r--r--games/minecraft-client/distinfo8
-rw-r--r--games/minecraft-client/files/minecraft-client50
-rw-r--r--games/minecraft-client/pkg-descr2
-rw-r--r--games/minecraft-client/pkg-plist3
5 files changed, 84 insertions, 92 deletions
diff --git a/games/minecraft-client/Makefile b/games/minecraft-client/Makefile
index 255182888d8d..e7604fd3dfda 100644
--- a/games/minecraft-client/Makefile
+++ b/games/minecraft-client/Makefile
@@ -2,13 +2,11 @@
# $FreeBSD$
PORTNAME= minecraft-client
-PORTVERSION= 1.4.6
-PORTREVISION= 1
+PORTVERSION= 1.7.5
CATEGORIES= games java
-MASTER_SITES= http://s3.amazonaws.com/MinecraftDownload/launcher/:minecraft \
+MASTER_SITES= http://s3.amazonaws.com/Minecraft.Download/versions/${PORTVERSION}/:minecraft \
http://media-mcw.cursecdn.com/c/c5/:icon
-DISTNAME= minecraft
-DISTFILES= minecraft.jar:minecraft \
+DISTFILES= ${PORTVERSION}.jar:minecraft \
Grass.png:icon
DIST_SUBDIR= ${PORTNAME}/${PORTVERSION}
EXTRACT_ONLY=
@@ -23,7 +21,7 @@ NATIVE_LIBS_DESC= Enable native libs support
WRKSRC= ${WRKDIR}
NO_BUILD= yes
USE_JAVA= yes
-JAVA_VERSION= 1.6
+JAVA_VERSION= 1.7+
DESKTOP_ENTRIES="Minecraft" \
"Block building game" \
"${PREFIX}/share/pixmaps/minecraft-client.png" \
@@ -31,100 +29,43 @@ DESKTOP_ENTRIES="Minecraft" \
"Game;Java;" \
false
-NO_STAGE= yes
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MNATIVE_LIBS}
USES+= openal:soft
+BUILD_DEPENDS+= ${JAVALIBDIR}/lwjgl/lwjgl_util.jar:${PORTSDIR}/games/lwjgl
RUN_DEPENDS+= ${JAVALIBDIR}/lwjgl/lwjgl_util.jar:${PORTSDIR}/games/lwjgl
JAVA_OS= native
JAVA_VENDOR= openjdk
+PLIST_SUB+= NATIVE=""
.else
JAVA_OS= linux
JAVA_VENDOR= sun
+PLIST_SUB+= NATIVE="@comment "
.endif
do-install:
- ${ECHO_CMD} "#!/bin/sh" > ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "export JAVA_HOME=${JAVA_HOME}" >> ${WRKDIR}/minecraft-client
+ @${ECHO_CMD} "#!/bin/sh" > ${WRKDIR}/minecraft-client
+ @${ECHO_CMD} "export JAVA_HOME=${JAVA_HOME}" >> ${WRKDIR}/minecraft-client
+ @${ECHO_CMD} "exec ${JAVA} -Xmx1024M -Xms1024M -jar ${DATADIR}/Minecraft.jar" >> ${WRKDIR}/minecraft-client
+ @${MKDIR} ${STAGEDIR}${DATADIR}
+ ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/${PORTVERSION}.jar \
+ ${STAGEDIR}${DATADIR}/Minecraft.jar
+ ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/Grass.png \
+ ${STAGEDIR}${PREFIX}/share/pixmaps/minecraft-client.png
.if ${PORT_OPTIONS:MNATIVE_LIBS}
- ${ECHO_CMD} "${ECHO_MSG} \"Note:\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "${ECHO_MSG} \"\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "${ECHO_MSG} \" Please restart this script after inital\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "${ECHO_MSG} \" downloading all the Minecraft files, \"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "${ECHO_MSG} \" some of the libraries will be replaced \"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "${ECHO_MSG} \" with FreeBSD-compiled version. Also, \"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "${ECHO_MSG} \" run the following command to remove \"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "${ECHO_MSG} \" the symlinks before doing any upgrade: \"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "${ECHO_MSG} \"\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "${ECHO_MSG} \"find ~/.minecraft/bin -type l -print0 | \
- ${XARGS} -0 ${RM} -v\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "${ECHO_MSG} \"\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "${ECHO_MSG} \"After deleting symlinks, you will have to\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "${ECHO_MSG} \"force update to get replacements of all\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "${ECHO_MSG} \"files that are normally used via symlinks.\"">> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "MINECRAFT_DIR=\"\$${HOME}/.minecraft\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "BIN=\"\$${MINECRAFT_DIR}/bin\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "NATIVES=\"\$${MINECRAFT_DIR}/bin/natives\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "${MKDIR} \$${NATIVES}" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "jinput=\"${JAVAJARDIR}/jinput/jinput.jar\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "lwjgl=\"${JAVAJARDIR}/lwjgl/lwjgl.jar\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "lwjgl_util=\"${JAVAJARDIR}/lwjgl/lwjgl_util.jar\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "CP=\"\$${MINECRAFT_DIR}/minecraft.jar\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "CP=\"\$${CP}:${JAVAJARDIR}/jinput/jinput.jar\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "CP=\"\$${CP}:${JAVAJARDIR}/jutils/jutils.jar\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "JAVA_IP4=\"-Djava.net.preferIPv4Stack=true\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "JAVA_OPT=\"-Dos.name=Linux\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "JAVA_OPT=\"\$${JAVA_OPT} -Xmx1024M -Xms512M\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "JAVA_OPT=\"\$${JAVA_OPT} \$${JAVA_IP4}\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "JAVA_OPT=\"\$${JAVA_OPT} -classpath \$${CP}\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "for j in jinput.jar lwjgl.jar lwjgl_util.jar" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "do" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} " if [ \( -f \$${BIN}/\$${j} -a ! -L \$${BIN}/\$${j} \) -o \
- \( -L \$${BIN}/\$${j} -a ! -f \$${BIN}/\$${j} \) ]" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} " then" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} " target=\$$(${BASENAME} \$${j} .jar)" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} " eval target=\\\$$\$${target}" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} " ${LN} -snf \$${target} \$${BIN}/\$${j}" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} " fi" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "done" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "lwjgl=\"\$${NATIVES}/liblwjgl.so\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "lwjgl64=\"\$${NATIVES}/liblwjgl64.so\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "if [ \( -f \$${lwjgl} -a ! -L \$${lwjgl} -a \
- -f \$${lwjgl64} -a ! -L \$${lwjgl64} \) -o \
- \( -L \$${lwjgl} -a ! -f \$${lwjgl} -a \
- -L \$${lwjgl64} -a ! -f \$${lwjgl64} \) ]; then" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} " LIBLWJGL=\$$(${FIND} ${LOCALBASE}/lib/lwjgl* \
- -name 'liblwjgl*.so' | ${HEAD} -n 1)" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} " LWJGLSO=\$$(${ECHO} \$${LIBJGL} | ${GREP} \"64\")" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} " if [ \"x\$${LIBWJGLSO}\" = \"x\" ]; then" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} " ${LN} -snf \$${LIBLWJGL} \$${lwjgl}" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} " ${LN} -snf liblwjgl.so \$${lwjgl64}" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} " else" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} " ${LN} -snf \$${LIBLWJGL} \$${lwgjl64}" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} " ${LN} -snf liblwjgl64.so \$${lwgjl}" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} " fi" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "fi" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "libopenal=\"\$${NATIVES}/libopenal.so\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "libopenal64=\"\$${NATIVES}/libopenal64.so\"" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "if [ \( -f \$${libopenal} -a ! -L \$${libopenal} -a \
- -f \$${libopenal64} -a ! -L \$${libopenal64} \) -o \
- \( -L \$${libopenal} -a ! -f \$${libopenal} -a \
- -L \$${libopenal64} -a ! -f \$${libopenal64} \) ]; then" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} " ${LN} -snf ${LOCALBASE}/lib/libopenal.so \$${libopenal}" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} " ${LN} -snf ${LOCALBASE}/lib/libopenal.so \$${libopenal64}" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "fi" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "" >> ${WRKDIR}/minecraft-client
- ${ECHO_CMD} "exec java \$${JAVA_OPT} -jar ${DATADIR}/minecraft.jar" >> ${WRKDIR}/minecraft-client
-.else
- ${ECHO_CMD} "exec java -Xmx1024M -Xms1024M -jar ${DATADIR}/minecraft.jar" >> ${WRKDIR}/minecraft-client
+ @${MKDIR} ${WRKSRC}/native-libs
+ @${CP} ${PREFIX}/lib/lwjgl*/liblwjgl*.so ${WRKSRC}/native-libs
+ @${CP} ${PREFIX}/lib/libopenal.so ${WRKSRC}/native-libs
+ @${JAR} cvf ${WRKSRC}/lwjgl-native-libs.jar -C ${WRKSRC}/native-libs .
+ ${INSTALL_DATA} -m 644 ${WRKSRC}/lwjgl-native-libs.jar \
+ ${STAGEDIR}${DATADIR}
+ ${INSTALL_SCRIPT} ${FILESDIR}/${PORTNAME} ${WRKDIR}
+ ${REINPLACE_CMD} \
+ -e 's|=JAVA_HOME|=${JAVA_HOME}|' \
+ -e 's|PREFIX|${PREFIX}|' \
+ -e 's|JAVA_CMD|${JAVA}|' ${WRKDIR}/minecraft-client
.endif
- ${MKDIR} ${DATADIR}
- ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/minecraft.jar ${DATADIR}/
- ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/Grass.png ${PREFIX}/share/pixmaps/minecraft-client.png
- ${INSTALL_SCRIPT} ${WRKDIR}/minecraft-client ${PREFIX}/bin/
+ ${INSTALL_SCRIPT} ${WRKDIR}/minecraft-client ${STAGEDIR}${PREFIX}/bin
.include <bsd.port.mk>
diff --git a/games/minecraft-client/distinfo b/games/minecraft-client/distinfo
index b00c33ad640c..5c0a34b7f5cb 100644
--- a/games/minecraft-client/distinfo
+++ b/games/minecraft-client/distinfo
@@ -1,4 +1,4 @@
-SHA256 (minecraft-client/1.4.6/minecraft.jar) = 92db974aa759a3f17f3cd61550fa5010e335c57dd813dad9e39b9cc013420a49
-SIZE (minecraft-client/1.4.6/minecraft.jar) = 81938
-SHA256 (minecraft-client/1.4.6/Grass.png) = 438c0f63e379e92af1b5b2e06cc5e3365ee272810af65ebc102304bce4fa8c4b
-SIZE (minecraft-client/1.4.6/Grass.png) = 12586
+SHA256 (minecraft-client/1.7.5/1.7.5.jar) = 5f83b944b59c48ea7fa8f92fefd491ecb6d1e8d6c9b412fc849f6457c8cee27b
+SIZE (minecraft-client/1.7.5/1.7.5.jar) = 5225771
+SHA256 (minecraft-client/1.7.5/Grass.png) = 438c0f63e379e92af1b5b2e06cc5e3365ee272810af65ebc102304bce4fa8c4b
+SIZE (minecraft-client/1.7.5/Grass.png) = 12586
diff --git a/games/minecraft-client/files/minecraft-client b/games/minecraft-client/files/minecraft-client
new file mode 100644
index 000000000000..a21cadaace2e
--- /dev/null
+++ b/games/minecraft-client/files/minecraft-client
@@ -0,0 +1,50 @@
+#!/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.
+
+EOF
+LIBDIR="${HOME}/.minecraft/libraries/"
+
+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
+
+versions_base="${HOME}/.minecraft/versions"
+
+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}
+
+ native_path="${versions_base}/${version}-freebsd/"
+ mkdir -p "${native_path}"
+
+ 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
diff --git a/games/minecraft-client/pkg-descr b/games/minecraft-client/pkg-descr
index b2705cc3461d..c956f8d1b055 100644
--- a/games/minecraft-client/pkg-descr
+++ b/games/minecraft-client/pkg-descr
@@ -1,3 +1,3 @@
This is the popular block building game Minecraft.
-WWW: http://www.minecraft.net/
+WWW: https://minecraft.net/
diff --git a/games/minecraft-client/pkg-plist b/games/minecraft-client/pkg-plist
index 5fa20c548034..21a0c9c4f9fa 100644
--- a/games/minecraft-client/pkg-plist
+++ b/games/minecraft-client/pkg-plist
@@ -1,4 +1,5 @@
bin/minecraft-client
-%%DATADIR%%/minecraft.jar
+%%NATIVE%%%%DATADIR%%/lwjgl-native-libs.jar
+%%DATADIR%%/Minecraft.jar
share/pixmaps/minecraft-client.png
@dirrm %%DATADIR%%