Skip to content

Instantly share code, notes, and snippets.

@AcouBass
Last active January 17, 2018 13:33
Show Gist options
  • Save AcouBass/1f6c26ff7403d93ed90a35a600ed9cc9 to your computer and use it in GitHub Desktop.
Save AcouBass/1f6c26ff7403d93ed90a35a600ed9cc9 to your computer and use it in GitHub Desktop.
runescape .nix - no longer needs curl-compat!
{ pkgs ? import <nixpkgs> {} }:
let
env = pkgs.buildEnv {
name = "runscape-env";
paths = with pkgs; [
/* required by launcher executable */
xorg.libSM xorg.libXxf86vm libpng12 xorg.libX11 expat.out
webkitgtk glib.out pango.out cairo.out gdk_pixbuf gtk2.out
stdenv.cc.cc.lib glib_networking.out curl.out
/* required by library additionaly downloaded by launcher - $HOME/Jagex/launcher/librs2client.so */
SDL2 zlib mesa glew110
];
};
in
pkgs.stdenv.mkDerivation rec {
name = "runescape-launcher-2.2.4";
src = pkgs.fetchurl {
url = "https://content.runescape.com/downloads/ubuntu/pool/non-free/r/runescape-launcher/runescape-launcher_2.2.4_amd64.deb";
sha256 = "12kyabn0jxsk1ldicpjbw3vjfd6jvsb0rj4pwr92bnvy809z1rw5";
};
dontPatchELF = true;
dontStrip = true;
nativeBuildInputs = [ pkgs.dpkg pkgs.makeWrapper ];
unpackCmd = "mkdir root ; dpkg-deb -x $curSrc root";
installPhase = ''
mkdir -p $out
cp -r ./usr/* $out/
substituteInPlace $out/bin/runescape-launcher \
--replace "/usr/share/games/runescape-launcher/runescape" "$out/share/games/runescape-launcher/runescape"
substituteInPlace $out/share/applications/runescape-launcher.desktop \
--replace "/usr/bin/runescape-launcher %u" "$out/bin/runescape-launcher %u"
patchelf --set-interpreter $(cat ${pkgs.stdenv.cc}/nix-support/dynamic-linker) \
$out/share/games/runescape-launcher/runescape
wrapProgram $out/share/games/runescape-launcher/runescape \
--prefix LD_LIBRARY_PATH : "/run/opengl-driver/lib:${env}/lib:${env}/lib64"
'';
}
@AcouBass
Copy link
Author

Thanks a lot to someone in the #NixOS IRC room - completely re-written and working!

@markus1189
Copy link

@AcouBass I saw your message in the #nixos irc about libwebkitgtk-1.0.so.0 How did you fix that? I cannot find it here.

webkitgtk does not provide it, at least currently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment