diff options
author | Matthieu Coudron <mcoudron@hotmail.com> | 2021-09-12 00:00:26 +0200 |
---|---|---|
committer | Matthieu Coudron <mcoudron@hotmail.com> | 2021-09-12 03:02:55 +0200 |
commit | 0b6d33c2ed177be6d937e3043ac77252007a77b1 (patch) | |
tree | 16a25119d6e10045bd44be2e068f70b68b829438 /pkgs/servers/xmpp | |
parent | 03806dfee73c18ce4d55542af46e7af8816a673b (diff) |
prosody: simplify lua aspects
Diffstat (limited to 'pkgs/servers/xmpp')
-rw-r--r-- | pkgs/servers/xmpp/prosody/default.nix | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/pkgs/servers/xmpp/prosody/default.nix b/pkgs/servers/xmpp/prosody/default.nix index 43e77d918e1c4..ac4939c149904 100644 --- a/pkgs/servers/xmpp/prosody/default.nix +++ b/pkgs/servers/xmpp/prosody/default.nix @@ -1,19 +1,24 @@ { stdenv, fetchurl, lib, libidn, openssl, makeWrapper, fetchhg -, lua5, luasocket, luasec, luaexpat, luafilesystem, luabitop +, lua , nixosTests -, withLibevent ? true, luaevent ? null +, withLibevent ? true , withDBI ? true, luadbi ? null # use withExtraLibs to add additional dependencies of community modules , withExtraLibs ? [ ] , withOnlyInstalledCommunityModules ? [ ] , withCommunityModules ? [ ] }: -assert withLibevent -> luaevent != null; -assert withDBI -> luadbi != null; - with lib; +let + luaEnv = lua.withPackages(p: with p;[ + luasocket luasec luaexpat luafilesystem luabitop luadbi-sqlite3 + ] + ++ lib.optional withLibevent p.luaevent + ++ lib.optional withDBI p.luadbi + ); +in stdenv.mkDerivation rec { version = "0.11.10"; # also update communityModules pname = "prosody"; @@ -41,28 +46,24 @@ stdenv.mkDerivation rec { sha256 = "02gj1b8sdmdvymsdmjpq47zrl7sg578jcdxbbq18s44f3njmc9q1"; }; + nativeBuildInputs = [ makeWrapper ]; buildInputs = [ - lua5 makeWrapper libidn openssl - ] - # Lua libraries - ++ [ - luasocket luasec luaexpat luafilesystem luabitop + luaEnv libidn openssl ] - ++ optional withLibevent luaevent - ++ optional withDBI luadbi ++ withExtraLibs; configureFlags = [ "--ostype=linux" - "--with-lua-include=${lua5}/include" - "--with-lua=${lua5}" + "--with-lua-include=${luaEnv}/include" + "--with-lua=${luaEnv}" ]; postBuild = '' make -C tools/migration ''; + # the wrapping should go away once lua hook is fixed postInstall = '' ${concatMapStringsSep "\n" (module: '' cp -r $communityModules/mod_${module} $out/lib/prosody/modules/ |