Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Profpatsch/7a44d1fa5088fcfbbbfc7b211d76a2da to your computer and use it in GitHub Desktop.
Save Profpatsch/7a44d1fa5088fcfbbbfc7b211d76a2da to your computer and use it in GitHub Desktop.
{ stdenv, fetchurl, curl, glew110, libpng12, gstreamer, SDL2, webkitgtk24x, dpkg, patchelf, makeWrapper }:
stdenv.mkDerivation rec {
name = "runescape-2.2.2";
src = fetchurl {
url = "https://content.runescape.com/downloads/ubuntu/pool/non-free/r/runescape-launcher/runescape-launcher_2.2.2_amd64.deb";
sha256 = "0mx4x9i8z989ayh7lq2l8b3n91zk0yhryzj7g58bp4gz313dpai8";
};
buildInputs = [
dpkg
makeWrapper
];
phases = "unpackPhase installPhase";
unpackPhase = ''
mkdir pkg
dpkg-deb -x $src pkg
sourceRoot=pkg
mv pkg/* $out/
'';
installPhase = let
libPath = stdenv.lib.makeLibraryPath
[ stdenv.cc.cc curl libpng12 gstreamer SDL2 webkitgtk24x glew110 ] ;
in ''
libdir=$out/lib/
mkdir -p $libdir
ln -s ${curl.out}/lib/libcurl.so.4 $libdir/libcurl.so.3
substituteInPlace $out/bin/runescape-launcher --replace \
"/usr/share/games/runescape-launcher/runescape" "$out/share/games/runescape-launcher/runescape"
wrapProgram $out/bin/runescape-launcher \
--prefix LD_PRELOAD : $out/lib/libcurl.so.3
'';
meta = {
description = "runescape";
homepage = "runescape.com";
license = stdenv.lib.licenses.unfree;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment