Skip to content

Instantly share code, notes, and snippets.

@confususs
Last active September 3, 2019 16:12
Show Gist options
  • Save confususs/4633c9af7e17cb5b5e33b8c34c532ece to your computer and use it in GitHub Desktop.
Save confususs/4633c9af7e17cb5b5e33b8c34c532ece to your computer and use it in GitHub Desktop.
nix derivation to get the launcher of the legendary MMORPG Tibia
with import <nixpkgs> {};
# { stdenv, dpkg, fetchurl, glibc, gcc-unwrapped, autoPatchelfHook, pkgs }:
let
# Please keep the version x.y.0.z and do not update to x.y.76.z because the
# source of the latter disappears much faster.
version = "11.0.0";
src = fetchurl {
url = "https://static.tibia.com/download/tibia.x64.tar.gz";
sha256 = "0gd0ild8mg4fll96y58c7i5mwajd1gb8md8dp7b58kraxrffzy61";
};
in
stdenv.mkDerivation rec {
name = "tibia-${version}";
system = "x86_64-linux";
inherit version src;
# Required for compilation
nativeBuildInputs = [
autoPatchelfHook # Automatically setup the loader, and do the magic
makeWrapper
];
# Required at running time
buildInputs = [
stdenv.cc.cc
glibc
qt5.qtbase
qt5.wrapQtAppsHook
];
LD_LIBRARY_PATH = buildInputs; # lib.strings.makeLibraryPath
# unpackPhase = "true";
# Extract and copy executable in $out/bin
installPhase = ''
mkdir -p $out/bin
cp Tibia $out/bin
'';
postFixup = ''
wrapQtApp $out/bin/Tibia
'';
meta = with stdenv.lib; {
description = "To get the Tibia Launcher";
homepage = http://www.tibia.com//;
license = licenses.mit;
maintainers = with stdenv.lib.maintainers; [ ];
platforms = [ "x86_64-linux" ];
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment