lua*Packages.http: 0.3 -> 0.4 (and generate)

One bugfix patch is included - merged upstream but not released yet.
knot-resolver wrapper would need to add binaryheap explicitly,
so it's migrated to the automatic LUA path discovery instead.
This commit is contained in:
Vladimír Čunát 2019-05-01 11:19:49 +02:00
parent 90f8161745
commit 110fb944f1
No known key found for this signature in database
GPG key ID: E747DF1F9575A3AA
5 changed files with 49 additions and 45 deletions

View file

@ -5,6 +5,7 @@ basexx,
binaryheap,
dkjson
fifo
http
inspect
lgi
lpeg_patterns

1 # nix name, luarocks name, server, version/additionnal args
5 binaryheap,
6 dkjson
7 fifo
8 http
9 inspect
10 lgi
11 lpeg_patterns

View file

@ -130,6 +130,26 @@ fifo = buildLuarocksPackage {
};
};
};
http = buildLuarocksPackage {
pname = "http";
version = "0.3-0";
src = fetchurl {
url = https://luarocks.org/http-0.3-0.src.rock;
sha256 = "0vvl687bh3cvjjwbyp9cphqqccm3slv4g7y3h03scp3vpq9q4ccq";
};
disabled = ( luaOlder "5.1");
propagatedBuildInputs = [ lua compat53 bit32 cqueues luaossl basexx lpeg lpeg_patterns binaryheap fifo ];
buildType = "builtin";
meta = {
homepage = "https://github.com/daurnimator/lua-http";
description="HTTP library for Lua";
license = {
fullName = "MIT";
};
};
};
inspect = buildLuarocksPackage {
pname = "inspect";
version = "3.1.1-0";

View file

@ -81,4 +81,21 @@ with super;
maintainers = with pkgs.lib.maintainers; oa.meta.maintainers ++ [ vcunat ];
};
});
http = super.http.overrideAttrs(oa: {
patches = oa.patches or [] ++ [
(pkgs.fetchpatch {
name = "invalid-state-progression.patch";
url = "https://github.com/daurnimator/lua-http/commit/cb7b59474a.diff";
sha256 = "1vmx039n3nqfx50faqhs3wgiw28ws416rhw6vh6srmh9i826dac7";
})
];
/* TODO: separate docs derivation? (pandoc is heavy)
nativeBuildInputs = [ pandoc ];
makeFlags = [ "-C doc" "lua-http.html" "lua-http.3" ];
*/
meta = oa.meta // {
maintainers = with pkgs.lib.maintainers; oa.meta.maintainers ++ [ vcunat ];
};
});
}

View file

@ -75,26 +75,24 @@ unwrapped = stdenv.mkDerivation rec {
};
};
wrapped-full = with luajitPackages; let
luaPkgs = [
luasec luasocket # trust anchor bootstrap, prefill module
lfs # prefill module
# Almost all is for the 'http' module:
http cqueues fifo lpeg lpeg_patterns luaossl compat53 basexx
];
in runCommand unwrapped.name
wrapped-full = runCommand unwrapped.name
{
nativeBuildInputs = [ makeWrapper ];
buildInputs = with luajitPackages; [
luasec luasocket # trust anchor bootstrap, prefill module
lfs # prefill module
http # for http module; brings lots of deps; some are useful elsewhere
];
preferLocalBuild = true;
allowSubstitutes = false;
}
''
mkdir -p "$out/sbin" "$out/share"
makeWrapper '${unwrapped}/sbin/kresd' "$out"/sbin/kresd \
--set LUA_PATH '${concatStringsSep ";" (map getLuaPath luaPkgs)}' \
--set LUA_CPATH '${concatStringsSep ";" (map getLuaCPath luaPkgs)}'
mkdir -p "$out"/{bin,share}
makeWrapper '${unwrapped}/bin/kresd' "$out"/bin/kresd \
--set LUA_PATH "$LUA_PATH" \
--set LUA_CPATH "$LUA_CPATH"
ln -sr '${unwrapped}/share/man' "$out"/share/
ln -sr "$out"/{sbin,bin}
ln -sr "$out"/{bin,sbin}
'';
in result

View file

@ -193,38 +193,6 @@ with self; {
};
};
http = buildLuaPackage rec {
version = "0.2";
name = "http-${version}";
src = fetchFromGitHub {
owner = "daurnimator";
repo = "lua-http";
rev = "v${version}";
sha256 = "0a8vsj49alaf1fkhv51n5mgpjq8izfff3shcjs8xk7p2bc46vd7i";
};
/* TODO: separate docs derivation? (pandoc is heavy)
nativeBuildInputs = [ pandoc ];
makeFlags = [ "-C doc" "lua-http.html" "lua-http.3" ];
*/
buildPhase = ":";
installPhase = ''
install -Dt "$out/lib/lua/${lua.luaversion}/http" \
http/*.lua
install -Dt "$out/lib/lua/${lua.luaversion}/http/compat" \
http/compat/*.lua
'';
meta = with stdenv.lib; {
description = "HTTP library for lua";
homepage = "https://daurnimator.github.io/lua-http/${version}/";
license = licenses.mit;
maintainers = with maintainers; [ vcunat ];
};
};
luacyrussasl = buildLuaPackage rec {
version = "1.1.0";
name = "lua-cyrussasl-${version}";