From 112021b166569e309bf40e964bde7b292451a5c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 30 Jul 2018 14:17:35 +0200 Subject: [PATCH 1/9] lua*Packages.cqueues: init at 20171014 --- pkgs/top-level/lua-packages.nix | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix index c7d4c18810f..9c7c99a763d 100644 --- a/pkgs/top-level/lua-packages.nix +++ b/pkgs/top-level/lua-packages.nix @@ -7,7 +7,7 @@ { fetchurl, stdenv, lua, callPackage, unzip, zziplib, pkgconfig , pcre, oniguruma, gnulib, tre, glibc, sqlite, openssl, expat -, glib, gobjectIntrospection, libevent, zlib, autoreconfHook +, glib, gobjectIntrospection, libevent, zlib, autoreconfHook, gnum4 , mysql, postgresql, cyrus_sasl , fetchFromGitHub, libmpack, which, fetchpatch, writeText }: @@ -72,6 +72,29 @@ let }; }; + cqueues = buildLuaPackage rec { + name = "cqueues-${version}"; + version = "20171014"; + + src = fetchurl { + url = "http://www.25thandclement.com/~william/projects/releases/${name}.tgz"; + sha256 = "1dabhpn6r0hlln8vx9hxm34pfcm46qzgpb2apmziwg5z51fi4ksb"; + }; + + preConfigure = ''export prefix=$out''; + + nativeBuildInputs = [ gnum4 ]; + buildInputs = [ openssl ]; + + meta = with stdenv.lib; { + description = "A type of event loop for Lua"; + homepage = "https://www.25thandclement.com/~william/projects/cqueues.html"; + license = licenses.mit; + maintainers = with maintainers; [ vcunat ]; + platforms = platforms.unix; + }; + }; + luabitop = buildLuaPackage rec { version = "1.0.2"; name = "bitop-${version}"; From 3a808133d3521520f5a12742c10794a28784898a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 30 Jul 2018 16:23:51 +0200 Subject: [PATCH 2/9] lua*Packages.fifo: init at 0.2 --- pkgs/top-level/lua-packages.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix index 9c7c99a763d..d073ea96c93 100644 --- a/pkgs/top-level/lua-packages.nix +++ b/pkgs/top-level/lua-packages.nix @@ -95,6 +95,32 @@ let }; }; + fifo = buildLuaPackage rec { + version = "0.2"; + name = "fifo-${version}"; + + src = fetchFromGitHub { + owner = "daurnimator"; + repo = "fifo.lua"; + rev = version; + sha256 = "1800k7h5hxsvm05bjdr65djjml678lwb0661cll78z1ys2037nzn"; + }; + + buildPhase = ":"; + installPhase = '' + mkdir -p "$out/lib/lua/${lua.luaversion}" + mv fifo.lua "$out/lib/lua/${lua.luaversion}/" + ''; + + meta = with stdenv.lib; { + description = "A lua library/'class' that implements a FIFO"; + homepage = "https://github.com/daurnimator/fifo.lua"; + license = licenses.mit; + maintainers = with maintainers; [ vcunat ]; + platforms = platforms.all; + }; + }; + luabitop = buildLuaPackage rec { version = "1.0.2"; name = "bitop-${version}"; From 4aa324ac5a9e1df58ba1c08f14888fe04c36fac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 30 Jul 2018 16:31:40 +0200 Subject: [PATCH 3/9] lua*Packages.lpeg_patterns: init at 0.5 --- pkgs/top-level/lua-packages.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix index d073ea96c93..073174954d3 100644 --- a/pkgs/top-level/lua-packages.nix +++ b/pkgs/top-level/lua-packages.nix @@ -737,6 +737,32 @@ let }; }; + lpeg_patterns = buildLuaPackage rec { + version = "0.5"; + name = "lpeg_patterns-${version}"; + + src = fetchFromGitHub { + owner = "daurnimator"; + repo = "lpeg_patterns"; + rev = "v${version}"; + sha256 = "1s3c179a64r45ffkawv9dnxw4mzwkzj00nr9z2gs5haajgpjivw6"; + }; + + buildPhase = ":"; + installPhase = '' + mkdir -p "$out/lib/lua/${lua.luaversion}" + mv lpeg_patterns "$out/lib/lua/${lua.luaversion}/" + ''; + + meta = with stdenv.lib; { + description = "A collection of LPEG patterns"; + homepage = "https://github.com/daurnimator/lpeg_patterns"; + license = licenses.mit; + maintainers = with maintainers; [ vcunat ]; + inherit (lpeg.meta) platforms; + }; + }; + cjson = buildLuaPackage rec { name = "cjson-${version}"; version = "2.1.0"; From 05df8471508538af01625f67ecc1bf467eeb6f2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 30 Jul 2018 16:40:01 +0200 Subject: [PATCH 4/9] fixup! lua*Packages.cqueues: init at 20171014 --- pkgs/top-level/lua-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix index 073174954d3..3c9e8ba481b 100644 --- a/pkgs/top-level/lua-packages.nix +++ b/pkgs/top-level/lua-packages.nix @@ -77,7 +77,7 @@ let version = "20171014"; src = fetchurl { - url = "http://www.25thandclement.com/~william/projects/releases/${name}.tgz"; + url = "https://www.25thandclement.com/~william/projects/releases/${name}.tgz"; sha256 = "1dabhpn6r0hlln8vx9hxm34pfcm46qzgpb2apmziwg5z51fi4ksb"; }; From 837a9a467715e1fe67d672ae005d7ec1a929885c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 30 Jul 2018 16:40:41 +0200 Subject: [PATCH 5/9] lua*Packages.luaoss: init at 20170903 --- pkgs/top-level/lua-packages.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix index 3c9e8ba481b..e7c947ca4d2 100644 --- a/pkgs/top-level/lua-packages.nix +++ b/pkgs/top-level/lua-packages.nix @@ -347,6 +347,28 @@ let }; }; + luaossl = buildLuaPackage rec { + name = "luaossl-${version}"; + version = "20170903"; + + src = fetchurl { + url = "https://www.25thandclement.com/~william/projects/releases/${name}.tgz"; + sha256 = "10392bvd0lzyibipblgiss09zlqh3a5zgqg1b9lgbybpqb9cv2k3"; + }; + + preConfigure = ''export prefix=$out''; + + buildInputs = [ openssl ]; + + meta = with stdenv.lib; { + description = "Comprehensive binding to OpenSSL for Lua 5.1+"; + homepage = "https://www.25thandclement.com/~william/projects/luaossl.html"; + license = licenses.mit; + maintainers = with maintainers; [ vcunat ]; + platforms = platforms.unix; + }; + }; + luaposix = buildLuaPackage rec { name = "posix-${version}"; version = "34.0.4"; From 597a5936d325ca594f7cf9654d65c4ce03ac0472 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 30 Jul 2018 17:08:48 +0200 Subject: [PATCH 6/9] lua*Packages.compat53: init at 0.7 The manual compilation is weird, but there's only a rockspec upstream, and I don't know how to use that well inside the nix build. --- pkgs/top-level/lua-packages.nix | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix index e7c947ca4d2..42b5a0de08c 100644 --- a/pkgs/top-level/lua-packages.nix +++ b/pkgs/top-level/lua-packages.nix @@ -72,6 +72,44 @@ let }; }; + compat53 = buildLuaPackage rec { + version = "0.7"; + name = "compat53-${version}"; + + src = fetchFromGitHub { + owner = "keplerproject"; + repo = "lua-compat-5.3"; + rev = "v${version}"; + sha256 = "02a14nvn7aggg1yikj9h3dcf8aqjbxlws1bfvqbpfxv9d5phnrpz"; + }; + + nativeBuildInputs = [ pkgconfig ]; + + postConfigure = '' + CFLAGS+=" -shared $(pkg-config --libs ${if isLuaJIT then "luajit" else "lua"})" + ''; + + buildPhase = '' + cc lstrlib.c $CFLAGS -o string.so + cc ltablib.c $CFLAGS -o table.so + cc lutf8lib.c $CFLAGS -o utf8.so + ''; + + # There's no need to separate *.lua and *.so, I guess? TODO: conventions? + installPhase = '' + install -Dt "$out/lib/lua/${lua.luaversion}/compat53" \ + compat53/*.lua *.so + ''; + + meta = with stdenv.lib; { + description = "Compatibility module providing Lua-5.3-style APIs for Lua 5.2 and 5.1"; + homepage = "https://github.com/keplerproject/lua-compat-5.3"; + license = licenses.mit; + maintainers = with maintainers; [ vcunat ]; + platforms = platforms.all; + }; + }; + cqueues = buildLuaPackage rec { name = "cqueues-${version}"; version = "20171014"; From 40140997cb212e7bd97e3a31301c5cf3656fe4d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 30 Jul 2018 17:26:48 +0200 Subject: [PATCH 7/9] lua*Packages.basexx: init at 0.4.0 --- pkgs/top-level/lua-packages.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix index 42b5a0de08c..aadf3cbcf83 100644 --- a/pkgs/top-level/lua-packages.nix +++ b/pkgs/top-level/lua-packages.nix @@ -43,6 +43,32 @@ let inherit lua; }; + basexx = buildLuaPackage rec { + version = "0.4.0"; + name = "basexx-${version}"; + + src = fetchFromGitHub { + owner = "aiq"; + repo = "basexx"; + rev = "v${version}"; + sha256 = "12y0ng9bp5b98iax35pnp0kc0mb42spv1cbywvfq6amik6l0ya7g"; + }; + + buildPhase = ":"; + installPhase = '' + install -Dt "$out/lib/lua/${lua.luaversion}/" \ + lib/basexx.lua + ''; + + meta = with stdenv.lib; { + description = "Lua library for base2, base16, base32, base64, base85"; + homepage = "https://github.com/aiq/basexx"; + license = licenses.mit; + maintainers = with maintainers; [ vcunat ]; + platforms = platforms.all; + }; + }; + bit32 = buildLuaPackage rec { version = "5.3.0"; name = "bit32-${version}"; From 7a605f3c7833119c16cb9ab366bbf5331455de77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 30 Jul 2018 17:32:34 +0200 Subject: [PATCH 8/9] lua*Packages.http: init at 0.2 --- pkgs/top-level/lua-packages.nix | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix index aadf3cbcf83..7933ca46b98 100644 --- a/pkgs/top-level/lua-packages.nix +++ b/pkgs/top-level/lua-packages.nix @@ -222,6 +222,38 @@ let }; }; + 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 ]; + }; + }; + luacheck = buildLuaPackage rec { pname = "luacheck"; version = "0.20.0"; From 2d75c47eab6fdaa52572bac3f79d2ac974d605ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 30 Jul 2018 17:36:23 +0200 Subject: [PATCH 9/9] knot-resolver: extraFeatures -> +deps for 'http' module The module feels as a toy mostly, but why not in non-default setup... --- pkgs/servers/dns/knot-resolver/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/dns/knot-resolver/default.nix b/pkgs/servers/dns/knot-resolver/default.nix index 1d7e5722ea7..50fd8d7183a 100644 --- a/pkgs/servers/dns/knot-resolver/default.nix +++ b/pkgs/servers/dns/knot-resolver/default.nix @@ -65,7 +65,8 @@ wrapped-full = with luajitPackages; let luaPkgs = [ luasec luasocket # trust anchor bootstrap, prefill module lfs # prefill module - # TODO: cqueues and others for http2 module + # Almost all is for the 'http' module: + http cqueues fifo lpeg lpeg_patterns luaossl compat53 basexx ]; in runCommand unwrapped.name {