forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request NixOS#312710 from Misterio77/init-hdos
hdos: init at 8
- Loading branch information
Showing
2 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
lib, | ||
stdenvNoCC, | ||
fetchurl, | ||
makeWrapper, | ||
# TODO: for jre 17+, we'll need a workaroud: | ||
# https://gitlab.com/hdos/issues/-/issues/2004 | ||
openjdk11, | ||
makeDesktopItem, | ||
copyDesktopItems, | ||
libGL, | ||
}: | ||
stdenvNoCC.mkDerivation (finalAttrs: { | ||
pname = "hdos"; | ||
version = "8"; | ||
|
||
src = fetchurl { | ||
url = "https://cdn.hdos.dev/launcher/v${finalAttrs.version}/hdos-launcher.jar"; | ||
hash = "sha256-00ddeR+ov6Tjrn+pscXoao4C0ek/iP9Hdlgq946pL8A="; | ||
}; | ||
|
||
dontUnpack = true; | ||
|
||
desktop = makeDesktopItem { | ||
name = "HDOS"; | ||
type = "Application"; | ||
exec = "hdos"; | ||
icon = fetchurl { | ||
url = "https://raw.githubusercontent.com/flathub/dev.hdos.HDOS/8e17cbecb06548fde2c023032e89ddf30befeabc/dev.hdos.HDOS.png"; | ||
hash = "sha256-pqLNJ0g7GCPotgEPfw2ZZOqapaCRAsJxB09INp6Y6gM="; | ||
}; | ||
comment = "HDOS is a client for Old School RuneScape that emulates the era of 2008-2011 RuneScape HD"; | ||
desktopName = "HDOS"; | ||
genericName = "Oldschool Runescape"; | ||
categories = [ "Game" ]; | ||
}; | ||
|
||
nativeBuildInputs = [ | ||
makeWrapper | ||
copyDesktopItems | ||
]; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
makeWrapper ${lib.getExe openjdk11} $out/bin/hdos \ | ||
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libGL ]}" \ | ||
--add-flags "-jar $src" | ||
runHook postInstall | ||
''; | ||
|
||
desktopItems = [ finalAttrs.desktop ]; | ||
|
||
passthru.updateScript = ./update.sh; | ||
|
||
meta = { | ||
description = "High Detail Old School Runescape Client"; | ||
homepage = "https://hdos.dev"; | ||
changelog = "https://hdos.dev/changelog"; | ||
sourceProvenance = [ lib.sourceTypes.binaryBytecode ]; | ||
license = lib.licenses.unfree; | ||
platforms = openjdk11.meta.platforms; | ||
maintainers = [ lib.maintainers.misterio77 ]; | ||
}; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#! /usr/bin/env nix-shell | ||
#! nix-shell -i bash -p common-updater-scripts findutils | ||
|
||
set -euo pipefail | ||
|
||
version="$(curl -s https://cdn.hdos.dev/client/getdown.txt | grep 'launcher.version = ' | cut -d '=' -f2 | xargs)" | ||
update-source-version hdos "$version" |