stockholm/krebs/5pkgs/simple/ftb/default.nix

39 lines
923 B
Nix
Raw Normal View History

{ fetchurl, lib, stdenv
2018-01-30 18:05:10 +00:00
, jre, libX11, libXext, libXcursor, libXrandr, libXxf86vm
, openjdk
2018-06-27 21:37:46 +00:00
, mesa_glu, openal
2018-01-30 18:05:10 +00:00
, useAlsa ? false, alsaOss ? null }:
with lib;
2018-01-30 18:05:10 +00:00
assert useAlsa -> alsaOss != null;
2018-02-06 22:11:36 +00:00
stdenv.mkDerivation {
2018-01-30 18:05:10 +00:00
name = "ftb";
src = fetchurl {
url = "http://ftb.cursecdn.com/FTB2/launcher/FTB_Launcher.jar";
2018-02-06 22:11:36 +00:00
sha256 = "0pyh83hhni97ryvz6yy8lyiagjrlx67cwr780s2bja92rxc1sqpj";
2018-01-30 18:05:10 +00:00
};
phases = "installPhase";
installPhase = ''
set -x
mkdir -pv $out/bin
cp -v $src $out/ftb.jar
cat > $out/bin/ftb << EOF
#!${stdenv.shell}
2018-02-11 15:08:28 +00:00
export _JAVA_AWT_WM_NONREPARENTING=1
2018-06-27 21:37:46 +00:00
export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${makeLibraryPath [ libX11 libXext libXcursor libXrandr libXxf86vm mesa_glu openal ]}
2018-01-30 18:05:10 +00:00
${if useAlsa then "${alsaOss}/bin/aoss" else "" } \
${jre}/bin/java -jar $out/ftb.jar
EOF
chmod +x $out/bin/ftb
${openjdk}/bin/jar xf $out/ftb.jar favicon.png
'';
}