diff options
author | Matthieu Coudron <teto@users.noreply.github.com> | 2021-09-01 10:31:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-01 10:31:14 +0200 |
commit | b4e6ec08f45b3fa31f879b45a6f1dc6051608118 (patch) | |
tree | 9d65ac5b1a13e02ab3ff7a124654a281527fadfc /maintainers | |
parent | 93b0f6be1373818d1d9a3a76c141800251103d00 (diff) | |
parent | e62a0eac8f2cfe58efae9200f9d267169f519cab (diff) |
Merge pull request #134336 from teto/luarocks-rockspec-relpath
lua updater: support in-repo rockspecs
Diffstat (limited to 'maintainers')
-rw-r--r-- | maintainers/scripts/luarocks-packages.csv | 175 | ||||
-rwxr-xr-x | maintainers/scripts/update-luarocks-packages | 53 | ||||
-rw-r--r-- | maintainers/scripts/update-luarocks-shell.nix | 7 |
3 files changed, 131 insertions, 104 deletions
diff --git a/maintainers/scripts/luarocks-packages.csv b/maintainers/scripts/luarocks-packages.csv index 48a9d0e3d3a9..1cb6a83d42ae 100644 --- a/maintainers/scripts/luarocks-packages.csv +++ b/maintainers/scripts/luarocks-packages.csv @@ -1,89 +1,86 @@ -name,server,version,luaversion,maintainers -alt-getopt,,,,arobyn -ansicolors,,,, -bit32,,5.3.0-1,lua5_1,lblasc -argparse,,,, -basexx,,,, -binaryheap,,,,vcunat -busted,,,, -cassowary,,,,marsam alerque -compat53,,0.7-1,,vcunat -cosmo,,,,marsam -coxpcall,,1.17.0-1,, -cqueues,,,,vcunat -cyrussasl,,,, -digestif,,0.2-1,lua5_3, -dkjson,,,, -fifo,,,, -gitsigns.nvim,,,lua5_1, -http,,0.3-0,,vcunat -inspect,,,, -ldbus,http://luarocks.org/dev,,, -ldoc,,,, -lgi,,,, -linenoise,,,, -ljsyscall,,,lua5_1,lblasc -lpeg,,,,vyp -lpeg_patterns,,,, -lpeglabel,,,, -lpty,,,, -lrexlib-gnu,,,, -lrexlib-pcre,,,,vyp -lrexlib-posix,,,, -ltermbox,,,, -lua-cjson,,,, -lua-cmsgpack,,,, -lua-iconv,,,, -lua-lsp,http://luarocks.org/dev,,, -lua-messagepack,,,, -lua-resty-http,,,, -lua-resty-jwt,,,, -lua-resty-openidc,,,, -lua-resty-openssl,,,, -lua-resty-session,,,, -lua-term,,,, -lua-toml,,,, -lua-zlib,,,,koral -lua_cliargs,,,, -luabitop,,,, -luacheck,,,, -luacov,,,, -luadbi,,,, -luadbi-mysql,,,, -luadbi-postgresql,,,, -luadbi-sqlite3,,,, -luadoc,,,, -luaepnf,,,, -luaevent,,,, -luaexpat,,1.3.0-1,,arobyn flosse -luaffi,http://luarocks.org/dev,,, -luafilesystem,,1.7.0-2,,flosse -lualogging,,,, -luaossl,,,lua5_1, -luaposix,,34.1.1-1,,vyp lblasc -luarepl,,,, -luasec,,,,flosse -luasocket,,,, -luasql-sqlite3,,,,vyp -luassert,,,, -luasystem,,,, -luautf8,,,,pstn -luazip,,,, -lua-yajl,,,,pstn -luuid,,,, -luv,,1.30.0-0,, -lyaml,,,,lblasc -markdown,,,, -mediator_lua,,,, -mpack,,,, -moonscript,,,,arobyn -nvim-client,,,, -penlight,,,, -plenary.nvim,,,lua5_1, -rapidjson,,,, -readline,,,, -say,,,, -std._debug,,,, -std.normalize,,,, -stdlib,,,,vyp -vstruct,,,, +name,src,ref,server,version,luaversion,maintainers +alt-getopt,,,,,,arobyn +bit32,,,,5.3.0-1,lua5_1,lblasc +argparse,https://github.com/luarocks/argparse.git,,,,, +basexx,https://github.com/teto/basexx.git,,,,, +binaryheap,https://github.com/Tieske/binaryheap.lua,,,,,vcunat +busted,,,,,, +cassowary,,,,,,marsam alerque +compat53,,,,0.7-1,,vcunat +cosmo,,,,,,marsam +coxpcall,,,,1.17.0-1,, +cqueues,,,,,,vcunat +cyrussasl,https://github.com/JorjBauer/lua-cyrussasl.git,,,,, +digestif,https://github.com/astoff/digestif.git,,,0.2-1,lua5_3, +dkjson,,,,,, +fifo,,,,,, +gitsigns.nvim,https://github.com/lewis6991/gitsigns.nvim.git,,,,lua5_1, +http,,,,0.3-0,,vcunat +inspect,,,,,, +ldbus,,,http://luarocks.org/dev,,, +ldoc,https://github.com/stevedonovan/LDoc.git,,,,, +lgi,,,,,, +linenoise,https://github.com/hoelzro/lua-linenoise.git,,,,, +ljsyscall,,,,,lua5_1,lblasc +lpeg,,,,,,vyp +lpeg_patterns,,,,,, +lpeglabel,,,,,, +lpty,,,,,, +lrexlib-gnu,,,,,, +lrexlib-pcre,,,,,,vyp +lrexlib-posix,,,,,, +lua-cjson,,,,,, +lua-cmsgpack,,,,,, +lua-iconv,,,,,, +lua-lsp,,,,,, +lua-messagepack,,,,,, +lua-resty-http,,,,,, +lua-resty-jwt,,,,,, +lua-resty-openidc,,,,,, +lua-resty-openssl,,,,,, +lua-resty-session,,,,,, +lua-term,,,,,, +lua-toml,,,,,, +lua-zlib,,,,,,koral +lua_cliargs,https://github.com/amireh/lua_cliargs.git,,,,, +luabitop,https://github.com/teto/luabitop.git,,,,, +luacheck,,,,,, +luacov,,,,,, +luadbi,,,,,, +luadbi-mysql,,,,,, +luadbi-postgresql,,,,,, +luadbi-sqlite3,,,,,, +luaepnf,,,,,, +luaevent,,,,,, +luaexpat,,,,1.3.0-1,,arobyn flosse +luaffi,,,http://luarocks.org/dev,,, +luafilesystem,,,,1.7.0-2,,flosse +lualogging,,,,,, +luaossl,,,,,lua5_1, +luaposix,,,,34.1.1-1,,vyp lblasc +luarepl,,,,,, +luasec,,,,,,flosse +luasocket,,,,,, +luasql-sqlite3,,,,,,vyp +luassert,,,,,, +luasystem,,,,,, +luautf8,,,,,,pstn +luazip,,,,,, +lua-yajl,,,,,,pstn +luuid,,,,,, +luv,,,,1.30.0-0,, +lyaml,,,,,,lblasc +markdown,,,,,, +mediator_lua,,,,,, +mpack,,,,,, +moonscript,,,,,,arobyn +nvim-client,https://github.com/neovim/lua-client.git,,,,, +penlight,https://github.com/Tieske/Penlight.git,,,,, +plenary.nvim,https://github.com/nvim-lua/plenary.nvim.git,,,,lua5_1, +rapidjson,https://github.com/xpol/lua-rapidjson.git,,,,, +readline,,,,,, +say,https://github.com/Olivine-Labs/say.git,,,,, +std._debug,https://github.com/lua-stdlib/_debug.git,,,,, +std.normalize,git://github.com/lua-stdlib/normalize.git,,,,, +stdlib,,,,41.2.2,,vyp +vstruct,https://github.com/ToxicFrog/vstruct.git,,,,, diff --git a/maintainers/scripts/update-luarocks-packages b/maintainers/scripts/update-luarocks-packages index 6de97799846d..a465031b9112 100755 --- a/maintainers/scripts/update-luarocks-packages +++ b/maintainers/scripts/update-luarocks-packages @@ -1,5 +1,5 @@ #!/usr/bin/env nix-shell -#!nix-shell -p nix-prefetch-git luarocks-nix python3 python3Packages.GitPython nix -i python3 +#!nix-shell update-luarocks-shell.nix -i python3 # format: # $ nix run nixpkgs.python3Packages.black -c black update.py @@ -19,7 +19,7 @@ import logging import textwrap from multiprocessing.dummy import Pool -from typing import List, Tuple +from typing import List, Tuple, Optional from pathlib import Path log = logging.getLogger() @@ -50,10 +50,21 @@ FOOTER=""" @dataclass class LuaPlugin: name: str - version: str - server: str - luaversion: str - maintainers: str + '''Name of the plugin, as seen on luarocks.org''' + src: str + '''address to the git repository''' + ref: Optional[str] + '''git reference (branch name/tag)''' + version: Optional[str] + '''Set it to pin a package ''' + server: Optional[str] + '''luarocks.org registers packages under different manifests. + Its value can be 'http://luarocks.org/dev' + ''' + luaversion: Optional[str] + '''Attribue of the lua interpreter if a package is available only for a specific lua version''' + maintainers: Optional[str] + ''' Optional string listing maintainers separated by spaces''' @property def normalized_name(self) -> str: @@ -149,16 +160,33 @@ def generate_pkg_nix(plug: LuaPlugin): Our cache key associates "p.name-p.version" to its rockspec ''' log.debug("Generating nix expression for %s", plug.name) - cmd = [ "luarocks", "nix", plug.name] + cmd = [ "luarocks", "nix"] - if plug.server: - cmd.append(f"--only-server={plug.server}") if plug.maintainers: cmd.append(f"--maintainers={plug.maintainers}") - if plug.version: - cmd.append(plug.version) + # updates plugin directly from its repository + print("server: [%s]" % plug.server) + # if plug.server == "src": + if plug.src != "": + if plug.src is None: + msg = "src must be set when 'version' is set to \"src\" for package %s" % plug.name + log.error(msg) + raise RuntimeError(msg) + log.debug("Updating from source %s", plug.src) + cmd.append(plug.src) + # update the plugin from luarocks + else: + cmd.append(plug.name) + if plug.version and plug.version != "src": + + cmd.append(plug.version) + + # + if plug.server != "src" and plug.server: + cmd.append(f"--only-server={plug.server}") + if plug.luaversion: with CleanEnvironment(): @@ -169,7 +197,7 @@ def generate_pkg_nix(plug: LuaPlugin): lua_drv_path=subprocess.check_output(cmd2, text=True).strip() cmd.append(f"--lua-dir={lua_drv_path}/bin") - log.debug("running %s", cmd) + log.debug("running %s", ' '.join(cmd)) output = subprocess.check_output(cmd, text=True) return (plug, output) @@ -191,3 +219,4 @@ if __name__ == "__main__": main() +# vim: set ft=python noet fdm=manual fenc=utf-8 ff=unix sts=0 sw=4 ts=4 : diff --git a/maintainers/scripts/update-luarocks-shell.nix b/maintainers/scripts/update-luarocks-shell.nix index d3f342b07a96..a58674fca8d3 100644 --- a/maintainers/scripts/update-luarocks-shell.nix +++ b/maintainers/scripts/update-luarocks-shell.nix @@ -1,12 +1,13 @@ { nixpkgs ? import ../.. { } }: with nixpkgs; +let + pyEnv = python3.withPackages(ps: [ ps.GitPython ]); +in mkShell { packages = [ - bash + pyEnv luarocks-nix nix-prefetch-scripts - parallel ]; - LUAROCKS_NIXPKGS_PATH = toString nixpkgs.path; } |