From ec41f69f340dae7ab8843392dc6ee3ca8f99c6b9 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Thu, 12 Oct 2023 21:11:53 +0200 Subject: [PATCH 1/5] luaPackages.toml-edit: init at 0.1.4 --- maintainers/scripts/luarocks-packages.csv | 1 + .../lua-modules/generated-packages.nix | 31 ++++++++++- .../lua-modules/toml-edit/default.nix | 54 +++++++++++++++++++ pkgs/top-level/lua-packages.nix | 2 + 4 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/lua-modules/toml-edit/default.nix diff --git a/maintainers/scripts/luarocks-packages.csv b/maintainers/scripts/luarocks-packages.csv index 3ce3f3d73433..6f39985a1f08 100644 --- a/maintainers/scripts/luarocks-packages.csv +++ b/maintainers/scripts/luarocks-packages.csv @@ -72,6 +72,7 @@ lualogging,,,,,, luaossl,,,,,5.1, luaposix,,,,34.1.1-1,,vyp lblasc luarepl,,,,,, +luarocks-build-rust-mlua,,,,,,mrcjkb luasec,,,,,,flosse luasocket,,,,,, luasql-sqlite3,,,,,,vyp diff --git a/pkgs/development/lua-modules/generated-packages.nix b/pkgs/development/lua-modules/generated-packages.nix index 383ab0f665bc..d26f633e9e26 100644 --- a/pkgs/development/lua-modules/generated-packages.nix +++ b/pkgs/development/lua-modules/generated-packages.nix @@ -2066,6 +2066,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"; @@ -3039,7 +3068,7 @@ buildLuarocksPackage { }; }) {}; -vstruct = callPackage({ fetchgit, lua, buildLuarocksPackage, luaOlder }: +vstruct = callPackage({ fetchgit, lua, buildLuarocksPackage, luaOlder, luarocks-build-rust-mlua}: buildLuarocksPackage { pname = "vstruct"; version = "2.1.1-1"; diff --git a/pkgs/development/lua-modules/toml-edit/default.nix b/pkgs/development/lua-modules/toml-edit/default.nix new file mode 100644 index 000000000000..65890ae0abcd --- /dev/null +++ b/pkgs/development/lua-modules/toml-edit/default.nix @@ -0,0 +1,54 @@ +{ lib +, buildLuarocksPackage +, cargo +, fetchurl +, fetchgit +, lua +, luaOlder +, luarocks-build-rust-mlua +, rustPlatform }: +# NOTE: This is based on `luarocks-nix --nix toml-edit`, +# but requires some manual modifications, because this package uses cargo to build +buildLuarocksPackage rec { + 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"); + + + cargoDeps = rustPlatform.fetchCargoTarball { + inherit src; + hash = "sha256-pLAisfnSDoAToQO/kdKTdic6vEug7/WFNtgOfj0bRAE="; + }; + + propagatedBuildInputs = [ + cargo + rustPlatform.cargoSetupHook + 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"; + }; +} + diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix index 014cf6d394f9..1c316c2c1eb0 100644 --- a/pkgs/top-level/lua-packages.nix +++ b/pkgs/top-level/lua-packages.nix @@ -138,6 +138,8 @@ rec { inherit (pkgs.darwin.apple_sdk.frameworks) AppKit; }; + toml-edit = callPackage ../development/lua-modules/toml-edit { }; + vicious = callPackage ({ fetchFromGitHub }: stdenv.mkDerivation rec { pname = "vicious"; version = "2.6.0"; From d78d7cbc64dab0df8ce73a90ed91f1681079cc22 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Thu, 12 Oct 2023 22:43:22 +0200 Subject: [PATCH 2/5] luaPackages.nui-nvim: init at 0.2.0 --- maintainers/scripts/luarocks-packages.csv | 1 + .../lua-modules/generated-packages.nix | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/maintainers/scripts/luarocks-packages.csv b/maintainers/scripts/luarocks-packages.csv index 6f39985a1f08..83c2e4233a36 100644 --- a/maintainers/scripts/luarocks-packages.csv +++ b/maintainers/scripts/luarocks-packages.csv @@ -93,6 +93,7 @@ mediator_lua,,,,,, middleclass,,,,,, mpack,,,,,, moonscript,https://github.com/leafo/moonscript.git,dev-1,,,,arobyn +nui-nvim,,,,,,mrcjkb nvim-client,https://github.com/neovim/lua-client.git,,,,, nvim-cmp,https://github.com/hrsh7th/nvim-cmp,,,,, penlight,https://github.com/lunarmodules/Penlight.git,,,,,alerque diff --git a/pkgs/development/lua-modules/generated-packages.nix b/pkgs/development/lua-modules/generated-packages.nix index d26f633e9e26..96f25094c608 100644 --- a/pkgs/development/lua-modules/generated-packages.nix +++ b/pkgs/development/lua-modules/generated-packages.nix @@ -2603,6 +2603,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"; From c701eeb3170af4d5ee64e9abdf8b5df9aa571d00 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Fri, 13 Oct 2023 00:55:00 +0200 Subject: [PATCH 3/5] luaPackages.toml: init at 0.3.0 --- pkgs/development/libraries/sol2/default.nix | 36 +++++++++++++ .../lua-modules/generated-packages.nix | 2 +- pkgs/development/lua-modules/toml/default.nix | 52 +++++++++++++++++++ pkgs/development/lua-modules/toml/toml.patch | 43 +++++++++++++++ pkgs/top-level/all-packages.nix | 2 + pkgs/top-level/lua-packages.nix | 2 + 6 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/libraries/sol2/default.nix create mode 100644 pkgs/development/lua-modules/toml/default.nix create mode 100644 pkgs/development/lua-modules/toml/toml.patch diff --git a/pkgs/development/libraries/sol2/default.nix b/pkgs/development/libraries/sol2/default.nix new file mode 100644 index 000000000000..c086d37e6c32 --- /dev/null +++ b/pkgs/development/libraries/sol2/default.nix @@ -0,0 +1,36 @@ +{ fetchFromGitHub +, lib +, stdenv +, cmake +, lua +}: +stdenv.mkDerivation rec{ + pname = "sol2"; + version = "3.3.1"; + src = fetchFromGitHub { + owner = "ThePhD"; + repo = "sol2"; + rev = "v${version}"; + hash = "sha256-7QHZRudxq3hdsfEAYKKJydc4rv6lyN6UIt/2Zmaejx8="; + }; + + nativeBuildInputs = [ cmake lua ]; + + cmakeFlags = [ + "-DSOL2_LUA_VERSION=${lua.version}" + "-DSOL2_BUILD_LUA=FALSE" + ]; + + meta = with lib;{ + description = "Lua API wrapper with advanced features and top notch performance"; + longDescription = '' + sol2 is a C++ library binding to Lua. + It currently supports all Lua versions 5.1+ (LuaJIT 2.0+ and MoonJIT included). + sol2 aims to be easy to use and easy to add to a project. + The library is header-only for easy integration with projects, and a single header can be used for drag-and-drop start up. + ''; + homepage = "https://github.com/ThePhD/sol2"; + license = licenses.mit; + maintainers = with maintainers; [ mrcjkb ]; + }; +} diff --git a/pkgs/development/lua-modules/generated-packages.nix b/pkgs/development/lua-modules/generated-packages.nix index 96f25094c608..8589b4348bd3 100644 --- a/pkgs/development/lua-modules/generated-packages.nix +++ b/pkgs/development/lua-modules/generated-packages.nix @@ -3098,7 +3098,7 @@ buildLuarocksPackage { }; }) {}; -vstruct = callPackage({ fetchgit, lua, buildLuarocksPackage, luaOlder, luarocks-build-rust-mlua}: +vstruct = callPackage({ fetchgit, lua, buildLuarocksPackage, luaOlder }: buildLuarocksPackage { pname = "vstruct"; version = "2.1.1-1"; diff --git a/pkgs/development/lua-modules/toml/default.nix b/pkgs/development/lua-modules/toml/default.nix new file mode 100644 index 000000000000..78cd3eb2cda5 --- /dev/null +++ b/pkgs/development/lua-modules/toml/default.nix @@ -0,0 +1,52 @@ +{ lib +, lua +, luaOlder +, fetchurl +, fetchgit +, buildLuarocksPackage +, tomlplusplus +, magic-enum +, sol2 +}: +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"]) ; + + patches = [ ./toml.patch ]; + + disabled = (luaOlder "5.1"); + propagatedBuildInputs = [ + lua + magic-enum + sol2 + ]; + + postPatch = '' + substituteInPlace CMakeLists.txt --replace \ + "TOML_PLUS_PLUS_SRC" \ + "${tomlplusplus.src}" + ''; + + 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"; + }; +} + diff --git a/pkgs/development/lua-modules/toml/toml.patch b/pkgs/development/lua-modules/toml/toml.patch new file mode 100644 index 000000000000..5f9f57a445db --- /dev/null +++ b/pkgs/development/lua-modules/toml/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 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 23059a6c9b37..58fb771783d8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18018,6 +18018,8 @@ with pkgs; bundler-audit = callPackage ../tools/security/bundler-audit { }; + sol2 = callPackage ../development/libraries/sol2 { }; + solargraph = rubyPackages.solargraph; rbenv = callPackage ../development/ruby-modules/rbenv { }; diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix index 1c316c2c1eb0..e177be4b9b93 100644 --- a/pkgs/top-level/lua-packages.nix +++ b/pkgs/top-level/lua-packages.nix @@ -138,6 +138,8 @@ rec { inherit (pkgs.darwin.apple_sdk.frameworks) AppKit; }; + toml = callPackage ../development/lua-modules/toml { }; + toml-edit = callPackage ../development/lua-modules/toml-edit { }; vicious = callPackage ({ fetchFromGitHub }: stdenv.mkDerivation rec { From d986e93072a3e5eb4d435e2268a13cd441dff19d Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Fri, 13 Oct 2023 14:50:05 +0200 Subject: [PATCH 4/5] sol2: use finalAttrs to reference version --- pkgs/development/libraries/sol2/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/sol2/default.nix b/pkgs/development/libraries/sol2/default.nix index c086d37e6c32..5ec615942545 100644 --- a/pkgs/development/libraries/sol2/default.nix +++ b/pkgs/development/libraries/sol2/default.nix @@ -4,13 +4,13 @@ , cmake , lua }: -stdenv.mkDerivation rec{ +stdenv.mkDerivation (finalAttrs: { pname = "sol2"; version = "3.3.1"; src = fetchFromGitHub { owner = "ThePhD"; repo = "sol2"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; hash = "sha256-7QHZRudxq3hdsfEAYKKJydc4rv6lyN6UIt/2Zmaejx8="; }; @@ -33,4 +33,4 @@ stdenv.mkDerivation rec{ license = licenses.mit; maintainers = with maintainers; [ mrcjkb ]; }; -} +}) From 3425b6cee65a3d38e4c037f5c91f8bd480fe99f7 Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Fri, 13 Oct 2023 15:06:28 +0200 Subject: [PATCH 5/5] luaPackages: use overrides for toml and toml-edit --- maintainers/scripts/luarocks-packages.csv | 2 + .../lua-modules/generated-packages.nix | 64 +++++++++++++++++++ pkgs/development/lua-modules/overrides.nix | 28 ++++++++ .../lua-modules/toml-edit/default.nix | 54 ---------------- .../lua-modules/{toml => }/toml.patch | 0 pkgs/development/lua-modules/toml/default.nix | 52 --------------- pkgs/top-level/lua-packages.nix | 4 -- 7 files changed, 94 insertions(+), 110 deletions(-) delete mode 100644 pkgs/development/lua-modules/toml-edit/default.nix rename pkgs/development/lua-modules/{toml => }/toml.patch (100%) delete mode 100644 pkgs/development/lua-modules/toml/default.nix diff --git a/maintainers/scripts/luarocks-packages.csv b/maintainers/scripts/luarocks-packages.csv index 83c2e4233a36..fbe1154ab18d 100644 --- a/maintainers/scripts/luarocks-packages.csv +++ b/maintainers/scripts/luarocks-packages.csv @@ -111,5 +111,7 @@ teal-language-server,,,http://luarocks.org/dev,,, telescope.nvim,,,,,5.1, telescope-manix,,,,,, tl,,,,,,mephistophiles +toml,,,,,,mrcjkb +toml-edit,,,,,5.1,mrcjkb vstruct,https://github.com/ToxicFrog/vstruct.git,,,,, vusted,,,,,,figsoda diff --git a/pkgs/development/lua-modules/generated-packages.nix b/pkgs/development/lua-modules/generated-packages.nix index 8589b4348bd3..7deb513b2312 100644 --- a/pkgs/development/lua-modules/generated-packages.nix +++ b/pkgs/development/lua-modules/generated-packages.nix @@ -3098,6 +3098,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/pkgs/development/lua-modules/overrides.nix b/pkgs/development/lua-modules/overrides.nix index a389388ff65d..c4c9897ce8b6 100644 --- a/pkgs/development/lua-modules/overrides.nix +++ b/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 @@ -558,6 +563,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="; + }; + + propagatedBuildInputs = oa.propagatedBuildInputs ++ [ cargo rustPlatform.cargoSetupHook ]; + + }); + vstruct = prev.vstruct.overrideAttrs (_: { meta.broken = (luaOlder "5.1" || luaAtLeast "5.4"); }); diff --git a/pkgs/development/lua-modules/toml-edit/default.nix b/pkgs/development/lua-modules/toml-edit/default.nix deleted file mode 100644 index 65890ae0abcd..000000000000 --- a/pkgs/development/lua-modules/toml-edit/default.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ lib -, buildLuarocksPackage -, cargo -, fetchurl -, fetchgit -, lua -, luaOlder -, luarocks-build-rust-mlua -, rustPlatform }: -# NOTE: This is based on `luarocks-nix --nix toml-edit`, -# but requires some manual modifications, because this package uses cargo to build -buildLuarocksPackage rec { - 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"); - - - cargoDeps = rustPlatform.fetchCargoTarball { - inherit src; - hash = "sha256-pLAisfnSDoAToQO/kdKTdic6vEug7/WFNtgOfj0bRAE="; - }; - - propagatedBuildInputs = [ - cargo - rustPlatform.cargoSetupHook - 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"; - }; -} - diff --git a/pkgs/development/lua-modules/toml/toml.patch b/pkgs/development/lua-modules/toml.patch similarity index 100% rename from pkgs/development/lua-modules/toml/toml.patch rename to pkgs/development/lua-modules/toml.patch diff --git a/pkgs/development/lua-modules/toml/default.nix b/pkgs/development/lua-modules/toml/default.nix deleted file mode 100644 index 78cd3eb2cda5..000000000000 --- a/pkgs/development/lua-modules/toml/default.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ lib -, lua -, luaOlder -, fetchurl -, fetchgit -, buildLuarocksPackage -, tomlplusplus -, magic-enum -, sol2 -}: -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"]) ; - - patches = [ ./toml.patch ]; - - disabled = (luaOlder "5.1"); - propagatedBuildInputs = [ - lua - magic-enum - sol2 - ]; - - postPatch = '' - substituteInPlace CMakeLists.txt --replace \ - "TOML_PLUS_PLUS_SRC" \ - "${tomlplusplus.src}" - ''; - - 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"; - }; -} - diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix index e177be4b9b93..014cf6d394f9 100644 --- a/pkgs/top-level/lua-packages.nix +++ b/pkgs/top-level/lua-packages.nix @@ -138,10 +138,6 @@ rec { inherit (pkgs.darwin.apple_sdk.frameworks) AppKit; }; - toml = callPackage ../development/lua-modules/toml { }; - - toml-edit = callPackage ../development/lua-modules/toml-edit { }; - vicious = callPackage ({ fetchFromGitHub }: stdenv.mkDerivation rec { pname = "vicious"; version = "2.6.0";