luaPackages: use overrides for toml and toml-edit

This commit is contained in:
Marc Jakobi 2023-10-13 15:06:28 +02:00
parent d986e93072
commit 3425b6cee6
7 changed files with 94 additions and 110 deletions

View file

@ -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

1 name src ref server version luaversion maintainers
111 telescope.nvim 5.1
112 telescope-manix
113 tl mephistophiles
114 toml mrcjkb
115 toml-edit 5.1 mrcjkb
116 vstruct https://github.com/ToxicFrog/vstruct.git
117 vusted figsoda

View file

@ -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";

View file

@ -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");
});

View file

@ -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";
};
}

View file

@ -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";
};
}

View file

@ -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";