Skip to content

Instantly share code, notes, and snippets.

Created July 30, 2016 00:43
Show Gist options
  • Save anonymous/73bd6b59857c305cf1f0daa28c8a410f to your computer and use it in GitHub Desktop.
Save anonymous/73bd6b59857c305cf1f0daa28c8a410f 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
wrapProgram $out/bin/runescape-launcher \
--prefix LD_PRELOAD : $out/lib/libcurl.so.3
substituteInPlace $out/bin/.runescape-launcher-wrapped --replace \
"/usr/share/games/runescape-launcher/runescape --configURI $configURI $@" "$out/share/games/runescape-launcher/runescape --configURI $configURI $@"
'';
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