Merge pull request #4535 from flosse/lua-bitop

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

+41 -4
+5
nixos/modules/services/networking/prosody.nix
··· 91 91 description = "Serve static files from a directory over HTTP"; 92 92 }; 93 93 94 + websocket = mkOption { 95 + default = false; 96 + description = "Enable WebSocket support"; 97 + }; 98 + 94 99 }; 95 100 96 101 createSSLOptsStr = o:
+10 -3
pkgs/servers/xmpp/prosody/default.nix
··· 1 - { stdenv, fetchurl, lua5, luasocket, luasec, luaexpat, luafilesystem, libidn, openssl, makeWrapper }: 1 + { stdenv, fetchurl, lua5, luasocket, luasec, luaexpat, luafilesystem, luabitop, libidn, openssl, makeWrapper, fetchhg }: 2 2 3 3 let 4 - libs = [ luasocket luasec luaexpat luafilesystem ]; 4 + libs = [ luasocket luasec luaexpat luafilesystem luabitop ]; 5 5 getPath = lib : type : "${lib}/lib/lua/${lua5.luaversion}/?.${type};${lib}/share/lua/${lua5.luaversion}/?.${type}"; 6 6 getLuaPath = lib : getPath lib "lua"; 7 7 getLuaCPath = lib : getPath lib "so"; ··· 17 17 sha256 = "be87cf31901a25477869b4ebd52e298f63a5effacae526911a0be876cc82e1c6"; 18 18 }; 19 19 20 - buildInputs = [ lua5 luasocket luasec luaexpat libidn openssl makeWrapper ]; 20 + communityModules = fetchhg { 21 + url = "http://prosody-modules.googlecode.com/hg/"; 22 + rev = "4b55110b0aa8"; 23 + sha256 = "0010x2rl9f9ihy2nwqan2jdlz25433srj2zna1xh10490mc28hij"; 24 + }; 25 + 26 + buildInputs = [ lua5 luasocket luasec luaexpat luabitop libidn openssl makeWrapper ]; 21 27 22 28 configureFlags = [ 23 29 "--ostype=linux" ··· 26 32 ]; 27 33 28 34 postInstall = '' 35 + cp $communityModules/mod_websocket/mod_websocket.lua $out/lib/prosody/modules/ 29 36 wrapProgram $out/bin/prosody \ 30 37 --set LUA_PATH '"${luaPath};"' \ 31 38 --set LUA_CPATH '"${luaCPath};"'
+1 -1
pkgs/top-level/all-packages.nix
··· 7226 7226 prosody = recurseIntoAttrs ( 7227 7227 callPackage ../servers/xmpp/prosody { 7228 7228 lua5 = lua5_1; 7229 - inherit (lua51Packages) luasocket luasec luaexpat luafilesystem; 7229 + inherit (lua51Packages) luasocket luasec luaexpat luafilesystem luabitop; 7230 7230 }); 7231 7231 7232 7232 elasticmq = callPackage ../servers/elasticmq { };
+25
pkgs/top-level/lua-packages.nix
··· 23 23 inherit lua; 24 24 }; 25 25 26 + luabitop = buildLuaPackage rec { 27 + version = "1.0.2"; 28 + name = "bitop-${version}"; 29 + src = fetchurl { 30 + url = "http://bitop.luajit.org/download/LuaBitOp-${version}.tar.gz"; 31 + sha256 = "16fffbrgfcw40kskh2bn9q7m3gajffwd2f35rafynlnd7llwj1qj"; 32 + }; 33 + 34 + preBuild = '' 35 + makeFlagsArray=( 36 + INCLUDES="-I${lua}/include" 37 + LUA="${lua}/bin/lua"); 38 + ''; 39 + 40 + installPhase = '' 41 + mkdir -p $out/lib/lua/${lua.luaversion} 42 + install -p bit.so $out/lib/lua/${lua.luaversion} 43 + ''; 44 + 45 + meta = { 46 + homepage = "http://bitop.luajit.org"; 47 + maintainers = with maintainers; [ flosse ]; 48 + }; 49 + }; 50 + 26 51 luaexpat = buildLuaPackage rec { 27 52 version = "1.3.0"; 28 53 name = "expat-${version}";