nixpkgs/pkgs/games/runelite/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

70 lines
2.6 KiB
Nix
Raw Normal View History

2021-05-27 00:02:02 +00:00
{ pkgs, lib, stdenv, makeDesktopItem, fetchurl, unzip, makeWrapper, xorg, jre, }:
2018-07-16 02:12:17 +00:00
stdenv.mkDerivation rec {
pname = "runelite";
2022-12-29 23:49:01 +00:00
version = "2.5.0";
2018-07-16 02:12:17 +00:00
2021-05-27 00:02:02 +00:00
jar = fetchurl {
2018-07-16 02:12:17 +00:00
url = "https://github.com/runelite/launcher/releases/download/${version}/RuneLite.jar";
2022-12-29 23:49:01 +00:00
hash = "sha512-uEvlxXtnq7pgt8H5/hYIMu/kl32/dNojcHrPW6n2/RD/nzywreDw4kZ3G1kx0gGBY71x0RIEseEbm4BM+fhJlQ==";
2018-07-16 02:12:17 +00:00
};
icon = fetchurl {
url = "https://github.com/runelite/launcher/raw/${version}/appimage/runelite.png";
2022-12-29 23:49:01 +00:00
hash = "sha512-Yh8mpc6z9xd6ePe3f1f+KzrpE9r3fsdtQ0pfAvOhK/0hrCo/17eQA6v73yFXZcPQogVwm9CmJlrx4CkfzB25RQ==";
2018-07-16 02:12:17 +00:00
};
2021-05-27 00:02:02 +00:00
# The `.so` files provided by these two jars aren't detected by RuneLite for some reason, so we have to provide them manually
jogl = fetchurl {
url = "https://repo.runelite.net/net/runelite/jogl/jogl-all/2.4.0-rc-20200429/jogl-all-2.4.0-rc-20200429-natives-linux-amd64.jar";
2022-12-29 23:49:01 +00:00
hash = "sha512-OmJIbk5pKtvf1n1I5UHu6iaOKNrPgmaJTPhqC8yMjaRh/Hso1vV/+Eu+zKu7d5UiVggVUzJxqDKatmEnqFrzbg==";
2021-05-27 00:02:02 +00:00
};
gluegen = fetchurl {
2022-12-29 23:49:01 +00:00
url = "https://repo.runelite.net/net/runelite/gluegen/gluegen-rt/2.4.0-rc-20220318/gluegen-rt-2.4.0-rc-20220318-natives-linux-amd64.jar";
hash = "sha512-kF+RdDzYEhBuZOJ6ZwMhaEVcjYLxiwR8tYAm08FXDML45iP4HBEfmqHOLJpIakK06aQFj99/296vx810eDFX5A==";
2021-05-27 00:02:02 +00:00
};
dontUnpack = true;
2018-07-16 02:12:17 +00:00
desktop = makeDesktopItem {
name = "RuneLite";
type = "Application";
exec = "runelite";
2019-09-08 23:38:31 +00:00
icon = icon;
2018-07-16 02:12:17 +00:00
comment = "Open source Old School RuneScape client";
desktopName = "RuneLite";
genericName = "Oldschool Runescape";
categories = [ "Game" ];
2018-07-16 02:12:17 +00:00
};
2021-05-27 00:02:02 +00:00
nativeBuildInputs = [ makeWrapper unzip ];
2018-07-16 02:12:17 +00:00
installPhase = ''
mkdir -p $out/share/runelite
mkdir -p $out/share/applications
2021-05-27 00:02:02 +00:00
mkdir -p $out/natives
unzip ${jogl} 'natives/*' -d $out
unzip ${gluegen} 'natives/*' -d $out
2018-07-16 02:12:17 +00:00
2021-05-27 00:02:02 +00:00
ln -s ${jar} $out/share/runelite/RuneLite.jar
ln -s ${desktop}/share/applications/RuneLite.desktop $out/share/applications/RuneLite.desktop
2018-07-16 02:12:17 +00:00
2021-05-27 00:02:02 +00:00
# RuneLite looks for `.so` files in $PWD/natives, so ensure that we set the PWD to the right place
2018-07-16 02:12:17 +00:00
makeWrapper ${jre}/bin/java $out/bin/runelite \
--chdir "$out" \
2021-05-27 00:02:02 +00:00
--prefix LD_LIBRARY_PATH : "${xorg.libXxf86vm}/lib" \
--add-flags "-jar $out/share/runelite/RuneLite.jar"
2018-07-16 02:12:17 +00:00
'';
meta = with lib; {
2018-07-16 02:12:17 +00:00
description = "Open source Old School RuneScape client";
homepage = "https://runelite.net/";
sourceProvenance = with sourceTypes; [
binaryBytecode
binaryNativeCode
];
license = licenses.bsd2;
maintainers = with maintainers; [ kmeakin ];
2021-05-27 00:02:02 +00:00
platforms = [ "x86_64-linux" ];
2018-07-16 02:12:17 +00:00
};
}