summary refs log tree commit diff
path: root/pkgs/servers/xmpp/prosody
diff options
context:
space:
mode:
authorSatoshi Shishiku <satoshi.shishiku@tuta.io>2017-03-01 00:57:02 +0000
committerFlorian Jacob <projects+git@florianjacob.de>2017-11-01 13:38:00 +0100
commit988ce5433f9b452dd419d7ada9a033fa4e44a8fc (patch)
tree75b711cf77039feff2ef13e0fe7a25abba9ba604 /pkgs/servers/xmpp/prosody
parent7d0b910361899ef9fdfa6b2e9e2c7b078da019c3 (diff)
downloadnixpkgs-988ce5433f9b452dd419d7ada9a033fa4e44a8fc.tar
nixpkgs-988ce5433f9b452dd419d7ada9a033fa4e44a8fc.tar.gz
nixpkgs-988ce5433f9b452dd419d7ada9a033fa4e44a8fc.tar.bz2
nixpkgs-988ce5433f9b452dd419d7ada9a033fa4e44a8fc.tar.lz
nixpkgs-988ce5433f9b452dd419d7ada9a033fa4e44a8fc.tar.xz
nixpkgs-988ce5433f9b452dd419d7ada9a033fa4e44a8fc.tar.zst
nixpkgs-988ce5433f9b452dd419d7ada9a033fa4e44a8fc.zip
prosody: support for DBI, extra community modules and extra Lua libraries
Diffstat (limited to 'pkgs/servers/xmpp/prosody')
-rw-r--r--pkgs/servers/xmpp/prosody/default.nix28
1 files changed, 18 insertions, 10 deletions
diff --git a/pkgs/servers/xmpp/prosody/default.nix b/pkgs/servers/xmpp/prosody/default.nix
index 3285456a348..b6af22883bc 100644
--- a/pkgs/servers/xmpp/prosody/default.nix
+++ b/pkgs/servers/xmpp/prosody/default.nix
@@ -1,16 +1,24 @@
 { stdenv, fetchurl, libidn, openssl, makeWrapper, fetchhg
-, lua5, luasocket, luasec, luaexpat, luafilesystem, luabitop, luaevent ? null, luazlib ? null
-, withLibevent ? true, withZlib ? true }:
+, lua5, luasocket, luasec, luaexpat, luafilesystem, luabitop
+, withLibevent ? true, luaevent ? null
+, withZlib ? true, luazlib ? null
+, withDBI ? true, luadbi ? null
+# use withExtraLibs to add additional dependencies of community modules
+, withExtraLibs ? [ ]
+, withCommunityModules ? [ ] }:
 
 assert withLibevent -> luaevent != null;
 assert withZlib -> luazlib != null;
+assert withDBI -> luadbi != null;
 
 with stdenv.lib;
 
 let
   libs        = [ luasocket luasec luaexpat luafilesystem luabitop ]
                 ++ optional withLibevent luaevent
-                ++ optional withZlib luazlib;
+                ++ optional withZlib luazlib
+                ++ optional withDBI luadbi
+                ++ withExtraLibs;
   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";
@@ -28,14 +36,12 @@ stdenv.mkDerivation rec {
   };
 
   communityModules = fetchhg {
-    url = "http://prosody-modules.googlecode.com/hg/";
-    rev = "4b55110b0aa8";
-    sha256 = "0010x2rl9f9ihy2nwqan2jdlz25433srj2zna1xh10490mc28hij";
+    url = "https://hg.prosody.im/prosody-modules";
+    rev = "590ac12b7671";
+    sha256 = "02f3nmvbidm2f32v6kvc1ljmslysgk0ab2lpg91szy0agmmj5xja";
   };
 
-  buildInputs = [ lua5 luasocket luasec luaexpat luabitop libidn openssl makeWrapper ]
-                ++ optional withLibevent luaevent
-                ++ optional withZlib luazlib;
+  buildInputs = [ lua5 makeWrapper libidn openssl ];
 
   configureFlags = [
     "--ostype=linux"
@@ -44,7 +50,9 @@ stdenv.mkDerivation rec {
   ];
 
   postInstall = ''
-      cp $communityModules/mod_websocket/mod_websocket.lua $out/lib/prosody/modules/
+      ${concatMapStringsSep "\n" (module: ''
+        cp -r $communityModules/mod_${module} $out/lib/prosody/modules/
+      '') withCommunityModules}
       wrapProgram $out/bin/prosody \
         --set LUA_PATH '${luaPath};' \
         --set LUA_CPATH '${luaCPath};'