From b3d39fdbdf16c64b0d587e07d95ab1caa6fd8837 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Mon, 21 Nov 2011 21:28:05 +0000 Subject: [games-action/minecraft] Work around the common "invalid server key" bug. svn path=/java-overlay/; revision=8909 --- games-action/minecraft/ChangeLog | 6 ++ games-action/minecraft/Manifest | 7 +- games-action/minecraft/files/native-symlinks.sh | 8 ++ .../minecraft/minecraft-20110223-r4.ebuild | 79 ------------------- .../minecraft/minecraft-20110223-r5.ebuild | 88 ++++++++++++++++++++++ 5 files changed, 106 insertions(+), 82 deletions(-) delete mode 100644 games-action/minecraft/minecraft-20110223-r4.ebuild create mode 100644 games-action/minecraft/minecraft-20110223-r5.ebuild (limited to 'games-action') diff --git a/games-action/minecraft/ChangeLog b/games-action/minecraft/ChangeLog index ce42c06a..dc5ccd4a 100644 --- a/games-action/minecraft/ChangeLog +++ b/games-action/minecraft/ChangeLog @@ -2,6 +2,12 @@ # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 # $Header: $ +*minecraft-20110223-r5 (21 Nov 2011) + + 21 Nov 2011; James Le Cuirot + -minecraft-20110223-r4.ebuild, +minecraft-20110223-r5.ebuild: + Work around the common "invalid server key" bug. + *minecraft-20110223-r4 (19 Nov 2011) 19 Nov 2011; James Le Cuirot diff --git a/games-action/minecraft/Manifest b/games-action/minecraft/Manifest index 48437136..2d6fcbc7 100644 --- a/games-action/minecraft/Manifest +++ b/games-action/minecraft/Manifest @@ -1,6 +1,7 @@ AUX minecraft.png 20345 RMD160 f35196576246eff41f0e1383829a954cb835a5f6 SHA1 e01d89bab2f28f7b2436b1d379bad311d214deb9 SHA256 5ee86aeb4185637ea901f80e698e64d07dd138448fc4ff00d96d5992792a806b -AUX native-symlinks.sh 807 RMD160 64b6b71b24cfbd5095d3a20de1666321390c68ef SHA1 22c8b5d7412550306c5798509322bbbe25b64c48 SHA256 db6346a1b34fed90ce960d03e3fb02a84ece016a1311f238d9f6b01ccc599122 +AUX native-symlinks.sh 1159 RMD160 a08cf759988e89ed34be246d4d54cbae18e73092 SHA1 741e146479053a66487f485f0280eb7f323cea9b SHA256 0d88e4611b9c744653ca6980142cfd8e8a7cbf0610865770b591d513ce439c9d +DIST abp.class 18710 RMD160 8306ed197ff1c25a0c2af114722a47a90ce055f7 SHA1 669a36ab6f63e0b8192395b40f5a3a2af92d3a21 SHA256 ccdc2a825bbe8474dad21eebe719f92beb79c8a005ee38a5c76374d45fc515d6 DIST minecraft-20110223.jar 89406 RMD160 ffa47adc3b4f322c8eba2aad178664ceebbb2d22 SHA1 80055b408e0cbe42ca2fe29667c5616153cff634 SHA256 d275a1895b5d18e5a913d637d941cc1df83097add76103c2e02e4e513ceb982a -EBUILD minecraft-20110223-r4.ebuild 2352 RMD160 a3814bfb7825a003aefef79a6b491a8a7e4e87a3 SHA1 08d3340ac9fb777a58cd2fea3a61ac10ea6f8aac SHA256 f4ce41f4694ea81a1a9d823d0dd48ab00186c33c1d5249bb42f0ac7347efa867 -MISC ChangeLog 3408 RMD160 c89ab2c0ddc296ead64a34ca60cc81e8b03806b4 SHA1 3c53e6384c2f187adf36fe8f86cdca213ca42a2d SHA256 c6dc11e0ba85dfba551ac9304abbf4fb19ccc1ca81ee42241f570f9257b8ead7 +EBUILD minecraft-20110223-r5.ebuild 2775 RMD160 6ef4a324df444128aab705270e0fd584a4f2aaf2 SHA1 ad57037fb43eb44ae1d084c3b43f90321dc49b86 SHA256 30d46b394b5e3fd93759fb6a1ebc9782f987f5a7e337c3bf033fec1792d69e5e +MISC ChangeLog 3619 RMD160 89cd473f6be4798f8210576cdab93e8dcc4a206d SHA1 7ab3dba0222b8b0ed48cdb1251596da89baa3cda SHA256 02b5803ee0a5027b1ebb7368387c5471bb3d6c5c0264b72439558fc15559d43d MISC metadata.xml 525 RMD160 499e41f9c749ddc7d030d0ef07be4b75586a8628 SHA1 f60ada485166ca0f1aacecac04cc5aadcd298de0 SHA256 e9e868a41f0ca909166b4977b6188316196ef4016f0035f2ec18b3a2696ec918 diff --git a/games-action/minecraft/files/native-symlinks.sh b/games-action/minecraft/files/native-symlinks.sh index 4fdacb08..6e1f3397 100644 --- a/games-action/minecraft/files/native-symlinks.sh +++ b/games-action/minecraft/files/native-symlinks.sh @@ -21,3 +21,11 @@ chmod a-w "${NATIVES}" # Create a dummy lwjgl.jar to fool MCPatcher. touch "${HOME}/.minecraft/bin/lwjgl.jar" +# Work around the common "invalid server key" bug. +MC_JAR="${HOME}/.minecraft/bin/minecraft.jar" + +if [[ -f "${MC_JAR}" ]] && [[ $(md5sum "${MC_JAR}" | head -c32) == "3820d222b95d0b8c520d9596a756a6e6" ]]; then + echo 'Broken minecraft.jar detected. Working around "invalid server key" bug.' >&2 + jar uMf "${MC_JAR}" -C /usr/share/minecraft abp.class +fi + diff --git a/games-action/minecraft/minecraft-20110223-r4.ebuild b/games-action/minecraft/minecraft-20110223-r4.ebuild deleted file mode 100644 index 9150e058..00000000 --- a/games-action/minecraft/minecraft-20110223-r4.ebuild +++ /dev/null @@ -1,79 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: $ - -EAPI="2" -inherit eutils games java-pkg-2 - -DESCRIPTION="A game about placing blocks while running from skeletons. Or something like that..." -HOMEPAGE="http://www.minecraft.net" -SRC_URI="http://www.minecraft.net/download/minecraft.jar -> $P.jar" -LICENSE="as-is" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="ipv6" -RESTRICT="mirror" - -# lwjgl 2.4 is used by upstream but we're using 2.6+ because of reports -# that it fixes a bug where keyboard controls get stuck. You can -# determine what version upstream uses by looking for the version number -# near the top of... -# -# javap -classpath lwjgl.jar -c org.lwjgl.Sys - -DEPEND=">=virtual/jdk-1.5" # Only need this for jar. - -RDEPEND=">=dev-java/jinput-1_pre20100416 - >=dev-java/lwjgl-2.7.1-r1:2.7 - || ( >=dev-java/icedtea-bin-6[X] - >=dev-java/icedtea-6 - >=dev-java/oracle-jre-bin-1.6[X] - >=dev-java/oracle-jdk-bin-1.6[X] - >=dev-java/sun-jre-bin-1.6[X] - >=dev-java/sun-jdk-1.6[X] )" - -S="${WORKDIR}" - -pkg_setup() { - java-pkg-2_pkg_setup - games_pkg_setup -} - -src_prepare() { - # Don't download or install JAR libraries. Hacky but works. - sed -i "s/lwjgl.jar, jinput.jar, lwjgl_util.jar,/ /g" \ - net/minecraft/GameUpdater.class || die - - # Recreate JAR. - jar cfe "${PN}.jar" net.minecraft.MinecraftLauncher LZMA/ net/ || die -} - -src_install() { - java-pkg_register-dependency jinput,lwjgl-2.7 - java-pkg_dojar "${PN}.jar" - - local ARGS - use ipv6 || ARGS="-Djava.net.preferIPv4Stack=true" - - # Launching with -jar seems to create classpath problems. - java-pkg_dolauncher "${PN}" -into "${GAMES_PREFIX}" \ - -pre "${FILESDIR}/native-symlinks.sh" \ - --java_args "-Xmx1024M -Xms512M ${ARGS}" \ - --main net.minecraft.MinecraftLauncher - - doicon "${FILESDIR}/${PN}.png" || die - make_desktop_entry "${PN}" "Minecraft" - - prepgamesdirs -} - -pkg_postinst() { - ewarn "We have patched Minecraft to use libraries built from source for your" - ewarn "own system. If you encounter problems, PLEASE also try the official" - ewarn "version before reporting them upstream. Make sure that you delete" - ewarn "~/.minecraft/bin/version and ~/.minecraft/bin/natives before using the" - ewarn "official version so that the libraries can be downloaded by the game." - echo - - games_pkg_postinst -} diff --git a/games-action/minecraft/minecraft-20110223-r5.ebuild b/games-action/minecraft/minecraft-20110223-r5.ebuild new file mode 100644 index 00000000..0bb4af17 --- /dev/null +++ b/games-action/minecraft/minecraft-20110223-r5.ebuild @@ -0,0 +1,88 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="2" +inherit eutils games java-pkg-2 + +DESCRIPTION="A game about placing blocks while running from skeletons. Or something like that..." +HOMEPAGE="http://www.minecraft.net" +SRC_URI="http://www.minecraft.net/download/minecraft.jar -> $P.jar + http://www.sk89q.com/content/2011/11/abp.class" +LICENSE="as-is" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="ipv6" +RESTRICT="mirror" + +# lwjgl 2.4 is used by upstream but we're using 2.6+ because of reports +# that it fixes a bug where keyboard controls get stuck. You can +# determine what version upstream uses by looking for the version number +# near the top of... +# +# javap -classpath lwjgl.jar -c org.lwjgl.Sys + +DEPEND=">=virtual/jdk-1.5" # Only need this for jar. + +RDEPEND=">=dev-java/jinput-1_pre20100416 + >=dev-java/lwjgl-2.7.1-r1:2.7 + || ( >=dev-java/icedtea-bin-6[X] + >=dev-java/icedtea-6 + >=dev-java/oracle-jre-bin-1.6[X] + >=dev-java/oracle-jdk-bin-1.6[X] + >=dev-java/sun-jre-bin-1.6[X] + >=dev-java/sun-jdk-1.6[X] ) + virtual/jdk" # For fixing "invalid server key" bug with jar. + +S="${WORKDIR}" + +pkg_setup() { + java-pkg-2_pkg_setup + games_pkg_setup +} + +src_prepare() { + # Don't download or install JAR libraries. Hacky but works. + sed -i "s/lwjgl.jar, jinput.jar, lwjgl_util.jar,/ /g" \ + net/minecraft/GameUpdater.class || die + + # Recreate JAR. + jar cfe "${PN}.jar" net.minecraft.MinecraftLauncher LZMA/ net/ || die +} + +src_install() { + java-pkg_register-dependency jinput,lwjgl-2.7 + java-pkg_dojar "${PN}.jar" + + local ARGS + use ipv6 || ARGS="-Djava.net.preferIPv4Stack=true" + + # Launching with -jar seems to create classpath problems. + java-pkg_dolauncher "${PN}" -into "${GAMES_PREFIX}" \ + -pre "${FILESDIR}/native-symlinks.sh" \ + --java_args "-Xmx1024M -Xms512M ${ARGS}" \ + --main net.minecraft.MinecraftLauncher + + doicon "${FILESDIR}/${PN}.png" || die + make_desktop_entry "${PN}" "Minecraft" + + insinto "/usr/share/${PN}" + doins "${DISTDIR}/abp.class" || die + + prepgamesdirs +} + +pkg_postinst() { + ewarn "We have patched Minecraft to use libraries built from source for your" + ewarn "own system. If you encounter problems, PLEASE also try the official" + ewarn "version before reporting them upstream. Make sure that you delete" + ewarn "~/.minecraft/bin/version and ~/.minecraft/bin/natives before using the" + ewarn "official version so that the libraries can be downloaded by the game." + echo + ewarn 'After updating to 1.0.0 or starting the game for the first time, you may' + ewarn 'receive an "invalid server key" error when connecting to a server. Simply' + ewarn 'quit the game and a fix will be applied the next time you start it.' + echo + + games_pkg_postinst +} -- cgit v1.2.3-65-gdbad