You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
711 B
Nix

{ stdenv, xorg, jdk, mesa, openal, libpulseaudio, ... }:
stdenv.mkDerivation {
name = "technic";
src = ./TechnicLauncher.jar;
buildInputs = with xorg; [ libX11 libXext libXcursor libXrandr libXxf86vm jdk mesa openal libpulseaudio ];
buildCommand = ''
mkdir -pv $out/libexec/ $out/bin/
cp -v $src $out/libexec/TechnicLauncher.jar
RESULT=
for x in $buildInputs; do
RESULT=$x/lib/:$RESULT
done
cat <<EOF > $out/bin/technic
#!${stdenv.shell}
export LD_LIBRARY_PATH=/run/opengl-driver/lib:$RESULT
export GAME_LIBRARY_PATH=/run/opengl-driver/lib:$RESULT
exec ${jdk}/bin/java -jar $out/libexec/TechnicLauncher.jar
EOF
chmod +x $out/bin/technic
'';
}