Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. { stdenv, fetchurl, makeDesktopItem
  2. , jre, libX11, libXext, libXcursor, libXrandr, libXxf86vm
  3. , openjdk
  4. , libGLU_combined, openal
  5. , useAlsa ? false, alsaOss ? null }:
  6. with stdenv.lib;
  7.  
  8. assert useAlsa -> alsaOss != null;
  9.  
  10. let
  11. desktopItem = makeDesktopItem {
  12. name = "atlauncher";
  13. exec = "atlauncher";
  14. icon = "atlauncher";
  15. comment = "Free launcher for Minecraft that allows you to download modpacks.";
  16. desktopName = "ATLauncher";
  17. genericName = "atlauncher";
  18. categories = "Game;";
  19. };
  20.  
  21. in stdenv.mkDerivation {
  22. name = "atlauncher-3.2.3.10";
  23.  
  24. src = fetchurl {
  25. url = "https://download.nodecdn.net/containers/atl/ATLauncher.jar";
  26. sha256 = "0b5xi7jgydqrpz8dqgfbzrq4ijvl0269pci9qj4a6k5xkya45y1a";
  27. };
  28.  
  29. phases = "installPhase";
  30.  
  31. installPhase = ''
  32. set -x
  33. mkdir -pv $out/bin
  34. cp -v $src $out/ATLauncher.jar
  35.  
  36. cat > $out/bin/atlauncher << EOF
  37. #!${stdenv.shell}
  38.  
  39. export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${makeLibraryPath [ libX11 libXext libXcursor libXrandr libXxf86vm libGLU_combined openal ]}
  40. ${if useAlsa then "${alsaOss}/bin/aoss" else "" } \
  41. ${jre}/bin/java -jar $out/ATLauncher.jar --working-dir "${XDG_DATA_HOME:-$HOME/.local/share}/atlauncher"
  42. EOF
  43.  
  44. chmod +x $out/bin/atlauncher
  45.  
  46. mkdir -p $out/share/applications
  47. ln -s ${desktopItem}/share/applications/* $out/share/applications/
  48.  
  49. ${openjdk}/bin/jar xf $out/ATLauncher.jar assets/image/Icon.png
  50. install -D assets/image/Icon.png $out/share/icons/hicolor/32x32/apps/atlauncher.png
  51. '';
  52.  
  53. meta = {
  54. description = "Free launcher for Minecraft that allows you to download modpacks.";
  55. homepage = http://atlauncher.com;
  56. maintainers = with stdenv.lib.maintainers; [ tenten8401 ];
  57. license = stdenv.lib.licenses.gnuGpl3;
  58. };
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement