From 98a00c76219180f5b39463a1132e5ae69fbb77a7 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 30 Sep 2015 16:30:31 +0200 Subject: provisions for completely custom modules --- customized/prosody.nix | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/customized/prosody.nix b/customized/prosody.nix index 80246636..0b2a9a46 100644 --- a/customized/prosody.nix +++ b/customized/prosody.nix @@ -1,7 +1,7 @@ { stdenv, fetchurl, libidn, openssl, makeWrapper, fetchhg , lua5, luasocket, luasec, luaexpat, luafilesystem, luabitop, luaevent ? null, luazlib ? null , withLibevent ? true, withZlib ? true -, extraModules ? [], extraLibs ? [] +, communityModules ? [], extraLibs ? [], extraModules ? [] }: assert withLibevent -> luaevent != null; @@ -10,17 +10,19 @@ assert withZlib -> luazlib != null; with stdenv.lib; let - libs = [ luasocket luasec luaexpat luafilesystem luabitop ] - ++ optional withLibevent luaevent - ++ optional withZlib luazlib - ++ extraLibs; - 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"; - copyModule = name : "cp -rv $communityModules/${name} $out/lib/prosody/modules/"; - luaPath = concatStringsSep ";" (map getLuaPath libs); - luaCPath = concatStringsSep ";" (map getLuaCPath libs); - copyModules = concatStringsSep ";" (map copyModule (extraModules ++ ["mod_websocket"])); + libs = [ luasocket luasec luaexpat luafilesystem luabitop ] + ++ optional withLibevent luaevent + ++ optional withZlib luazlib + ++ extraLibs; + 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"; + copyModule = name : "cp -rv $communityModules/${name} $out/lib/prosody/modules/"; + copyExtraModule = path : "cp -rv $name/* $out/lib/prosody/modules/" + luaPath = concatStringsSep ";" (map getLuaPath libs); + luaCPath = concatStringsSep ";" (map getLuaCPath libs); + copyModules = concatStringsSep ";" (map copyModule (communityModules ++ ["mod_websocket"])); + copyExtraModules = concatStringsSep ";" (map copyExtraModule extraModules); in stdenv.mkDerivation rec { @@ -50,6 +52,7 @@ stdenv.mkDerivation rec { postInstall = '' ${copyModules} + ${copyExtraModules} wrapProgram $out/bin/prosody \ --set LUA_PATH '"${luaPath};"' \ --set LUA_CPATH '"${luaCPath};"' -- cgit v1.2.3