nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenvNoCC,
4 fetchurl,
5 makeWrapper,
6 # TODO: for jre 17+, we'll need a workaround:
7 # https://gitlab.com/hdos/issues/-/issues/2004
8 openjdk11,
9 makeDesktopItem,
10 copyDesktopItems,
11 libGL,
12}:
13stdenvNoCC.mkDerivation (finalAttrs: {
14 pname = "hdos";
15 version = "8";
16
17 src = fetchurl {
18 url = "https://cdn.hdos.dev/launcher/v${finalAttrs.version}/hdos-launcher.jar";
19 hash = "sha256-00ddeR+ov6Tjrn+pscXoao4C0ek/iP9Hdlgq946pL8A=";
20 };
21
22 dontUnpack = true;
23
24 desktop = makeDesktopItem {
25 name = "HDOS";
26 type = "Application";
27 exec = "hdos";
28 icon = fetchurl {
29 url = "https://raw.githubusercontent.com/flathub/dev.hdos.HDOS/8e17cbecb06548fde2c023032e89ddf30befeabc/dev.hdos.HDOS.png";
30 hash = "sha256-pqLNJ0g7GCPotgEPfw2ZZOqapaCRAsJxB09INp6Y6gM=";
31 };
32 comment = "HDOS is a client for Old School RuneScape that emulates the era of 2008-2011 RuneScape HD";
33 desktopName = "HDOS";
34 genericName = "Oldschool Runescape";
35 categories = [ "Game" ];
36 };
37
38 nativeBuildInputs = [
39 makeWrapper
40 copyDesktopItems
41 ];
42
43 installPhase = ''
44 runHook preInstall
45 makeWrapper ${lib.getExe openjdk11} $out/bin/hdos \
46 --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libGL ]}" \
47 --add-flags "-jar $src"
48 runHook postInstall
49 '';
50
51 desktopItems = [ finalAttrs.desktop ];
52
53 passthru.updateScript = ./update.sh;
54
55 meta = {
56 description = "High Detail Old School Runescape Client";
57 homepage = "https://hdos.dev";
58 changelog = "https://hdos.dev/changelog";
59 sourceProvenance = [ lib.sourceTypes.binaryBytecode ];
60 license = lib.licenses.unfree;
61 platforms = openjdk11.meta.platforms;
62 maintainers = [ lib.maintainers.misterio77 ];
63 };
64})