Advertisement
Guest User

Untitled

a guest
Dec 10th, 2017
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 KB | None | 0 0
  1. { stdenv, fetchurl, fetchFromGitHub, cmake, jdk, zlib, file, makeWrapper, xorg, libpulseaudio, qtbase, quazip }:
  2.  
  3. let
  4. libnbt = fetchFromGitHub {
  5. owner = "MultiMC";
  6. repo = "libnbtplusplus";
  7. rev = "4b305bb";
  8. sha256 = "1zj7pxk0g5zl16hrngb4rss00hi019rylin7zgf18kaymc54nbcs";
  9. };
  10. in
  11. stdenv.mkDerivation {
  12. name = "ftb";
  13. src = fetchurl {
  14. fetchurl = "http://ftb.cursecdn.com/FTB2/launcher/FTB_Launcher.jar";
  15. sha256 = "3b1d1a89cfda1dcb2fbebdae91d1eef63a7b1d50340b99896f456ae79f24ea81";
  16. buildInputs = [ cmake qtbase jdk zlib file makeWrapper ];
  17.  
  18. libpath = with xorg; [ libX11 libXext libXcursor libXrandr libXxf86vm libpulseaudio ];
  19. postUnpack = ''
  20. rmdir $sourceRoot/libraries/libnbtplusplus
  21. cp -r ${libnbt} $sourceRoot/libraries/libnbtplusplus
  22. chmod 755 -R $sourceRoot/libraries/libnbtplusplus
  23. mkdir -pv $sourceRoot/build/
  24. cp -v ${quazip.src} $sourceRoot/build/quazip-0.7.1.tar.gz
  25. '';
  26.  
  27. enableParallelBuilding = true;
  28.  
  29. # the install rule tries to bundle ALL deps into the output for portability
  30. installPhase = ''
  31. RESULT=/run/opengl-driver/lib/
  32. for x in $libpath; do
  33. RESULT=$x/lib/:$RESULT
  34. done
  35. mkdir -pv $out/bin/jars $out/lib
  36. cp -v FTB $out/bin/
  37. cp -v jars/*.jar $out/bin/jars/ #*/
  38. cp -v libMultiMC_rainbow.so libMultiMC_nbt++.so libMultiMC_logic.so libMultiMC_gui.so $out/lib
  39. wrapProgram $out/bin/FTB --add-flags "-d \$HOME/.ftb/" --set GAME_LIBRARY_PATH $RESULT --prefix PATH : ${jdk}/bin/
  40. '';
  41.  
  42. meta = with stdenv.lib; {
  43. homepage = https://www.feed-the-beast.com//;
  44. description = "Laucnher for Minecraft";
  45. longDescription = ''
  46. Allows you to play Minecraft modpacks created by FTB and commuinity
  47. '';
  48. platforms = platforms.linux;
  49. license = licenses.cc-by-40;
  50. maintainers = [ maintainers.cleverca22 ];
  51. };
  52. };
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement