Merge pull request #4535 from flosse/lua-bitop

lua-packages: added lua-bitop to add websocket support for prosody

Changed files
+41 -4
nixos
modules
services
networking
pkgs
servers
xmpp
prosody
top-level
+5
nixos/modules/services/networking/prosody.nix
···
description = "Serve static files from a directory over HTTP";
};
+
websocket = mkOption {
+
default = false;
+
description = "Enable WebSocket support";
+
};
+
};
createSSLOptsStr = o:
+10 -3
pkgs/servers/xmpp/prosody/default.nix
···
-
{ stdenv, fetchurl, lua5, luasocket, luasec, luaexpat, luafilesystem, libidn, openssl, makeWrapper }:
+
{ stdenv, fetchurl, lua5, luasocket, luasec, luaexpat, luafilesystem, luabitop, libidn, openssl, makeWrapper, fetchhg }:
let
-
libs = [ luasocket luasec luaexpat luafilesystem ];
+
libs = [ luasocket luasec luaexpat luafilesystem luabitop ];
getPath = lib : type : "${lib}/lib/lua/${lua5.luaversion}/?.${type};${lib}/share/lua/${lua5.luaversion}/?.${type}";
getLuaPath = lib : getPath lib "lua";
getLuaCPath = lib : getPath lib "so";
···
sha256 = "be87cf31901a25477869b4ebd52e298f63a5effacae526911a0be876cc82e1c6";
};
-
buildInputs = [ lua5 luasocket luasec luaexpat libidn openssl makeWrapper ];
+
communityModules = fetchhg {
+
url = "http://prosody-modules.googlecode.com/hg/";
+
rev = "4b55110b0aa8";
+
sha256 = "0010x2rl9f9ihy2nwqan2jdlz25433srj2zna1xh10490mc28hij";
+
};
+
+
buildInputs = [ lua5 luasocket luasec luaexpat luabitop libidn openssl makeWrapper ];
configureFlags = [
"--ostype=linux"
···
];
postInstall = ''
+
cp $communityModules/mod_websocket/mod_websocket.lua $out/lib/prosody/modules/
wrapProgram $out/bin/prosody \
--set LUA_PATH '"${luaPath};"' \
--set LUA_CPATH '"${luaCPath};"'
+1 -1
pkgs/top-level/all-packages.nix
···
prosody = recurseIntoAttrs (
callPackage ../servers/xmpp/prosody {
lua5 = lua5_1;
-
inherit (lua51Packages) luasocket luasec luaexpat luafilesystem;
+
inherit (lua51Packages) luasocket luasec luaexpat luafilesystem luabitop;
});
elasticmq = callPackage ../servers/elasticmq { };
+25
pkgs/top-level/lua-packages.nix
···
inherit lua;
};
+
luabitop = buildLuaPackage rec {
+
version = "1.0.2";
+
name = "bitop-${version}";
+
src = fetchurl {
+
url = "http://bitop.luajit.org/download/LuaBitOp-${version}.tar.gz";
+
sha256 = "16fffbrgfcw40kskh2bn9q7m3gajffwd2f35rafynlnd7llwj1qj";
+
};
+
+
preBuild = ''
+
makeFlagsArray=(
+
INCLUDES="-I${lua}/include"
+
LUA="${lua}/bin/lua");
+
'';
+
+
installPhase = ''
+
mkdir -p $out/lib/lua/${lua.luaversion}
+
install -p bit.so $out/lib/lua/${lua.luaversion}
+
'';
+
+
meta = {
+
homepage = "http://bitop.luajit.org";
+
maintainers = with maintainers; [ flosse ];
+
};
+
};
+
luaexpat = buildLuaPackage rec {
version = "1.3.0";
name = "expat-${version}";