Commit 47a42374 authored by satmandu's avatar satmandu Committed by GitHub

working minecraft (#5899)

* working minecraft (for some)

* use more crew prefix

* Just set HOME in wrapper script

* The hash changes quite regularly, and the package autoupdates on first run.

* Don't store minecraft deb hash, since it changes so often.

* Use SKIP
parent 760827d9
......@@ -3,50 +3,31 @@ require 'package'
class Minecraft < Package
description 'A sandbox video game developed by Mojang Studios AB.'
homepage 'https://minecraft.net'
version '2.2.1867'
version '2.2.3200'
license 'Mojang'
compatibility 'x86_64'
source_url 'https://launcher.mojang.com/download/Minecraft.deb'
source_sha256 '9a8b6b75db199461ae241fbee6adf65fc6636204c58eb79feff968e307464727'
# The minecraft-launcher deb changes often, and we are downloading via https
# so maybe it is ok to trust the source package without further hashing.
source_sha256 'SKIP'
depends_on 'libx11'
depends_on 'jdk8'
depends_on 'gtk2'
depends_on 'gtk3'
depends_on 'libcom_err'
depends_on 'sommelier'
def self.install
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/bin"
FileUtils.cp_r 'opt', "#{CREW_DEST_PREFIX}"
FileUtils.cp_r 'usr/share', "#{CREW_DEST_PREFIX}"
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}"
FileUtils.cp_r '.', "#{CREW_DEST_PREFIX}/"
FileUtils.mv "#{CREW_DEST_PREFIX}/bin/minecraft-launcher", "#{CREW_DEST_PREFIX}/bin/minecraft-launcher.elf"
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/.config/.minecraft"
Dir.chdir "#{CREW_DEST_PREFIX}/bin" do
@launcherscript = <<~EOF
#!/bin/bash
if [[ ! -e /usr/local/.config/minecraft ]]; then
mkdir -pv /usr/local/.config/minecraft
fi
if [[ ! -e $HOME/.var/app/com.mojang.Minecraft ]]; then
mkdir -pv $HOME/.var/app/com.mojang.Minecraft
fi
if [[ -e $HOME/.minecraft ]]; then
if [[ ! -L $HOME/.minecraft ]]; then
cp -rv $HOME/.minecraft/* /usr/local/.config/minecraft
rm -r $HOME/.minecraft
ln -sv /usr/local/.config/minecraft $HOME/.minecraft
fi
else
ln -sv /usr/local/.config/minecraft $HOME/.minecraft
fi
if [[ -e $HOME/.var/app/com.mojang.Minecraft/.minecraft ]]; then
if [[ ! -L $HOME/.var/app/com.mojang.Minecraft/.minecraft ]]; then
cp -rv $HOME/.var/app/com.mojang.Minecraft/.minecraft/* /usr/local/.config/minecraft
rm -r $HOME/.var/app/com.mojang.Minecraft/.minecrft
ln -sv /usr/local/.config/minecraft $HOME/.var/app/com.mojang.Minecraft/.minecraft
fi
else
ln -s /usr/local/.config/minecraft $HOME/.var/app/com.mojang.Minecraft/.minecraft
fi
/usr/local/opt/minecraft-launcher/minecraft-launcher
# Minecraft launcher documentation is at:
# https://minecraft.fandom.com/wiki/Minecraft_Launcher
HOME=#{CREW_PREFIX}/.config #{CREW_PREFIX}/bin/minecraft-launcher.elf --workDir #{CREW_PREFIX}/.config/.minecraft --tmpDir #{CREW_PREFIX}/tmp $@
EOF
IO.write("minecraft-launcher", @launcherscript)
system "chmod +x minecraft-launcher"
......@@ -55,7 +36,7 @@ class Minecraft < Package
def self.postinstall
puts
puts "Your minecraft data is in the usual place, ~/.minecraft.".lightblue
puts "Your minecraft data is in #{CREW_PREFIX}/.config/.minecraft .".lightblue
puts "To launch, just type `minecraft-launcher`.".lightblue
puts
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment