prosody: add dependency on zlib (close #6894)

@vcunat moved the defaults inside the prosody expression.
This commit is contained in:
koral 2015-03-19 11:31:36 +00:00 committed by Vladimír Čunát
parent 208400cb3e
commit 1b4722ac82
3 changed files with 42 additions and 6 deletions

View file

@ -1,11 +1,16 @@
{ stdenv, fetchurl, lua5, luasocket, luasec, luaexpat, luafilesystem, luabitop, luaevent ? null, libidn, openssl, makeWrapper, fetchhg, withLibevent ? false }: { stdenv, fetchurl, libidn, openssl, makeWrapper, fetchhg
, lua5, luasocket, luasec, luaexpat, luafilesystem, luabitop, luaevent ? null, luazlib ? null
, withLibevent ? true, withZlib ? true }:
assert withLibevent -> luaevent != null; assert withLibevent -> luaevent != null;
assert withZlib -> luazlib != null;
with stdenv.lib; with stdenv.lib;
let let
libs = [ luasocket luasec luaexpat luafilesystem luabitop ] ++ optional withLibevent luaevent; libs = [ luasocket luasec luaexpat luafilesystem luabitop ]
++ optional withLibevent luaevent
++ optional withZlib luazlib;
getPath = lib : type : "${lib}/lib/lua/${lua5.luaversion}/?.${type};${lib}/share/lua/${lua5.luaversion}/?.${type}"; getPath = lib : type : "${lib}/lib/lua/${lua5.luaversion}/?.${type};${lib}/share/lua/${lua5.luaversion}/?.${type}";
getLuaPath = lib : getPath lib "lua"; getLuaPath = lib : getPath lib "lua";
getLuaCPath = lib : getPath lib "so"; getLuaCPath = lib : getPath lib "so";
@ -29,7 +34,8 @@ stdenv.mkDerivation rec {
}; };
buildInputs = [ lua5 luasocket luasec luaexpat luabitop libidn openssl makeWrapper ] buildInputs = [ lua5 luasocket luasec luaexpat luabitop libidn openssl makeWrapper ]
++ optional withLibevent luaevent; ++ optional withLibevent luaevent
++ optional withZlib luazlib;
configureFlags = [ configureFlags = [
"--ostype=linux" "--ostype=linux"

View file

@ -8266,8 +8266,7 @@ let
prosody = callPackage ../servers/xmpp/prosody { prosody = callPackage ../servers/xmpp/prosody {
lua5 = lua5_1; lua5 = lua5_1;
inherit (lua51Packages) luasocket luasec luaexpat luafilesystem luabitop luaevent; inherit (lua51Packages) luasocket luasec luaexpat luafilesystem luabitop luaevent luazlib;
withLibevent = true;
}; };
elasticmq = callPackage ../servers/elasticmq { }; elasticmq = callPackage ../servers/elasticmq { };

View file

@ -7,7 +7,7 @@
{ fetchurl, stdenv, lua, callPackage, unzip, zziplib, pkgconfig, libtool { fetchurl, stdenv, lua, callPackage, unzip, zziplib, pkgconfig, libtool
, pcre, oniguruma, gnulib, tre, glibc, sqlite, openssl, expat, cairo , pcre, oniguruma, gnulib, tre, glibc, sqlite, openssl, expat, cairo
, perl, gtk, python, glib, gobjectIntrospection, libevent , perl, gtk, python, glib, gobjectIntrospection, libevent, zlib
}: }:
let let
@ -205,6 +205,37 @@ let
}; };
}; };
luazlib = buildLuaPackage rec {
name = "zlib-${version}";
version = "0.4";
src = fetchurl {
url = "https://github.com/brimworks/lua-zlib/archive/v${version}.tar.gz";
sha256 = "1l32nwyh8b4vicxvlhbv9qhkhklbhvjfn8wd72bjk7ac9kz172rd";
};
buildInputs = [ zlib ];
preBuild = ''
makeFlagsArray=(
linux
LUAPATH="$out/share/lua/${lua.luaversion}"
LUACPATH="$out/lib/lua/${lua.luaversion}"
INCDIR="-I${lua}/include"
LIBDIR="-L$out/lib");
'';
preInstall = "mkdir -p $out/lib/lua/${lua.luaversion}";
meta = with stdenv.lib; {
homepage = https://github.com/brimworks/lua-zlib;
hydraPlatforms = platforms.linux;
license = licenses.mit;
maintainers = [ maintainers.koral ];
};
};
luastdlib = buildLuaPackage { luastdlib = buildLuaPackage {
name = "stdlib"; name = "stdlib";
src = fetchurl { src = fetchurl {