about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/lua-modules
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-10-20 22:09:03 +0000
committerAlyssa Ross <hi@alyssa.is>2023-10-20 22:09:03 +0000
commit50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e (patch)
treef2556b911180125ccbb7ed0e78a54e92da89adce /nixpkgs/pkgs/development/lua-modules
parent4c16d4548a98563c9d9ad76f4e5b2202864ccd54 (diff)
parentcfc75eec4603c06503ae750f88cf397e00796ea8 (diff)
downloadnixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.gz
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.bz2
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.lz
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.xz
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.zst
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.zip
Merge commit 'cfc75eec4603c06503ae750f88cf397e00796ea8'
Conflicts:
	nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix
Diffstat (limited to 'nixpkgs/pkgs/development/lua-modules')
-rw-r--r--nixpkgs/pkgs/development/lua-modules/aliases.nix43
-rw-r--r--nixpkgs/pkgs/development/lua-modules/generated-packages.nix171
-rw-r--r--nixpkgs/pkgs/development/lua-modules/lib.nix6
-rw-r--r--nixpkgs/pkgs/development/lua-modules/overrides.nix32
-rw-r--r--nixpkgs/pkgs/development/lua-modules/toml.patch43
5 files changed, 264 insertions, 31 deletions
diff --git a/nixpkgs/pkgs/development/lua-modules/aliases.nix b/nixpkgs/pkgs/development/lua-modules/aliases.nix
new file mode 100644
index 000000000000..47a097fd7f79
--- /dev/null
+++ b/nixpkgs/pkgs/development/lua-modules/aliases.nix
@@ -0,0 +1,43 @@
+
+lib: self: super:
+
+### Deprecated aliases - for backward compatibility
+###
+### !!! NOTE !!!
+### Use `./remove-attr.py [attrname]` in this directory to remove your alias
+### from the `luaPackages` set without regenerating the entire file.
+
+with self;
+
+let
+  # Removing recurseForDerivation prevents derivations of aliased attribute
+  # set to appear while listing all the packages available.
+  removeRecurseForDerivations = alias: with lib;
+    if alias.recurseForDerivations or false
+    then removeAttrs alias ["recurseForDerivations"]
+    else alias;
+
+  # Disabling distribution prevents top-level aliases for non-recursed package
+  # sets from building on Hydra.
+  removeDistribute = alias: with lib;
+    if isDerivation alias then
+      dontDistribute alias
+    else alias;
+
+  # Make sure that we are not shadowing something from node-packages.nix.
+  checkInPkgs = n: alias:
+    if builtins.hasAttr n super
+    then throw "Alias ${n} is still in generated.nix"
+    else alias;
+
+  mapAliases = aliases:
+    lib.mapAttrs (n: alias:
+      removeDistribute
+        (removeRecurseForDerivations
+          (checkInPkgs n alias)))
+      aliases;
+in
+
+mapAliases {
+  "lpty" = throw "lpy was removed because broken and unmaintained "; # added 2023-10-14
+}
diff --git a/nixpkgs/pkgs/development/lua-modules/generated-packages.nix b/nixpkgs/pkgs/development/lua-modules/generated-packages.nix
index 468f996b6eac..636c411acca4 100644
--- a/nixpkgs/pkgs/development/lua-modules/generated-packages.nix
+++ b/nixpkgs/pkgs/development/lua-modules/generated-packages.nix
@@ -5,7 +5,7 @@ nixpkgs$ ./maintainers/scripts/update-luarocks-packages
 You can customize the generated packages in pkgs/development/lua-modules/overrides.nix
 */
 
-{ self, stdenv, lib, fetchurl, fetchgit, callPackage, ... } @ args:
+{ stdenv, lib, fetchurl, fetchgit, callPackage, ... } @ args:
 final: prev:
 {
 alt-getopt = callPackage({ luaAtLeast, lua, luaOlder, fetchgit, buildLuarocksPackage }:
@@ -942,29 +942,6 @@ buildLuarocksPackage {
   };
 }) {};
 
-lpty = callPackage({ luaOlder, lua, fetchurl, buildLuarocksPackage }:
-buildLuarocksPackage {
-  pname = "lpty";
-  version = "1.2.2-1";
-  knownRockspec = (fetchurl {
-    url    = "mirror://luarocks/lpty-1.2.2-1.rockspec";
-    sha256 = "04af4mhiqrw3br4qzz7yznw9zy2m50wddwzgvzkvhd99ng71fkzg";
-  }).outPath;
-  src = fetchurl {
-    url    = "http://www.tset.de/downloads/lpty-1.2.2-1.tar.gz";
-    sha256 = "071mvz79wi9vr6hvrnb1rv19lqp1bh2fi742zkpv2sm1r9gy5rav";
-  };
-
-  disabled = (luaOlder "5.1");
-  propagatedBuildInputs = [ lua ];
-
-  meta = {
-    homepage = "http://www.tset.de/lpty/";
-    description = "A simple facility for lua to control other programs via PTYs.";
-    license.fullName = "MIT";
-  };
-}) {};
-
 lrexlib-gnu = callPackage({ buildLuarocksPackage, luaOlder, lua, fetchgit }:
 buildLuarocksPackage {
   pname = "lrexlib-gnu";
@@ -2066,6 +2043,35 @@ buildLuarocksPackage {
   };
 }) {};
 
+luarocks-build-rust-mlua = callPackage({ fetchgit, buildLuarocksPackage }:
+buildLuarocksPackage {
+  pname = "luarocks-build-rust-mlua";
+  version = "0.1.2-1";
+  knownRockspec = (fetchurl {
+    url    = "mirror://luarocks/luarocks-build-rust-mlua-0.1.2-1.rockspec";
+    sha256 = "1sx908fm2ihpxz2mm54xzkfmdzlqdvrqjkh1zz7rcjgmqba4mh1j";
+  }).outPath;
+  src = fetchgit ( removeAttrs (builtins.fromJSON ''{
+  "url": "https://github.com/khvzak/luarocks-build-rust-mlua",
+  "rev": "c8080aa0832563b7f8b2cb85a195c1598ce312e0",
+  "date": "2023-06-29T16:47:41+01:00",
+  "path": "/nix/store/n7id28r1m11xd550hayv99xhz96vpdjq-luarocks-build-rust-mlua",
+  "sha256": "1zh1p5k7xpczi5db3k0fw0ljw9w0xxk1qjjcfg5rcznqjf48i3x7",
+  "fetchLFS": false,
+  "fetchSubmodules": true,
+  "deepClone": false,
+  "leaveDotGit": false
+}
+ '') ["date" "path"]) ;
+
+
+  meta = {
+    homepage = "https://github.com/khvzak/luarocks-build-rust-mlua";
+    description = "A LuaRocks build backend for Lua modules written in Rust using mlua";
+    license.fullName = "MIT";
+  };
+}) {};
+
 luasec = callPackage({ fetchgit, luaOlder, luasocket, buildLuarocksPackage, lua }:
 buildLuarocksPackage {
   pname = "luasec";
@@ -2501,6 +2507,29 @@ buildLuarocksPackage {
   };
 }) {};
 
+middleclass = callPackage({ luaOlder, buildLuarocksPackage, fetchurl, lua }:
+buildLuarocksPackage {
+  pname = "middleclass";
+  version = "4.1.1-0";
+  knownRockspec = (fetchurl {
+    url    = "mirror://luarocks/middleclass-4.1.1-0.rockspec";
+    sha256 = "10xzs48lr1dy7cx99581r956gl16px0a9gbdlfar41n19r96mhb1";
+  }).outPath;
+  src = fetchurl {
+    url    = "https://github.com/kikito/middleclass/archive/v4.1.1.tar.gz";
+    sha256 = "11ahv0b9wgqfnabv57rb7ilsvn2vcvxb1czq6faqrsqylvr5l7nh";
+  };
+
+  disabled = (luaOlder "5.1");
+  propagatedBuildInputs = [ lua ];
+
+  meta = {
+    homepage = "https://github.com/kikito/middleclass";
+    description = "A simple OOP library for Lua";
+    license.fullName = "MIT";
+  };
+}) {};
+
 moonscript = callPackage({ lpeg, luaOlder, fetchgit, lua, buildLuarocksPackage, argparse, luafilesystem }:
 buildLuarocksPackage {
   pname = "moonscript";
@@ -2551,6 +2580,36 @@ buildLuarocksPackage {
   };
 }) {};
 
+nui-nvim = callPackage( { fetchgit, buildLuarocksPackage }:
+buildLuarocksPackage {
+  pname = "nui.nvim";
+  version = "0.2.0-1";
+  knownRockspec = (fetchurl {
+    url    = "mirror://luarocks/nui.nvim-0.2.0-1.rockspec";
+    sha256 = "0v2z6lgl6hrzcjlzhis8nrkdkh9kvx8zg3q5svi5gyklg7vmcbc2";
+  }).outPath;
+  src = fetchgit ( removeAttrs (builtins.fromJSON ''{
+  "url": "https://github.com/MunifTanjim/nui.nvim.git",
+  "rev": "9e3916e784660f55f47daa6f26053ad044db5d6a",
+  "date": "2023-07-20T10:45:09+06:00",
+  "path": "/nix/store/8zdhjgipjjhi9b1y40r2yk5np4lp39as-nui.nvim",
+  "sha256": "14a73dwl56kah9h36b40ir6iylvfs261ysz17qvi9vhp63vjq9cx",
+  "fetchLFS": false,
+  "fetchSubmodules": true,
+  "deepClone": false,
+  "leaveDotGit": false
+}
+ '') ["date" "path"]) ;
+
+
+  meta = {
+    homepage = "https://github.com/MunifTanjim/nui.nvim";
+    description = "UI Component Library for Neovim.";
+    maintainers = with lib.maintainers; [ mrcjkb ];
+    license.fullName = "MIT";
+  };
+}) {};
+
 nvim-client = callPackage({ coxpcall, fetchurl, mpack, lua, luaOlder, luv, buildLuarocksPackage }:
 buildLuarocksPackage {
   pname = "nvim-client";
@@ -3016,6 +3075,70 @@ buildLuarocksPackage {
   };
 }) {};
 
+toml = callPackage({ lua, fetchgit, luaOlder, buildLuarocksPackage }:
+buildLuarocksPackage {
+  pname = "toml";
+  version = "0.3.0-0";
+  knownRockspec = (fetchurl {
+    url    = "mirror://luarocks/toml-0.3.0-0.rockspec";
+    sha256 = "0y4qdzsvf4xwnr49xcpbqclrq9d6snv83cbdkrchl0cn4cx6zpxy";
+  }).outPath;
+  src = fetchgit ( removeAttrs (builtins.fromJSON ''{
+  "url": "https://github.com/LebJe/toml.lua.git",
+  "rev": "319e9accf8c5cedf68795354ba81e54c817d1277",
+  "date": "2023-02-19T23:00:49-05:00",
+  "path": "/nix/store/p6a98sqp9a4jwsw6ghqcwpn9lxmhvkdg-toml.lua",
+  "sha256": "05p33bq0ajl41vbsw9bx73shpf0p11n5gb6yy8asvp93zh2m51hq",
+  "fetchLFS": false,
+  "fetchSubmodules": true,
+  "deepClone": false,
+  "leaveDotGit": false
+}
+ '') ["date" "path"]) ;
+
+  disabled = (luaOlder "5.1");
+  propagatedBuildInputs = [ lua ];
+
+  meta = {
+    homepage = "https://github.com/LebJe/toml.lua";
+    description = "TOML v1.0.0 parser and serializer for Lua. Powered by toml++.";
+    maintainers = with lib.maintainers; [ mrcjkb ];
+    license.fullName = "MIT";
+  };
+}) {};
+
+toml-edit = callPackage({ luaOlder, luarocks-build-rust-mlua, buildLuarocksPackage, lua, fetchgit }:
+buildLuarocksPackage {
+  pname = "toml-edit";
+  version = "0.1.4-1";
+  knownRockspec = (fetchurl {
+    url    = "mirror://luarocks/toml-edit-0.1.4-1.rockspec";
+    sha256 = "05bcc1xafcspdf1rcka9bhg7b6z617b4jrcahs1r7grcp78w89vf";
+  }).outPath;
+  src = fetchgit ( removeAttrs (builtins.fromJSON ''{
+  "url": "https://github.com/vhyrro/toml-edit.lua",
+  "rev": "f6efdab4ca6fab276f172060971781dc42a94f2d",
+  "date": "2023-10-02T16:54:10+02:00",
+  "path": "/nix/store/p1368agmqg4jwb1qvf2iff3fdrq9vkdj-toml-edit.lua",
+  "sha256": "1aa8znjnmm84392gnl7w0hm069xfv7niym3i8my7kyk0vdgxja06",
+  "fetchLFS": false,
+  "fetchSubmodules": true,
+  "deepClone": false,
+  "leaveDotGit": false
+}
+ '') ["date" "path"]) ;
+
+  disabled = (luaOlder "5.1");
+  propagatedBuildInputs = [ lua luarocks-build-rust-mlua ];
+
+  meta = {
+    homepage = "https://github.com/vhyrro/toml-edit.lua";
+    description = "TOML Parser + Formatting and Comment-Preserving Editor";
+    maintainers = with lib.maintainers; [ mrcjkb ];
+    license.fullName = "MIT";
+  };
+}) {};
+
 vstruct = callPackage({ fetchgit, lua, buildLuarocksPackage, luaOlder }:
 buildLuarocksPackage {
   pname = "vstruct";
diff --git a/nixpkgs/pkgs/development/lua-modules/lib.nix b/nixpkgs/pkgs/development/lua-modules/lib.nix
index 7c7ffcccf263..a07b23ff9cd2 100644
--- a/nixpkgs/pkgs/development/lua-modules/lib.nix
+++ b/nixpkgs/pkgs/development/lua-modules/lib.nix
@@ -82,11 +82,11 @@ rec {
   };
   */
   generateLuarocksConfig = {
-      externalDeps
+    externalDeps ? []
     # a list of lua derivations
-    , requiredLuaRocks
+    , requiredLuaRocks ? []
     , extraVariables ? {}
-    , rocksSubdir
+    , rocksSubdir ? "rocks-subdir"
     }: let
       rocksTrees = lib.imap0
         (i: dep: {
diff --git a/nixpkgs/pkgs/development/lua-modules/overrides.nix b/nixpkgs/pkgs/development/lua-modules/overrides.nix
index a389388ff65d..62d4e066e50b 100644
--- a/nixpkgs/pkgs/development/lua-modules/overrides.nix
+++ b/nixpkgs/pkgs/development/lua-modules/overrides.nix
@@ -1,5 +1,6 @@
 # do not add pkgs, it messes up splicing
 { stdenv
+, cargo
 , cmake
 , curl
 , cyrus_sasl
@@ -27,6 +28,7 @@
 , libxcrypt
 , libyaml
 , mariadb
+, magic-enum
 , mpfr
 , neovim-unwrapped
 , openldap
@@ -35,7 +37,10 @@
 , pkg-config
 , postgresql
 , readline
+, rustPlatform
+, sol2
 , sqlite
+, tomlplusplus
 , unbound
 , vimPlugins
 , vimUtils
@@ -141,10 +146,6 @@ with prev;
     */
   });
 
-  lpty = prev.lpty.overrideAttrs (oa: {
-    meta.broken = luaOlder "5.1" || luaAtLeast "5.3";
-  });
-
   ldbus = prev.ldbus.overrideAttrs (oa: {
     extraVariables = {
       DBUS_DIR = "${dbus.lib}";
@@ -558,6 +559,29 @@ with prev;
     '';
   });
 
+  toml = prev.toml.overrideAttrs (oa: {
+    patches = [ ./toml.patch ];
+
+    propagatedBuildInputs = oa.propagatedBuildInputs ++ [ magic-enum sol2 ];
+
+    postPatch = ''
+      substituteInPlace CMakeLists.txt --replace \
+        "TOML_PLUS_PLUS_SRC" \
+        "${tomlplusplus.src}"
+    '';
+  });
+
+  toml-edit = prev.toml-edit.overrideAttrs (oa: {
+
+    cargoDeps = rustPlatform.fetchCargoTarball {
+      src = oa.src;
+      hash = "sha256-pLAisfnSDoAToQO/kdKTdic6vEug7/WFNtgOfj0bRAE=";
+    };
+
+    nativeBuildInputs = oa.nativeBuildInputs ++ [ cargo rustPlatform.cargoSetupHook ];
+
+  });
+
   vstruct = prev.vstruct.overrideAttrs (_: {
     meta.broken = (luaOlder "5.1" || luaAtLeast "5.4");
   });
diff --git a/nixpkgs/pkgs/development/lua-modules/toml.patch b/nixpkgs/pkgs/development/lua-modules/toml.patch
new file mode 100644
index 000000000000..5f9f57a445db
--- /dev/null
+++ b/nixpkgs/pkgs/development/lua-modules/toml.patch
@@ -0,0 +1,43 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index ab3884c..9432df7 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -38,26 +38,17 @@ include(FetchContent)
+ 
+ FetchContent_Declare(
+ 	${TOML++}
+-	GIT_REPOSITORY "https://github.com/marzer/tomlplusplus.git"
+-	GIT_SHALLOW ON
+-    GIT_SUBMODULES ""
+-	GIT_TAG "v3.3.0"
++  DOWNLOAD_COMMAND true
+ )
+ 
+ FetchContent_Declare(
+ 	${SOL2}
+-	GIT_REPOSITORY "https://github.com/ThePhD/sol2.git"
+-	GIT_SHALLOW ON
+-    GIT_SUBMODULES ""
+-	GIT_TAG "v3.3.0"
++  DOWNLOAD_COMMAND true
+ )
+ 
+ FetchContent_Declare(
+ 	${MAGIC_ENUM}
+-	GIT_REPOSITORY "https://github.com/Neargye/magic_enum.git"
+-	GIT_SHALLOW ON
+-    GIT_SUBMODULES ""
+-	GIT_TAG "v0.8.2"
++  DOWNLOAD_COMMAND true
+ )
+ 
+ FetchContent_GetProperties(${TOML++})
+@@ -113,7 +104,7 @@ if(NOT LUA_INCLUDE_DIR OR (WIN32 AND NOT LUA_LIBRARIES))
+     find_package(Lua)
+ endif()
+ 
+-include_directories(${LUA_INCLUDE_DIR} src src/include ${${TOML++}_SOURCE_DIR} ${${SOL2}_SOURCE_DIR}/include ${${MAGIC_ENUM}_SOURCE_DIR}/include)
++include_directories(${LUA_INCLUDE_DIR} src src/include TOML_PLUS_PLUS_SRC ${${SOL2}_SOURCE_DIR}/include ${${MAGIC_ENUM}_SOURCE_DIR}/include)
+ 
+ set(SOURCES
+     src/toml.cpp