nixpkgs/pkgs/games/multimc/default.nix

57 lines
1.9 KiB
Nix
Raw Normal View History

2017-02-03 16:20:25 +01:00
{ stdenv, fetchFromGitHub, cmake, jdk, zlib, file, makeWrapper, xorg, libpulseaudio, qtbase, quazip }:
2015-11-25 11:34:26 +01:00
let
libnbt = fetchFromGitHub {
owner = "MultiMC";
repo = "libnbtplusplus";
2017-03-31 23:36:18 +02:00
rev = "4b305bb";
sha256 = "1zj7pxk0g5zl16hrngb4rss00hi019rylin7zgf18kaymc54nbcs";
2015-11-25 11:34:26 +01:00
};
in
stdenv.mkDerivation {
2017-03-31 23:36:18 +02:00
name = "multimc-0.5.1";
2015-11-25 11:34:26 +01:00
src = fetchFromGitHub {
owner = "MultiMC";
repo = "MultiMC5";
2017-03-31 23:36:18 +02:00
rev = "0.5.1";
sha256 = "0wmlnwcq3gxrbmc53j96aa64pp1kmnlxiifhzngcb5kfmbbc8a20";
2015-11-25 11:34:26 +01:00
};
2017-02-03 16:20:25 +01:00
buildInputs = [ cmake qtbase jdk zlib file makeWrapper ];
2015-11-25 11:34:26 +01:00
libpath = with xorg; [ libX11 libXext libXcursor libXrandr libXxf86vm libpulseaudio ];
postUnpack = ''
2017-03-31 23:36:18 +02:00
rmdir $sourceRoot/libraries/libnbtplusplus
cp -r ${libnbt} $sourceRoot/libraries/libnbtplusplus
chmod 755 -R $sourceRoot/libraries/libnbtplusplus
2016-03-02 18:48:27 +01:00
mkdir -pv $sourceRoot/build/
2017-02-03 16:20:25 +01:00
cp -v ${quazip.src} $sourceRoot/build/quazip-0.7.1.tar.gz
2015-11-25 11:34:26 +01:00
'';
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/ #*/
2017-03-31 23:36:18 +02:00
cp -v libMultiMC_rainbow.so libMultiMC_nbt++.so libMultiMC_logic.so libMultiMC_gui.so $out/lib
wrapProgram $out/bin/MultiMC --add-flags "-d \$HOME/.multimc/" --set GAME_LIBRARY_PATH $RESULT --prefix PATH : ${jdk}/bin/
2015-11-25 11:34:26 +01:00
'';
meta = with stdenv.lib; {
2015-11-25 11:34:26 +01:00
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 ];
2015-11-25 11:34:26 +01:00
};
}