2023-01-01 16:27:16 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, autoPatchelfHook
|
2023-04-11 10:52:27 +00:00
|
|
|
, buildFHSEnv
|
2023-01-01 16:27:16 +00:00
|
|
|
, cairo
|
|
|
|
, dpkg
|
|
|
|
, fetchurl
|
|
|
|
, gcc-unwrapped
|
|
|
|
, glib
|
|
|
|
, glibc
|
|
|
|
, gnome2
|
|
|
|
, gtk2-x11
|
|
|
|
, libGL
|
2021-10-18 15:22:22 +00:00
|
|
|
, libpulseaudio
|
2023-01-01 16:27:16 +00:00
|
|
|
, libSM
|
|
|
|
, libXxf86vm
|
|
|
|
, libX11
|
|
|
|
, openssl_1_1
|
|
|
|
, pango
|
|
|
|
, SDL2
|
|
|
|
, wrapGAppsHook
|
2023-01-01 16:29:51 +00:00
|
|
|
, xdg-utils
|
2023-01-01 16:27:16 +00:00
|
|
|
, xorg
|
|
|
|
, xorg_sys_opengl
|
|
|
|
, zlib
|
2021-10-18 15:22:22 +00:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
|
|
|
|
runescape = stdenv.mkDerivation rec {
|
|
|
|
pname = "runescape-launcher";
|
2023-01-17 17:59:43 +00:00
|
|
|
version = "2.2.10";
|
2021-10-18 15:22:22 +00:00
|
|
|
|
2022-01-28 16:00:27 +00:00
|
|
|
# Packages: https://content.runescape.com/downloads/ubuntu/dists/trusty/non-free/binary-amd64/Packages
|
2021-12-01 09:59:45 +00:00
|
|
|
# upstream is https://content.runescape.com/downloads/ubuntu/pool/non-free/r/${pname}/${pname}_${version}_amd64.deb
|
2021-10-18 15:22:22 +00:00
|
|
|
src = fetchurl {
|
2021-12-01 09:59:45 +00:00
|
|
|
url = "https://archive.org/download/${pname}_${version}_amd64/${pname}_${version}_amd64.deb";
|
2023-01-17 17:59:43 +00:00
|
|
|
sha256 = "1v96vjiblphhbqhpp3m7wbvdvcnp76ncdlf4pdcr2z1dz8nh6shg";
|
2021-10-18 15:22:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoPatchelfHook
|
|
|
|
dpkg
|
2023-01-01 16:27:16 +00:00
|
|
|
wrapGAppsHook
|
2021-10-18 15:22:22 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2023-01-01 16:27:16 +00:00
|
|
|
cairo
|
2021-10-18 15:22:22 +00:00
|
|
|
gcc-unwrapped
|
2023-01-01 16:27:16 +00:00
|
|
|
glib
|
|
|
|
glibc
|
|
|
|
gtk2-x11
|
2021-10-18 15:22:22 +00:00
|
|
|
libSM
|
|
|
|
libXxf86vm
|
|
|
|
libX11
|
2023-01-01 16:27:16 +00:00
|
|
|
openssl_1_1
|
2021-10-18 15:22:22 +00:00
|
|
|
pango
|
|
|
|
zlib
|
|
|
|
];
|
|
|
|
|
|
|
|
runtimeDependencies = [
|
|
|
|
libGL
|
2023-01-01 16:27:16 +00:00
|
|
|
libpulseaudio
|
2021-10-18 15:22:22 +00:00
|
|
|
SDL2
|
2023-01-01 16:16:31 +00:00
|
|
|
openssl_1_1
|
2023-01-01 16:29:51 +00:00
|
|
|
xdg-utils # The launcher uses `xdg-open` to open HTTP URLs in the user's browser
|
2023-01-01 16:27:16 +00:00
|
|
|
xorg_sys_opengl
|
2021-10-18 15:22:22 +00: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 20:12:22 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2021-10-18 15:22:22 +00:00
|
|
|
license = licenses.unfree;
|
2021-12-01 09:04:21 +00:00
|
|
|
maintainers = with maintainers; [ grburst ];
|
2021-10-18 15:22:22 +00: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 10:52:27 +00:00
|
|
|
* For that we need use a buildFHSEnv.
|
2021-10-18 15:22:22 +00:00
|
|
|
* FHS simulates a classic linux shell
|
|
|
|
*/
|
2023-04-11 10:52:27 +00:00
|
|
|
buildFHSEnv {
|
2021-12-01 09:59:45 +00:00
|
|
|
name = "RuneScape";
|
|
|
|
targetPkgs = pkgs: [
|
|
|
|
runescape
|
2023-01-01 16:27:16 +00:00
|
|
|
cairo
|
|
|
|
dpkg
|
|
|
|
gcc-unwrapped
|
|
|
|
glib
|
|
|
|
glibc
|
|
|
|
gtk2-x11
|
|
|
|
libGL
|
2021-12-01 09:59:45 +00:00
|
|
|
libpulseaudio
|
2023-01-01 16:27:16 +00:00
|
|
|
libSM
|
|
|
|
libXxf86vm
|
|
|
|
libX11
|
|
|
|
openssl_1_1
|
|
|
|
pango
|
|
|
|
SDL2
|
2023-01-01 16:29:51 +00:00
|
|
|
xdg-utils
|
2021-12-01 09:59:45 +00:00
|
|
|
xorg.libX11
|
2023-01-01 16:27:16 +00:00
|
|
|
xorg_sys_opengl
|
|
|
|
zlib
|
2021-12-01 09:59:45 +00:00
|
|
|
];
|
|
|
|
multiPkgs = pkgs: [ libGL ];
|
|
|
|
runScript = "runescape-launcher";
|
2022-07-11 03:05:53 +00: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 09:59:45 +00: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" ];
|
|
|
|
};
|
|
|
|
}
|