2021-05-27 01:02:02 +01:00
|
|
|
{ pkgs, lib, stdenv, makeDesktopItem, fetchurl, unzip, makeWrapper, xorg, jre, }:
|
2018-07-16 03:12:17 +01:00
|
|
|
|
2019-11-25 11:23:51 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "runelite";
|
2021-05-27 01:02:02 +01:00
|
|
|
version = "2.1.5";
|
2018-07-16 03:12:17 +01:00
|
|
|
|
2021-05-27 01:02:02 +01:00
|
|
|
jar = fetchurl {
|
2018-07-16 03:12:17 +01:00
|
|
|
url = "https://github.com/runelite/launcher/releases/download/${version}/RuneLite.jar";
|
2021-05-27 01:02:02 +01:00
|
|
|
sha256 = "4BX188QIjIFTxng2ktqlKn7AqQ9tdBcKWmgOj/5yd10=";
|
2018-07-16 03:12:17 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
icon = fetchurl {
|
2019-11-25 11:23:51 +00:00
|
|
|
url = "https://github.com/runelite/launcher/raw/${version}/appimage/runelite.png";
|
|
|
|
sha256 = "04fcjm7p546gr82g0jbh497j7rnh70lrvas0k171bff4v3knrjw1";
|
2018-07-16 03:12:17 +01:00
|
|
|
};
|
|
|
|
|
2021-05-27 01:02:02 +01: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";
|
|
|
|
sha256 = "S60qxyWY9RfyhLFygn/OxZFWnc8qVRtTFdWMbdu+2U0=";
|
|
|
|
};
|
|
|
|
gluegen = fetchurl {
|
|
|
|
url = "https://repo.runelite.net/net/runelite/gluegen/gluegen-rt/2.4.0-rc-20200429/gluegen-rt-2.4.0-rc-20200429-natives-linux-amd64.jar";
|
|
|
|
sha256 = "eF8S5sQkJFDtW8rcVBKIyeyKm5Ze5rXK5r/yosZcHjU=";
|
|
|
|
};
|
|
|
|
dontUnpack = true;
|
|
|
|
|
2018-07-16 03:12:17 +01:00
|
|
|
desktop = makeDesktopItem {
|
|
|
|
name = "RuneLite";
|
|
|
|
type = "Application";
|
|
|
|
exec = "runelite";
|
2019-09-09 00:38:31 +01:00
|
|
|
icon = icon;
|
2018-07-16 03:12:17 +01:00
|
|
|
comment = "Open source Old School RuneScape client";
|
|
|
|
desktopName = "RuneLite";
|
|
|
|
genericName = "Oldschool Runescape";
|
2022-02-22 14:56:15 +00:00
|
|
|
categories = [ "Game" ];
|
2018-07-16 03:12:17 +01:00
|
|
|
};
|
|
|
|
|
2021-05-27 01:02:02 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper unzip ];
|
2018-07-16 03:12:17 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share/runelite
|
|
|
|
mkdir -p $out/share/applications
|
2021-05-27 01:02:02 +01:00
|
|
|
mkdir -p $out/natives
|
|
|
|
|
|
|
|
unzip ${jogl} 'natives/*' -d $out
|
|
|
|
unzip ${gluegen} 'natives/*' -d $out
|
2018-07-16 03:12:17 +01:00
|
|
|
|
2021-05-27 01:02:02 +01:00
|
|
|
ln -s ${jar} $out/share/runelite/RuneLite.jar
|
|
|
|
ln -s ${desktop}/share/applications/RuneLite.desktop $out/share/applications/RuneLite.desktop
|
2018-07-16 03:12:17 +01:00
|
|
|
|
2021-05-27 01:02:02 +01:00
|
|
|
# RuneLite looks for `.so` files in $PWD/natives, so ensure that we set the PWD to the right place
|
2018-07-16 03:12:17 +01:00
|
|
|
makeWrapper ${jre}/bin/java $out/bin/runelite \
|
2022-03-14 18:06:00 +00:00
|
|
|
--chdir "$out" \
|
2021-05-27 01:02:02 +01:00
|
|
|
--prefix LD_LIBRARY_PATH : "${xorg.libXxf86vm}/lib" \
|
|
|
|
--add-flags "-jar $out/share/runelite/RuneLite.jar"
|
2018-07-16 03:12:17 +01:00
|
|
|
'';
|
|
|
|
|
2019-11-25 11:23:51 +00:00
|
|
|
meta = with lib; {
|
2018-07-16 03:12:17 +01:00
|
|
|
description = "Open source Old School RuneScape client";
|
|
|
|
homepage = "https://runelite.net/";
|
2022-06-10 21:12:22 +01:00
|
|
|
sourceProvenance = with sourceTypes; [
|
|
|
|
binaryBytecode
|
|
|
|
binaryNativeCode
|
|
|
|
];
|
2019-11-25 11:23:51 +00:00
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ kmeakin ];
|
2021-05-27 01:02:02 +01:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2018-07-16 03:12:17 +01:00
|
|
|
};
|
2019-11-25 11:23:51 +00:00
|
|
|
}
|