Add and update Minecraft launchers

master
Sven Slootweg 6 years ago
parent 29317e9fb7
commit 99609c1b9c

@ -0,0 +1,25 @@
{ stdenv, xorg, jdk, mesa, openal, ... }:
stdenv.mkDerivation {
name = "atlauncher";
src = ./ATLauncher.jar;
buildInputs = with xorg; [ libX11 libXext libXcursor libXrandr libXxf86vm jdk mesa openal ];
buildCommand = ''
mkdir -pv $out/libexec/ $out/bin/
cp -v $src $out/libexec/ATLauncher.jar
RESULT=
for x in $nativeBuildInputs; do
RESULT=$x/lib/:$RESULT
done
cat <<EOF > $out/bin/atlauncher
#!${stdenv.shell}
export LD_LIBRARY_PATH=$RESULT
export GAME_LIBRARY_PATH=$RESULT
exec ${jdk}/bin/java -jar $out/libexec/ATLauncher.jar --working-dir=/home/sven/.atlauncher
EOF
chmod +x $out/bin/atlauncher
'';
}

@ -0,0 +1,67 @@
{ stdenv, fetchFromGitHub, cmake, jdk, zlib, file, makeWrapper, xorg, libpulseaudio, qt5, quazip, ... }:
let
libnbt = fetchFromGitHub {
owner = "MultiMC";
repo = "libnbtplusplus";
rev = "4b305bb";
sha256 = "1zj7pxk0g5zl16hrngb4rss00hi019rylin7zgf18kaymc54nbcs";
};
quazip_ = fetchFromGitHub {
owner = "MultiMC";
repo = "quazip";
rev = "164acc35fd5f77d353161dcf1c4e121bc2ce756f";
sha256 = "0fjcasb3ay3nwg6ss7whm3pigf3asz2c4fhmfb0ldfgd5f2xx93z";
};
in
stdenv.mkDerivation {
name = "multimc-dev";
src = fetchFromGitHub {
owner = "MultiMC";
repo = "MultiMC5";
rev = "b61407a75d06abd61ce89f972581fa36a961d906";
sha256 = "1gqvzwm3j0dw5zxib7chazvc0vdwpvx7rxwxw2b88v0p6i03assa";
};
buildInputs = [ cmake qt5.qtbase jdk zlib file makeWrapper ];
libpath = with xorg; [ libX11 libXext libXcursor libXrandr libXxf86vm libpulseaudio ];
postUnpack = ''
rmdir $sourceRoot/libraries/libnbtplusplus
cp -r ${libnbt} $sourceRoot/libraries/libnbtplusplus
chmod 755 -R $sourceRoot/libraries/libnbtplusplus
rmdir $sourceRoot/libraries/quazip
cp -r ${quazip_} $sourceRoot/libraries/quazip
chmod 755 -R $sourceRoot/libraries/quazip
mkdir -pv $sourceRoot/build/
cp -v ${quazip.src} $sourceRoot/build/quazip-0.7.1.tar.gz
'';
enableParallelBuilding = true;
# the install rule tries to bundle ALL deps into the output for portability
installPhase = ''
RESULT=/run/opengl-driver/lib/
for x in $libpath; do
RESULT=$x/lib/:$RESULT
done
mkdir -pv $out/bin/jars $out/lib
cp -v MultiMC $out/bin/
cp -v jars/*.jar $out/bin/jars/ #*/
cp -v libMultiMC_*.so $out/lib
wrapProgram $out/bin/MultiMC --add-flags "-d \$HOME/.multimc/" --set GAME_LIBRARY_PATH $RESULT --prefix PATH : ${jdk}/bin/
'';
meta = with stdenv.lib; {
homepage = https://multimc.org/;
description = "A free, open source launcher for Minecraft";
longDescription = ''
Allows you to have multiple, separate instances of Minecraft (each with their own mods, texture packs, saves, etc) and helps you manage them and their associated options with a simple interface.
'';
platforms = platforms.linux;
license = licenses.lgpl21Plus;
maintainers = [ maintainers.cleverca22 ];
};
}

@ -1,22 +1,22 @@
{ stdenv, xorg, jdk, mesa, openal, ... }:
{ stdenv, xorg, jdk, mesa, openal, libpulseaudio, ... }:
stdenv.mkDerivation {
name = "technic";
src = ./TechnicLauncher.jar;
buildInputs = with xorg; [ libX11 libXext libXcursor libXrandr libXxf86vm jdk mesa openal ];
buildInputs = with xorg; [ libX11 libXext libXcursor libXrandr libXxf86vm jdk mesa openal libpulseaudio ];
buildCommand = ''
mkdir -pv $out/libexec/ $out/bin/
cp -v $src $out/libexec/TechnicLauncher.jar
RESULT=
for x in $nativeBuildInputs; do
for x in $buildInputs; do
RESULT=$x/lib/:$RESULT
done
cat <<EOF > $out/bin/technic
#!${stdenv.shell}
export LD_LIBRARY_PATH=$RESULT
export GAME_LIBRARY_PATH=$RESULT
export LD_LIBRARY_PATH=/run/opengl-driver/lib:$RESULT
export GAME_LIBRARY_PATH=/run/opengl-driver/lib:$RESULT
exec ${jdk}/bin/java -jar $out/libexec/TechnicLauncher.jar
EOF

Loading…
Cancel
Save