summary refs log tree commit diff
path: root/pkgs/games/mudlet/default.nix
blob: 078075931dae71c686ffa3e1bc33ad10681c9850 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{ fetchurl, unzip, stdenv, makeWrapper, qtbase, yajl, libzip, hunspell
, boost, lua5_1, luafilesystem, luazip, lrexlib, luasqlite3, qmake }:

stdenv.mkDerivation rec {
  name = "mudlet-${version}";
  version = "3.0.0-delta";

  src = fetchurl {
    url = "https://github.com/Mudlet/Mudlet/archive/Mudlet-${version}.tar.gz";
    sha256 = "08fhqd323kgz5s17ac5z9dhkjxcmwvcmvhzy0x1vw4rayhijfrd7";
  };

  nativeBuildInputs = [ makeWrapper qmake ];
  buildInputs = [
    unzip qtbase lua5_1 hunspell libzip yajl boost
    luafilesystem luazip lrexlib luasqlite3
  ];

  preConfigure = "cd src";

  installPhase = let
    luaZipPath = "${luazip}/lib/lua/5.1/?.so";
    luaFileSystemPath = "${luafilesystem}/lib/lua/5.1/?.so";
    lrexlibPath = "${lrexlib}/lib/lua/5.1/?.so";
    luasqlitePath = "${luasqlite3}/lib/lua/5.1/?.so";
  in ''
    mkdir -pv $out/bin
    cp mudlet $out
    cp -r mudlet-lua $out

    makeWrapper $out/mudlet $out/bin/mudlet \
      --set LUA_CPATH "\"${luaFileSystemPath};${luaZipPath};${lrexlibPath};${luasqlitePath}\"" \
      --run "cd $out";
  '';

  patches = [ ./libs.patch ];

  meta = {
    description = "Crossplatform mud client";
    homepage = http://mudlet.org/;
    maintainers = [ stdenv.lib.maintainers.wyvie ];
    platforms = stdenv.lib.platforms.linux;
    license = stdenv.lib.licenses.gpl2;
    broken = true;
  };
}