nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchFromGitHub,
4 makeDesktopItem,
5 makeWrapper,
6 maven,
7 jdk17,
8 jre,
9 libxxf86vm,
10 gitUpdater,
11 libGL,
12}:
13
14maven.buildMavenPackage rec {
15 pname = "runelite";
16 version = "2.7.2";
17
18 src = fetchFromGitHub {
19 owner = "runelite";
20 repo = "launcher";
21 rev = version;
22 hash = "sha256-ckeZ/7rACyZ5j+zzC5hv1NaXTi9q/KvOzMPTDd1crHQ=";
23 };
24
25 mvnJdk = jdk17;
26 mvnHash = "sha256-FpfHtGIfo84z6v9/nzc47+JeIM43MR9mWhVOPSi0xhM=";
27
28 desktop = makeDesktopItem {
29 name = "RuneLite";
30 type = "Application";
31 exec = "runelite";
32 icon = "runelite";
33 comment = "Open source Old School RuneScape client";
34 desktopName = "RuneLite";
35 genericName = "Oldschool Runescape";
36 categories = [ "Game" ];
37 startupWMClass = "net-runelite-client-RuneLite";
38 };
39
40 # tests require internet :(
41 mvnParameters = "-Dmaven.test.skip";
42 nativeBuildInputs = [ makeWrapper ];
43
44 installPhase = ''
45 mkdir -p $out/share/icons
46 mkdir -p $out/share/applications
47
48 cp target/RuneLite.jar $out/share
49 cp appimage/runelite.png $out/share/icons
50
51 ln -s ${desktop}/share/applications/RuneLite.desktop $out/share/applications/RuneLite.desktop
52
53 makeWrapper ${jre}/bin/java $out/bin/runelite \
54 --prefix LD_LIBRARY_PATH : "${
55 lib.makeLibraryPath [
56 libxxf86vm
57 libGL
58 ]
59 }" \
60 --add-flags "-jar $out/share/RuneLite.jar"
61 '';
62
63 passthru.updateScript = gitUpdater { };
64
65 meta = {
66 description = "Open source Old School RuneScape client";
67 homepage = "https://runelite.net/";
68 sourceProvenance = with lib.sourceTypes; [
69 binaryBytecode
70 binaryNativeCode
71 ];
72 license = lib.licenses.bsd2;
73 maintainers = with lib.maintainers; [
74 kmeakin
75 moody
76 ];
77 platforms = [ "x86_64-linux" ];
78 mainProgram = "runelite";
79 };
80}