Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Mar 2014 20:23:56 +0000 (UTC)
From:      John Marino <marino@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r349800 - in head/games/minecraft-client: . files
Message-ID:  <201403312023.s2VKNuKt069870@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marino
Date: Mon Mar 31 20:23:56 2014
New Revision: 349800
URL: http://svnweb.freebsd.org/changeset/ports/349800
QAT: https://qat.redports.org/buildarchive/r349800/

Log:
  games/minecraft-client: Upgrade version 1.4.6 -> 1.7.5 and support stage
  
  This poor PR is several months old.  It applied without much trouble, but
  several changes were made:
  
  * Don't use https if http will do (and http works fine)
  * Don't use the launcher URL.  It is always the latest version, so the
    second minecraft is updated, the port will break.  Use an version-based
    URL instead, one that will update with the port version
  * Add stage support
  * At least four stable versions have been released since the PR's version
    of 1.6.2.  Go ahead and update it to the latest stable version of 1.7.5
  * The latest version builds and installs fine, but it was not tested.
    Feedback on the PR indicates 1.6.2 works fine, but currently how well
    version 1.7.5 works is unknown.
  
  PR:		ports/180195
  Submitted by:	"r4721"
  Approved by:	maintainer (Janik Galasso)
  Staged by:	marino@

Added:
  head/games/minecraft-client/files/
  head/games/minecraft-client/files/minecraft-client   (contents, props changed)
Modified:
  head/games/minecraft-client/Makefile
  head/games/minecraft-client/distinfo
  head/games/minecraft-client/pkg-descr
  head/games/minecraft-client/pkg-plist

Modified: head/games/minecraft-client/Makefile
==============================================================================
--- head/games/minecraft-client/Makefile	Mon Mar 31 20:19:29 2014	(r349799)
+++ head/games/minecraft-client/Makefile	Mon Mar 31 20:23:56 2014	(r349800)
@@ -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 sup
 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>

Modified: head/games/minecraft-client/distinfo
==============================================================================
--- head/games/minecraft-client/distinfo	Mon Mar 31 20:19:29 2014	(r349799)
+++ head/games/minecraft-client/distinfo	Mon Mar 31 20:23:56 2014	(r349800)
@@ -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

Added: head/games/minecraft-client/files/minecraft-client
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/games/minecraft-client/files/minecraft-client	Mon Mar 31 20:23:56 2014	(r349800)
@@ -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

Modified: head/games/minecraft-client/pkg-descr
==============================================================================
--- head/games/minecraft-client/pkg-descr	Mon Mar 31 20:19:29 2014	(r349799)
+++ head/games/minecraft-client/pkg-descr	Mon Mar 31 20:23:56 2014	(r349800)
@@ -1,3 +1,3 @@
 This is the popular block building game Minecraft.
 
-WWW: http://www.minecraft.net/
+WWW: https://minecraft.net/

Modified: head/games/minecraft-client/pkg-plist
==============================================================================
--- head/games/minecraft-client/pkg-plist	Mon Mar 31 20:19:29 2014	(r349799)
+++ head/games/minecraft-client/pkg-plist	Mon Mar 31 20:23:56 2014	(r349800)
@@ -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%%



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