summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorOrivej Desh <orivej@gmx.fr>2017-12-09 09:19:24 +0000
committerGitHub <noreply@github.com>2017-12-09 09:19:24 +0000
commit40950f6a2d081797957ac26b59655d96d26ff770 (patch)
treea56bb36931530c09a9e1b3dc82e1a1b3e960836d /pkgs
parenta16501cd449e6dcb232a0779715b1cf1b12ab671 (diff)
parentc84cb83e40b2bac6314d46389fc0478e334c9c2c (diff)
downloadnixlib-40950f6a2d081797957ac26b59655d96d26ff770.tar
nixlib-40950f6a2d081797957ac26b59655d96d26ff770.tar.gz
nixlib-40950f6a2d081797957ac26b59655d96d26ff770.tar.bz2
nixlib-40950f6a2d081797957ac26b59655d96d26ff770.tar.lz
nixlib-40950f6a2d081797957ac26b59655d96d26ff770.tar.xz
nixlib-40950f6a2d081797957ac26b59655d96d26ff770.tar.zst
nixlib-40950f6a2d081797957ac26b59655d96d26ff770.zip
Merge pull request #31006 from florianjacob/prosody
 Improvements for Prosody
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/interpreters/lua-5/filesystem.nix2
-rw-r--r--pkgs/servers/xmpp/prosody/default.nix30
-rw-r--r--pkgs/top-level/all-packages.nix2
-rw-r--r--pkgs/top-level/lua-packages.nix75
4 files changed, 88 insertions, 21 deletions
diff --git a/pkgs/development/interpreters/lua-5/filesystem.nix b/pkgs/development/interpreters/lua-5/filesystem.nix
index 21f656044a33..7aa41e95cc9b 100644
--- a/pkgs/development/interpreters/lua-5/filesystem.nix
+++ b/pkgs/development/interpreters/lua-5/filesystem.nix
@@ -21,6 +21,6 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = https://github.com/keplerproject/luafilesystem;
     hydraPlatforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.flosse ];
+    maintainers = [ ];
   };
 }
diff --git a/pkgs/servers/xmpp/prosody/default.nix b/pkgs/servers/xmpp/prosody/default.nix
index 3285456a3485..b0e3492c0da1 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 = "9a3e51f348fe";
+    sha256 = "09g4vi52rv0r3jzcm0bsgp4ngqq6iapfbxfh0l7qj36qnajp4vm6";
   };
 
-  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};'
@@ -59,6 +67,6 @@ stdenv.mkDerivation rec {
     license = licenses.mit;
     homepage = http://www.prosody.im;
     platforms = platforms.linux;
-    maintainers = [ maintainers.flosse ];
+    maintainers = [ ];
   };
 }
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 22d521cabfc5..6ff6ff6dcf7d 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -11606,7 +11606,7 @@ with pkgs;
 
   prosody = callPackage ../servers/xmpp/prosody {
     lua5 = lua5_1;
-    inherit (lua51Packages) luasocket luasec luaexpat luafilesystem luabitop luaevent luazlib;
+    inherit (lua51Packages) luasocket luasec luaexpat luafilesystem luabitop luaevent luazlib luadbi;
   };
 
   biboumi = callPackage ../servers/xmpp/biboumi { };
diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix
index 47299791e86b..1bceac77f8f4 100644
--- a/pkgs/top-level/lua-packages.nix
+++ b/pkgs/top-level/lua-packages.nix
@@ -8,6 +8,7 @@
 { fetchurl, fetchzip, stdenv, lua, callPackage, unzip, zziplib, pkgconfig, libtool
 , pcre, oniguruma, gnulib, tre, glibc, sqlite, openssl, expat, cairo
 , perl, gtk2, python, glib, gobjectIntrospection, libevent, zlib, autoreconfHook
+, libmysql, postgresql, cyrus_sasl
 , fetchFromGitHub, libmpack, which
 }:
 
@@ -71,7 +72,7 @@ let
       description = "C extension module for Lua which adds bitwise operations on numbers";
       homepage = "http://bitop.luajit.org";
       license = licenses.mit;
-      maintainers = with maintainers; [ flosse ];
+      maintainers = with maintainers; [ ];
     };
   };
 
@@ -105,6 +106,35 @@ let
     };
   };
 
+  luacyrussasl = buildLuaPackage rec {
+    version = "1.1.0";
+    name = "lua-cyrussasl-${version}";
+    src = fetchFromGitHub {
+      owner = "JorjBauer";
+      repo = "lua-cyrussasl";
+      rev = "v${version}";
+      sha256 = "14kzm3vk96k2i1m9f5zvpvq4pnzaf7s91h5g4h4x2bq1mynzw2s1";
+    };
+
+    preBuild = ''
+      makeFlagsArray=(
+        CFLAGS="-O2 -fPIC"
+        LDFLAGS="-O -shared -fpic -lsasl2"
+        LUAPATH="$out/share/lua/${lua.luaversion}"
+        CPATH="$out/lib/lua/${lua.luaversion}"
+      );
+      mkdir -p $out/{share,lib}/lua/${lua.luaversion}
+    '';
+
+    buildInputs = [ cyrus_sasl ];
+
+    meta = with stdenv.lib; {
+      homepage = "https://github.com/JorjBauer/lua-cyrussasl";
+      description = "Cyrus SASL library for Lua 5.1+";
+      license = licenses.bsd3;
+    };
+  };
+
   luaevent = buildLuaPackage rec {
     version = "0.4.3";
     name = "luaevent-${version}";
@@ -140,7 +170,6 @@ let
   luaexpat = buildLuaPackage rec {
     version = "1.3.0";
     name = "expat-${version}";
-    isLibrary = true;
 
     src = fetchurl {
       url = "https://matthewwild.co.uk/projects/luaexpat/luaexpat-${version}.tar.gz";
@@ -172,14 +201,42 @@ let
     };
   };
 
+  luadbi = buildLuaPackage rec {
+    name = "luadbi-${version}";
+    version = "0.5";
+    src = fetchurl {
+      url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/luadbi/luadbi.${version}.tar.gz";
+      sha256 = "07ikxgxgfpimnwf7zrqwcwma83ss3wm2nzjxpwv2a1c0vmc684a9";
+    };
+    sourceRoot = ".";
+
+    buildInputs = [ libmysql postgresql sqlite ];
+
+    NIX_CFLAGS_COMPILE = [
+      "-I${libmysql.dev}/include/mysql"
+      "-I${postgresql}/include/server"
+    ];
+
+    installPhase = ''
+      mkdir -p $out/lib/lua/${lua.luaversion}
+      install -p DBI.lua *.so $out/lib/lua/${lua.luaversion}
+    '';
+
+    meta = with stdenv.lib; {
+      homepage = "https://code.google.com/archive/p/luadbi/";
+      platforms = stdenv.lib.platforms.unix;
+    };
+  };
+
   luafilesystem = buildLuaPackage rec {
-    name = "filesystem-1.6.2";
+    version = "1.6.3";
+    name = "filesystem-${version}";
 
     src = fetchFromGitHub {
       owner = "keplerproject";
       repo = "luafilesystem";
-      rev = "v1_6_2";
-      sha256 = "134azkxw84xp9g5qmzjsmcva629jm7plwcmjxkdzdg05vyd7kig1";
+      rev = "v${stdenv.lib.replaceChars ["."] ["_"] version}";
+      sha256 = "1hxcnqj53540ysyw8fzax7f09pl98b8f55s712gsglcdxp2g2pri";
     };
 
     preConfigure = ''
@@ -224,12 +281,12 @@ let
   };
 
   lpty = buildLuaPackage rec {
+    version = "1.2.1";
     name = "lpty-${version}";
-    version = "1.1.1";
 
     src = fetchurl {
-      url = "http://www.tset.de/downloads/lpty-1.1-1.tar.gz";
-      sha256 = "0d4ffda654dcf37dd8c99bcd100d0ee0dde7782cbd0ba9200ef8711c5cab02f1";
+      url = "http://www.tset.de/downloads/lpty-${version}-1.tar.gz";
+      sha256 = "0rgvbpymcgdkzdwfag607xfscs9xyqxg0dj0qr5fv906mi183gs6";
     };
 
     preBuild = ''
@@ -331,6 +388,8 @@ let
       );
     '';
 
+    installTargets = [ "install" "install-unix" ];
+
     meta = with stdenv.lib; {
       description = "Network support for Lua";
       homepage = "http://w3.impa.br/~diego/software/luasocket/";