2023-01-01 17:27:16 +01:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, autoPatchelfHook
|
2023-04-11 12:52:27 +02:00
|
|
|
, buildFHSEnv
|
2023-01-01 17:27:16 +01:00
|
|
|
, cairo
|
|
|
|
, dpkg
|
|
|
|
, fetchurl
|
|
|
|
, gcc-unwrapped
|
|
|
|
, glib
|
|
|
|
, glibc
|
|
|
|
, gnome2
|
|
|
|
, gtk2-x11
|
|
|
|
, libGL
|
2021-10-18 17:22:22 +02:00
|
|
|
, libpulseaudio
|
2023-01-01 17:27:16 +01:00
|
|
|
, libSM
|
|
|
|
, libXxf86vm
|
|
|
|
, libX11
|
|
|
|
, openssl_1_1
|
|
|
|
, pango
|
|
|
|
, SDL2
|
2024-04-26 22:24:03 +02:00
|
|
|
, wrapGAppsHook3
|
2023-01-01 17:29:51 +01:00
|
|
|
, xdg-utils
|
2023-01-01 17:27:16 +01:00
|
|
|
, xorg
|
|
|
|
, xorg_sys_opengl
|
|
|
|
, zlib
|
2021-10-18 17:22:22 +02:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
|
|
|
|
runescape = stdenv.mkDerivation rec {
|
|
|
|
pname = "runescape-launcher";
|
2023-01-17 18:59:43 +01:00
|
|
|
version = "2.2.10";
|
2021-10-18 17:22:22 +02:00
|
|
|
|
2022-01-28 17:00:27 +01:00
|
|
|
# Packages: https://content.runescape.com/downloads/ubuntu/dists/trusty/non-free/binary-amd64/Packages
|
2021-12-01 10:59:45 +01:00
|
|
|
# upstream is https://content.runescape.com/downloads/ubuntu/pool/non-free/r/${pname}/${pname}_${version}_amd64.deb
|
2021-10-18 17:22:22 +02:00
|
|
|
src = fetchurl {
|
2021-12-01 10:59:45 +01:00
|
|
|
url = "https://archive.org/download/${pname}_${version}_amd64/${pname}_${version}_amd64.deb";
|
2023-01-17 18:59:43 +01:00
|
|
|
sha256 = "1v96vjiblphhbqhpp3m7wbvdvcnp76ncdlf4pdcr2z1dz8nh6shg";
|
2021-10-18 17:22:22 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoPatchelfHook
|
|
|
|
dpkg
|
2024-04-26 22:24:03 +02:00
|
|
|
wrapGAppsHook3
|
2021-10-18 17:22:22 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2023-01-01 17:27:16 +01:00
|
|
|
cairo
|
2021-10-18 17:22:22 +02:00
|
|
|
gcc-unwrapped
|
2023-01-01 17:27:16 +01:00
|
|
|
glib
|
|
|
|
glibc
|
|
|
|
gtk2-x11
|
2021-10-18 17:22:22 +02:00
|
|
|
libSM
|
|
|
|
libXxf86vm
|
|
|
|
libX11
|
2023-01-01 17:27:16 +01:00
|
|
|
openssl_1_1
|
2021-10-18 17:22:22 +02:00
|
|
|
pango
|
|
|
|
zlib
|
|
|
|
];
|
|
|
|
|
|
|
|
runtimeDependencies = [
|
|
|
|
libGL
|
2023-01-01 17:27:16 +01:00
|
|
|
libpulseaudio
|
2021-10-18 17:22:22 +02:00
|
|
|
SDL2
|
2023-01-01 17:16:31 +01:00
|
|
|
openssl_1_1
|
2023-01-01 17:29:51 +01:00
|
|
|
xdg-utils # The launcher uses `xdg-open` to open HTTP URLs in the user's browser
|
2023-01-01 17:27:16 +01:00
|
|
|
xorg_sys_opengl
|
2021-10-18 17:22:22 +02:00
|
|
|
zlib
|
|
|
|
];
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export DH_VERBOSE=1
|
|
|
|
'';
|
|
|
|
|
|
|
|
envVarsWithXmodifiers = ''
|
|
|
|
export MESA_GLSL_CACHE_DIR=~/Jagex
|
|
|
|
export GDK_SCALE=2
|
|
|
|
unset XMODIFIERS
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/share
|
|
|
|
dpkg -x $src $out
|
|
|
|
|
|
|
|
patchShebangs $out/usr/bin/runescape-launcher
|
|
|
|
substituteInPlace $out/usr/bin/runescape-launcher \
|
|
|
|
--replace "unset XMODIFIERS" "$envVarsWithXmodifiers" \
|
|
|
|
--replace "/usr/share/games/runescape-launcher/runescape" "$out/share/games/runescape-launcher/runescape"
|
|
|
|
|
|
|
|
cp -r $out/usr/bin $out/
|
|
|
|
cp -r $out/usr/share $out/
|
|
|
|
|
|
|
|
rm -r $out/usr
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Launcher for RuneScape 3, the current main RuneScape";
|
|
|
|
homepage = "https://www.runescape.com/";
|
2022-06-10 22:12:22 +02:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2021-10-18 17:22:22 +02:00
|
|
|
license = licenses.unfree;
|
2021-12-01 10:04:21 +01:00
|
|
|
maintainers = with maintainers; [ grburst ];
|
2021-10-18 17:22:22 +02:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
/*
|
|
|
|
* We can patch the runescape launcher, but it downloads a client at runtime and checks it for changes.
|
2023-04-11 12:52:27 +02:00
|
|
|
* For that we need use a buildFHSEnv.
|
2021-10-18 17:22:22 +02:00
|
|
|
* FHS simulates a classic linux shell
|
|
|
|
*/
|
2023-04-11 12:52:27 +02:00
|
|
|
buildFHSEnv {
|
2021-12-01 10:59:45 +01:00
|
|
|
name = "RuneScape";
|
|
|
|
targetPkgs = pkgs: [
|
|
|
|
runescape
|
2023-01-01 17:27:16 +01:00
|
|
|
cairo
|
|
|
|
dpkg
|
|
|
|
gcc-unwrapped
|
|
|
|
glib
|
|
|
|
glibc
|
|
|
|
gtk2-x11
|
|
|
|
libGL
|
2021-12-01 10:59:45 +01:00
|
|
|
libpulseaudio
|
2023-01-01 17:27:16 +01:00
|
|
|
libSM
|
|
|
|
libXxf86vm
|
|
|
|
libX11
|
|
|
|
openssl_1_1
|
|
|
|
pango
|
|
|
|
SDL2
|
2023-01-01 17:29:51 +01:00
|
|
|
xdg-utils
|
2021-12-01 10:59:45 +01:00
|
|
|
xorg.libX11
|
2023-01-01 17:27:16 +01:00
|
|
|
xorg_sys_opengl
|
|
|
|
zlib
|
2021-12-01 10:59:45 +01:00
|
|
|
];
|
|
|
|
multiPkgs = pkgs: [ libGL ];
|
|
|
|
runScript = "runescape-launcher";
|
2022-07-11 05:05:53 +02:00
|
|
|
extraInstallCommands = ''
|
|
|
|
mkdir -p "$out/share/applications"
|
|
|
|
cp ${runescape}/share/applications/runescape-launcher.desktop "$out/share/applications"
|
|
|
|
cp -r ${runescape}/share/icons "$out/share/icons"
|
|
|
|
substituteInPlace "$out/share/applications/runescape-launcher.desktop" \
|
|
|
|
--replace "/usr/bin/runescape-launcher" "RuneScape"
|
|
|
|
'';
|
2021-12-01 10:59:45 +01:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "RuneScape Game Client (NXT) - Launcher for RuneScape 3";
|
|
|
|
homepage = "https://www.runescape.com/";
|
|
|
|
license = licenses.unfree;
|
|
|
|
maintainers = with maintainers; [ grburst ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|