Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { stdenv, fetchurl, fetchFromGitHub, cmake, jdk, zlib, file, makeWrapper, xorg, libpulseaudio, qtbase, quazip }:
- let
- libnbt = fetchFromGitHub {
- owner = "MultiMC";
- repo = "libnbtplusplus";
- rev = "4b305bb";
- sha256 = "1zj7pxk0g5zl16hrngb4rss00hi019rylin7zgf18kaymc54nbcs";
- };
- in
- stdenv.mkDerivation {
- name = "ftb";
- src = fetchurl {
- fetchurl = "http://ftb.cursecdn.com/FTB2/launcher/FTB_Launcher.jar";
- sha256 = "3b1d1a89cfda1dcb2fbebdae91d1eef63a7b1d50340b99896f456ae79f24ea81";
- buildInputs = [ cmake 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
- 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 FTB $out/bin/
- cp -v jars/*.jar $out/bin/jars/ #*/
- cp -v libMultiMC_rainbow.so libMultiMC_nbt++.so libMultiMC_logic.so libMultiMC_gui.so $out/lib
- wrapProgram $out/bin/FTB --add-flags "-d \$HOME/.ftb/" --set GAME_LIBRARY_PATH $RESULT --prefix PATH : ${jdk}/bin/
- '';
- meta = with stdenv.lib; {
- homepage = https://www.feed-the-beast.com//;
- description = "Laucnher for Minecraft";
- longDescription = ''
- Allows you to play Minecraft modpacks created by FTB and commuinity
- '';
- platforms = platforms.linux;
- license = licenses.cc-by-40;
- maintainers = [ maintainers.cleverca22 ];
- };
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement