summary refs log tree commit diff
path: root/pkgs/servers/xmpp
diff options
context:
space:
mode:
authorAlexei Robyn <shados@shados.net>2019-06-13 21:01:10 +1000
committerAlexei Robyn <shados@shados.net>2019-06-14 13:17:15 +1000
commit274715cbc355e9d50e07a2f60a65a183f7d9855d (patch)
tree52131c594bc72a6a8d07fd64f45ad9ec82fdbe33 /pkgs/servers/xmpp
parent8eabbb3d205541a33658779dc70dc217d3161ed2 (diff)
downloadnixpkgs-274715cbc355e9d50e07a2f60a65a183f7d9855d.tar
nixpkgs-274715cbc355e9d50e07a2f60a65a183f7d9855d.tar.gz
nixpkgs-274715cbc355e9d50e07a2f60a65a183f7d9855d.tar.bz2
nixpkgs-274715cbc355e9d50e07a2f60a65a183f7d9855d.tar.lz
nixpkgs-274715cbc355e9d50e07a2f60a65a183f7d9855d.tar.xz
nixpkgs-274715cbc355e9d50e07a2f60a65a183f7d9855d.tar.zst
nixpkgs-274715cbc355e9d50e07a2f60a65a183f7d9855d.zip
luaPackages: Replace all rockspec packages with generated ones
luaPackages replaced by generated ones:
- bit32
- compat53
- cqueues
- luacyrussasl -> cyrussasl (luarocks name)
- luaexpat
- luadbi -> luadbi front-end module + separate backend modules
  luadbi-{mysql,postgresql,sqlite3}
- luafilesystem
- luaossl
- luasec
- luasocket
- luastdlib -> stdlib (luarocks name)
- lrexlib -> lrexlib-pcre (we already have lrexlib-gnu and
  lrexlib-posix, lrexlib-pcre however appears to be the variant used in
  mudlet, which is the only current dep in nixpkgs)
- luasqlite -> luasql-sqlite3 (luarocks name)
- lfs -> luafilesytem (we literally had two manually written
  luafilesystem expressions, under different names)

Changes and additions to overrides to generated luarocks packgaes,
including:
- busted: Install bash completions along with the zsh ones
- cqueues:
    - Perform minor surgery on the rockspec to allow using a single
      rockspec to build for all supported Lua versions
    - Add a patch by @vcunat to work around a build issue
- luuid: Wrote a tiny patch to allow for Lua 5.1/Luajit compatibility
- General changes:
    - Sorted the packages
    - Attempted to make the formatting consistent
    - Preferenced `.override` instead of `.overrideAttrs` wherever
      possible

Minor changes to other packages to adjust for the Lua package changes:
- luakit expression simplified
- prosody expression simplified; but users will now need to specify the
  luadbi backend module they intend to use in withExtraLibs
- knot-resolver inputs correctd
- mudlet inputs corrected (although this package was and should still be
  broken)
Diffstat (limited to 'pkgs/servers/xmpp')
-rw-r--r--pkgs/servers/xmpp/prosody/default.nix32
1 files changed, 15 insertions, 17 deletions
diff --git a/pkgs/servers/xmpp/prosody/default.nix b/pkgs/servers/xmpp/prosody/default.nix
index 28be53b4e6c..928c4832965 100644
--- a/pkgs/servers/xmpp/prosody/default.nix
+++ b/pkgs/servers/xmpp/prosody/default.nix
@@ -12,17 +12,6 @@ assert withDBI -> luadbi != null;
 
 with stdenv.lib;
 
-let
-  libs        = [ luasocket luasec luaexpat luafilesystem luabitop ]
-                ++ optional withLibevent luaevent
-                ++ 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";
-  luaPath     = concatStringsSep ";" (map getLuaPath  libs);
-  luaCPath    = concatStringsSep ";" (map getLuaCPath libs);
-in
 
 stdenv.mkDerivation rec {
   version = "0.11.2"; # also update communityModules
@@ -42,8 +31,17 @@ stdenv.mkDerivation rec {
     sha256 = "0bzn92j48krb2zhp9gn5bbn5sg0qv15j5lpxfszwqdln3lpmrvzg";
   };
 
-  buildInputs = [ lua5 makeWrapper libidn openssl ]
-    ++ optional withDBI luadbi;
+  buildInputs = [
+    lua5 makeWrapper libidn openssl
+  ]
+  # Lua libraries
+  ++ [
+    luasocket luasec luaexpat luafilesystem luabitop
+  ]
+  ++ optional withLibevent luaevent
+  ++ optional withDBI luadbi
+  ++ withExtraLibs;
+
 
   configureFlags = [
     "--ostype=linux"
@@ -56,12 +54,12 @@ stdenv.mkDerivation rec {
         cp -r $communityModules/mod_${module} $out/lib/prosody/modules/
       '') (withCommunityModules ++ withOnlyInstalledCommunityModules)}
       wrapProgram $out/bin/prosody \
-        --set LUA_PATH '${luaPath};' \
-        --set LUA_CPATH '${luaCPath};'
+        --prefix LUA_PATH ';' "$NIX_LUA_PATH" \
+        --prefix LUA_CPATH ';' "$NIX_LUA_CPATH"
       wrapProgram $out/bin/prosodyctl \
         --add-flags '--config "/etc/prosody/prosody.cfg.lua"' \
-        --set LUA_PATH '${luaPath};' \
-        --set LUA_CPATH '${luaCPath};'
+        --prefix LUA_PATH ';' "$NIX_LUA_PATH" \
+        --prefix LUA_CPATH ';' "$NIX_LUA_CPATH"
     '';
 
   passthru.communityModules = withCommunityModules;