@@ -1,12 +1,16 @@
1−{ stdenv, fetchurl, lua5, luasocket, luasec, luaexpat, luafilesystem, luabitop, libidn, openssl, makeWrapper, fetchhg }:
1+{ stdenv, fetchurl, lua5, luasocket, luasec, luaexpat, luafilesystem, luabitop, luaevent ? null, libidn, openssl, makeWrapper, fetchhg, withLibevent ? false }:
2+
3+assert withLibevent -> luaevent != null;
4+
5+with stdenv.lib;
26
37let
4− libs = [ luasocket luasec luaexpat luafilesystem luabitop ];
8+ libs = [ luasocket luasec luaexpat luafilesystem luabitop ] ++ optional withLibevent luaevent;
59 getPath = lib : type : "${lib}/lib/lua/${lua5.luaversion}/?.${type};${lib}/share/lua/${lua5.luaversion}/?.${type}";
610 getLuaPath = lib : getPath lib "lua";
711 getLuaCPath = lib : getPath lib "so";
8− luaPath = stdenv.lib.concatStringsSep ";" (map getLuaPath libs);
9− luaCPath = stdenv.lib.concatStringsSep ";" (map getLuaCPath libs);
12+ luaPath = concatStringsSep ";" (map getLuaPath libs);
13+ luaCPath = concatStringsSep ";" (map getLuaCPath libs);
1014in
1115
1216stdenv.mkDerivation rec {
@@ -23,7 +27,8 @@ stdenv.mkDerivation rec {
2327 sha256 = "0010x2rl9f9ihy2nwqan2jdlz25433srj2zna1xh10490mc28hij";
2428 };
2529
26− buildInputs = [ lua5 luasocket luasec luaexpat luabitop libidn openssl makeWrapper ];
30+ buildInputs = [ lua5 luasocket luasec luaexpat luabitop libidn openssl makeWrapper ]
31+ ++ optional withLibevent luaevent;
2732
2833 configureFlags = [
2934 "--ostype=linux"
@@ -44,9 +49,9 @@ stdenv.mkDerivation rec {
4449
4550 meta = {
4651 description = "Open-source XMPP application server written in Lua";
47− license = stdenv.lib.licenses.mit;
52+ license = licenses.mit;
4853 homepage = http://www.prosody.im;
49− platforms = stdenv.lib.platforms.linux;
50− maintainers = [ stdenv.lib.maintainers.flosse ];
54+ platforms = platforms.linux;
55+ maintainers = [ maintainers.flosse ];
5156 };
5257}