about summary refs log tree commit diff
path: root/pkgs/development/lua-modules
diff options
context:
space:
mode:
authorMatthieu C. <886074+teto@users.noreply.github.com>2024-04-21 16:04:53 +0200
committerMatthieu C. <886074+teto@users.noreply.github.com>2024-05-01 00:11:49 +0200
commit9e22d74930ab684e1a17d24b0c5a50ab35d609f6 (patch)
treee09e118465d68a20885bff5615accdb2fd29ef97 /pkgs/development/lua-modules
parentb73ec84b9eed8de7e9095e779ee3d4066ceb091e (diff)
luarocks-packages.csv: changed repo by rockspec uri
This is a breaking change that converts the 'src' csv column (a git URI) to a 'rockspec'
fullpath uri.
before this, luarocks-nix would clone the repo and look for rockspecs
with a brittle algorithm. This removes the ambiguity on which rockspec
to package while allowing to remove a bunch of brittle code from
luarocks-nix.
Diffstat (limited to 'pkgs/development/lua-modules')
-rwxr-xr-xpkgs/development/lua-modules/updater/updater.py21
1 files changed, 11 insertions, 10 deletions
diff --git a/pkgs/development/lua-modules/updater/updater.py b/pkgs/development/lua-modules/updater/updater.py
index 407b4104b774c..f0a91a313919a 100755
--- a/pkgs/development/lua-modules/updater/updater.py
+++ b/pkgs/development/lua-modules/updater/updater.py
@@ -49,8 +49,8 @@ FOOTER = """
 class LuaPlugin:
     name: str
     """Name of the plugin, as seen on luarocks.org"""
-    src: str
-    """address to the git repository"""
+    rockspec: str
+    """Full path towards the rockspec"""
     ref: Optional[str]
     """git reference (branch name/tag)"""
     version: Optional[str]
@@ -103,7 +103,7 @@ class LuaEditor(pluginupdate.Editor):
             f.write(HEADER)
             header2 = textwrap.dedent(
                 """
-                { stdenv, lib, fetchurl, fetchgit, callPackage, ... } @ args:
+                { stdenv, lib, fetchurl, fetchgit, callPackage, ... }:
                 final: prev:
                 {
             """
@@ -171,16 +171,17 @@ def generate_pkg_nix(plug: LuaPlugin):
     if plug.maintainers:
         cmd.append(f"--maintainers={plug.maintainers}")
 
-    if plug.src != "":
-        if plug.src is None:
+    if plug.rockspec != "":
+        if plug.ref or plug.version:
             msg = (
-                "src must be set when 'version' is set to \"src\" for package %s"
+                "'version' and 'ref' will be ignored as the rockspec is hardcoded for package %s"
                 % plug.name
             )
-            log.error(msg)
-            raise RuntimeError(msg)
-        log.debug("Updating from source %s", plug.src)
-        cmd.append(plug.src)
+            log.warn(msg)
+
+        log.debug("Updating from rockspec %s", plug.rockspec)
+        cmd.append(plug.rockspec)
+
     # update the plugin from luarocks
     else:
         cmd.append(plug.name)