diff options
-rw-r--r-- | maintainers/scripts/luarocks-packages.csv | 1 | ||||
-rw-r--r-- | pkgs/development/lua-modules/generated-packages.nix | 20 | ||||
-rw-r--r-- | pkgs/development/lua-modules/overrides.nix | 17 | ||||
-rw-r--r-- | pkgs/servers/dns/knot-resolver/default.nix | 22 | ||||
-rw-r--r-- | pkgs/top-level/lua-packages.nix | 32 |
5 files changed, 48 insertions, 44 deletions
diff --git a/maintainers/scripts/luarocks-packages.csv b/maintainers/scripts/luarocks-packages.csv index 284660934f62..fd9ba0edc02b 100644 --- a/maintainers/scripts/luarocks-packages.csv +++ b/maintainers/scripts/luarocks-packages.csv @@ -5,6 +5,7 @@ basexx, binaryheap, dkjson fifo +http inspect lgi lpeg_patterns diff --git a/pkgs/development/lua-modules/generated-packages.nix b/pkgs/development/lua-modules/generated-packages.nix index 10e249f6a93f..77646b8c3147 100644 --- a/pkgs/development/lua-modules/generated-packages.nix +++ b/pkgs/development/lua-modules/generated-packages.nix @@ -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"; diff --git a/pkgs/development/lua-modules/overrides.nix b/pkgs/development/lua-modules/overrides.nix index 50310a39f741..c88f5f9f57ca 100644 --- a/pkgs/development/lua-modules/overrides.nix +++ b/pkgs/development/lua-modules/overrides.nix @@ -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 ]; + }; + }); } diff --git a/pkgs/servers/dns/knot-resolver/default.nix b/pkgs/servers/dns/knot-resolver/default.nix index 3882db1124a5..15f6be1fa595 100644 --- a/pkgs/servers/dns/knot-resolver/default.nix +++ b/pkgs/servers/dns/knot-resolver/default.nix @@ -75,26 +75,24 @@ unwrapped = stdenv.mkDerivation rec { }; }; -wrapped-full = with luajitPackages; let - luaPkgs = [ +wrapped-full = runCommand unwrapped.name + { + nativeBuildInputs = [ makeWrapper ]; + buildInputs = with luajitPackages; [ 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 + http # for http module; brings lots of deps; some are useful elsewhere ]; - in runCommand unwrapped.name - { - nativeBuildInputs = [ makeWrapper ]; 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 diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix index 83ff1d22e5ec..c26f031a0893 100644 --- a/pkgs/top-level/lua-packages.nix +++ b/pkgs/top-level/lua-packages.nix @@ -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}"; |