push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
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.
let
inherit (lib)
dontDistribute
hasAttr
isDerivation
mapAttrs
;
# Removing recurseForDerivation prevents derivations of aliased attribute
# set to appear while listing all the packages available.
removeRecurseForDerivations =
alias:
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: if isDerivation alias then dontDistribute alias else alias;
# Make sure that we are not shadowing something from node-packages.nix.
checkInPkgs =
n: alias: if hasAttr n super then throw "Alias ${n} is still in generated.nix" else alias;
mapAliases =
aliases:
mapAttrs (n: alias: removeDistribute (removeRecurseForDerivations (checkInPkgs n alias))) aliases;
in
mapAliases {
lpty = throw "lpy was removed because broken and unmaintained "; # added 2023-10-14
cyrussasl = throw "cyrussasl was removed because broken and unmaintained "; # added 2023-10-18
nlua-nvim = throw "nlua-nvim was removed, use neodev-nvim instead"; # added 2023-12-16
nvim-client = throw "nvim-client was removed because it is now part of neovim"; # added 2023-12-17
toml = throw "toml was removed because broken. You can use toml-edit instead"; # added 2024-06-25
nvim-dbee = throw "nvim-dbee was removed because broken. You can use vimPlugins.nvim-dbee instead"; # added 2024-06-25
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,32 @@
{
lua,
writeText,
toLuaModule,
}:
{
propagatedBuildInputs ? [ ],
makeFlags ? [ ],
...
}@attrs:
toLuaModule (
lua.stdenv.mkDerivation (
attrs
// {
name = "lua${lua.luaversion}-" + attrs.pname + "-" + attrs.version;
makeFlags = [
"PREFIX=$(out)"
"LUA_INC=-I${lua}/include"
"LUA_LIBDIR=$(out)/lib/lua/${lua.luaversion}"
"LUA_VERSION=${lua.luaversion}"
]
++ makeFlags;
propagatedBuildInputs = propagatedBuildInputs ++ [
lua # propagate it for its setup-hook
];
}
)
)

View File

@@ -0,0 +1,179 @@
{
pkgs,
lib,
lua,
}:
let
inherit (lib.generators) toLua;
requiredLuaModules =
drvs:
let
modules = lib.filter hasLuaModule drvs;
in
lib.unique ([ lua ] ++ modules ++ lib.concatLists (lib.catAttrs "requiredLuaModules" modules));
# Check whether a derivation provides a lua module.
hasLuaModule = drv: drv ? luaModule;
# Use this to override the arguments passed to buildLuarocksPackage
overrideLuarocks =
drv: f:
(drv.override (
args:
args
// {
buildLuarocksPackage = drv: (args.buildLuarocksPackage drv).override f;
}
))
// {
overrideScope = scope: overrideLuarocks (drv.overrideScope scope) f;
};
in
rec {
inherit overrideLuarocks;
inherit hasLuaModule requiredLuaModules;
luaPathList = [
"share/lua/${lua.luaversion}/?.lua"
"share/lua/${lua.luaversion}/?/init.lua"
];
luaCPathList = [
"lib/lua/${lua.luaversion}/?.so"
];
# generate paths without a prefix
luaPathRelStr = lib.concatStringsSep ";" luaPathList;
luaCPathRelStr = lib.concatStringsSep ";" luaCPathList;
# generate LUA_(C)PATH value for a specific derivation, i.e., with absolute paths
genLuaPathAbsStr = drv: lib.concatMapStringsSep ";" (x: "${drv}/${x}") luaPathList;
genLuaCPathAbsStr = drv: lib.concatMapStringsSep ";" (x: "${drv}/${x}") luaCPathList;
# Generate a LUA_PATH with absolute paths
# genLuaPathAbs = drv:
# lib.concatStringsSep ";" (map (x: "${drv}/x") luaPathList);
luaAtLeast = lib.versionAtLeast lua.luaversion;
luaOlder = lib.versionOlder lua.luaversion;
isLua51 = (lib.versions.majorMinor lua.version) == "5.1";
isLua52 = (lib.versions.majorMinor lua.version) == "5.2";
isLua53 = lua.luaversion == "5.3";
isLuaJIT = lib.getName lua == "luajit";
/*
generates the relative path towards the folder where
seems stable even when using lua_modules_path = ""
Example:
getDataFolder luaPackages.stdlib
=> stdlib-41.2.2-1-rocks/stdlib/41.2.2-1/doc
*/
getDataFolder = drv: "${drv.pname}-${drv.version}-rocks/${drv.pname}/${drv.version}";
/*
Convert derivation to a lua module.
so that luaRequireModules can be run later
*/
toLuaModule =
drv:
drv.overrideAttrs (oldAttrs: {
# Use passthru in order to prevent rebuilds when possible.
passthru = (oldAttrs.passthru or { }) // {
luaModule = lua;
requiredLuaModules = requiredLuaModules drv.propagatedBuildInputs;
};
});
/*
generate a luarocks config conforming to:
https://github.com/luarocks/luarocks/wiki/Config-file-format
The config lists folders where to find lua dependencies
Example:
generateLuarocksConfig {
externalDeps = [ { name = "CRYPTO"; dep = pkgs.openssl; } ];
rocksSubdir = "subdir";
};
Type:
generateLuarocksConfig :: AttrSet -> String
*/
generateLuarocksConfig =
{
externalDeps ? [ ],
# a list of lua derivations
requiredLuaRocks ? [ ],
...
}@args:
let
rocksTrees = lib.imap0 (i: dep: {
name = "dep-${toString i}";
root = "${dep}";
# packages built by buildLuaPackage or luarocks doesn't contain rocksSubdir
# hence a default here
rocks_dir =
if dep ? rocksSubdir then "${dep}/${dep.rocksSubdir}" else "${dep.pname}-${dep.version}-rocks";
}) requiredLuaRocks;
# Explicitly point luarocks to the relevant locations for multiple-output
# derivations that are external dependencies, to work around an issue it has
# (https://github.com/luarocks/luarocks/issues/766)
depVariables = zipAttrsWithLast (
lib.lists.map (
{ name, dep }:
{
"${name}_INCDIR" = "${lib.getDev dep}/include";
"${name}_LIBDIR" = "${lib.getLib dep}/lib";
"${name}_BINDIR" = "${lib.getBin dep}/bin";
}
) externalDeps'
);
zipAttrsWithLast = lib.attrsets.zipAttrsWith (name: lib.lists.last);
# example externalDeps': [ { name = "CRYPTO"; dep = pkgs.openssl; } ]
externalDeps' = lib.filter (dep: !lib.isDerivation dep) externalDeps;
externalDepsDirs = map (x: toString x) (lib.filter (lib.isDerivation) externalDeps);
generatedConfig = (
{
# first tree is the default target where new rocks are installed,
# any other trees in the list are treated as additional sources of installed rocks for matching dependencies.
rocks_trees = (
[
{
name = "current";
root = "${placeholder "out"}";
rocks_dir = "current";
}
]
++ rocksTrees
);
}
// lib.optionalAttrs lua.pkgs.isLuaJIT {
# Luajit provides some additional functionality built-in; this exposes
# that to luarock's dependency system
rocks_provided = {
jit = "${lua.luaversion}-1";
ffi = "${lua.luaversion}-1";
luaffi = "${lua.luaversion}-1";
bit = "${lua.luaversion}-1";
};
}
// {
# For single-output external dependencies
external_deps_dirs = externalDepsDirs;
# Some needed machinery to handle multiple-output external dependencies,
# as per https://github.com/luarocks/luarocks/issues/766
variables = depVariables;
}
// removeAttrs args [
"requiredLuaRocks"
"externalDeps"
]
);
in
generatedConfig;
}

View File

@@ -0,0 +1,16 @@
diff -Naur 5.2/uuid/luuid.c rock/uuid/luuid.c
--- 5.2/uuid/luuid.c 2012-05-10 11:22:00.000000000 +1000
+++ rock/uuid/luuid.c 2019-06-13 15:13:10.374134079 +1000
@@ -64,7 +64,11 @@
LUALIB_API int luaopen_uuid(lua_State *L)
{
- luaL_newlib(L,R);
+ #if LUA_VERSION_NUM == 501
+ luaL_register(L,MYNAME,R);
+ #else
+ luaL_newlib(L,R);
+ #endif
lua_pushliteral(L,"version"); /** version */
lua_pushliteral(L,MYVERSION);
lua_settable(L,-3);

View File

@@ -0,0 +1,110 @@
{
stdenv,
lib,
buildLuarocksPackage,
cmake,
fetchFromGitHub,
libuv,
lua,
luaOlder,
nix-update-script,
runCommand,
}:
buildLuarocksPackage rec {
pname = "luv";
version = "1.51.0-1";
src = fetchFromGitHub {
owner = "luvit";
repo = "luv";
rev = version;
# Need deps/lua-compat-5.3 only
fetchSubmodules = true;
hash = "sha256-vQfr0TwhkvRDJwZnxDD/53yCzyDouzQimTnwj4drs/c=";
};
# to make sure we dont use bundled deps
prePatch = ''
rm -rf deps/lua deps/luajit deps/libuv
'';
patches = [
# Fails with "Uncaught Error: ./tests/test-dns.lua:164: assertion failed!"
# and "./tests/test-tty.lua:19: bad argument #1 to 'is_readable' (Expected
# uv_stream userdata)"
./disable-failing-tests.patch
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# Fails with "Uncaught Error: ./tests/test-udp.lua:261: EHOSTUNREACH"
./disable-failing-darwin-tests.patch
];
buildInputs = [ libuv ];
nativeBuildInputs = [ cmake ];
# Need to specify WITH_SHARED_LIBUV=ON cmake flag, but
# Luarocks doesn't take cmake variables from luarocks config.
# Need to specify it in rockspec. See https://github.com/luarocks/luarocks/issues/1160.
knownRockspec = runCommand "luv-${version}.rockspec" { } ''
patch ${src}/luv-scm-0.rockspec -o - > $out <<'EOF'
--- a/luv-scm-0.rockspec
+++ b/luv-scm-0.rockspec
@@ -1,5 +1,5 @@
package = "luv"
-version = "scm-0"
+version = "${version}"
source = {
url = 'git://github.com/luvit/luv.git'
}
@@ -24,6 +24,7 @@
build =
type = 'cmake',
variables = {
+ WITH_SHARED_LIBUV="ON",
CMAKE_C_FLAGS="$(CFLAGS)",
CMAKE_MODULE_LINKER_FLAGS="$(LIBFLAG)",
LUA_LIBDIR="$(LUA_LIBDIR)",
EOF
'';
__darwinAllowLocalNetworking = true;
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
luarocks test
runHook postInstallCheck
'';
disabled = luaOlder "5.1";
passthru = {
tests.test =
runCommand "luv-${version}-test"
{
nativeBuildInputs = [ (lua.withPackages (ps: [ ps.luv ])) ];
}
''
lua <<EOF
local uv = require("luv")
assert(uv.fs_mkdir(assert(uv.os_getenv("out")), 493))
print(uv.version_string())
EOF
'';
updateScript = nix-update-script { };
};
meta = {
homepage = "https://github.com/luvit/luv";
description = "Bare libuv bindings for lua";
longDescription = ''
This library makes libuv available to lua scripts. It was made for the luvit
project but should usable from nearly any lua project.
'';
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ stasjok ];
platforms = lua.meta.platforms;
};
}

View File

@@ -0,0 +1,19 @@
diff --git a/tests/test-udp.lua b/tests/test-udp.lua
index bd0f46d..e4542b4 100644
--- a/tests/test-udp.lua
+++ b/tests/test-udp.lua
@@ -280,14 +280,6 @@ return require('lib/tap')(function (test)
-- same check for skipping the ipv6 test; we just expanded it to
-- the ipv4 test as well.
local function has_external_interface(uv, family)
- local addresses = assert(uv.interface_addresses())
- for _, vals in pairs(addresses) do
- for _, info in ipairs(vals) do
- if (not family or info.family == family) and not info.internal then
- return true
- end
- end
- end
return false
end

View File

@@ -0,0 +1,30 @@
diff --git a/tests/test-dns.lua b/tests/test-dns.lua
index 894220b..0763b36 100644
--- a/tests/test-dns.lua
+++ b/tests/test-dns.lua
@@ -161,7 +161,6 @@ return require('lib/tap')(function (test)
p{err=err,hostname=hostname,service=service}
assert(not err, err)
assert(hostname)
- assert(service == "http")
end)))
end)
diff --git a/tests/test-tty.lua b/tests/test-tty.lua
index 165e58d..11368df 100644
--- a/tests/test-tty.lua
+++ b/tests/test-tty.lua
@@ -13,13 +13,10 @@ end
return require('lib/tap')(function (test)
test("tty normal", function (print, p, expect, uv)
- local stdin = uv.new_tty(0, true)
local stdout = uv.new_tty(1, false)
- assert(uv.is_readable(stdin))
assert(uv.is_writable(stdout))
- uv.close(stdin)
uv.close(stdout)
end)

View File

@@ -0,0 +1,37 @@
{
lib,
cmake,
fixDarwinDylibNames,
isLuaJIT,
libuv,
lua,
stdenv,
}:
stdenv.mkDerivation {
pname = "libluv";
inherit (lua.pkgs.luv) version src meta;
cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
"-DBUILD_MODULE=OFF"
"-DWITH_SHARED_LIBUV=ON"
"-DLUA_BUILD_TYPE=System"
"-DWITH_LUA_ENGINE=${if isLuaJIT then "LuaJit" else "Lua"}"
];
# to make sure we dont use bundled deps
prePatch = ''
rm -rf deps/lua deps/luajit deps/libuv
'';
buildInputs = [
libuv
lua
];
nativeBuildInputs = [
cmake
]
++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ];
}

View File

@@ -0,0 +1,92 @@
{
gnupg,
gpgme,
isLuaJIT,
lib,
libgit2,
libgpg-error,
lua,
lux-cli,
nix,
openssl,
perl,
pkg-config,
rustPlatform,
}:
let
luaMajorMinor = lib.take 2 (lib.splitVersion lua.version);
luaVersionDir = if isLuaJIT then "jit" else lib.concatStringsSep "." luaMajorMinor;
luaFeature = if isLuaJIT then "luajit" else "lua${lib.concatStringsSep "" luaMajorMinor}";
in
rustPlatform.buildRustPackage rec {
pname = "lux-lua";
version = lux-cli.version;
src = lux-cli.src;
buildAndTestSubdir = "lux-lua";
buildNoDefaultFeatures = true;
buildFeatures = [ luaFeature ];
cargoHash = lux-cli.cargoHash;
nativeBuildInputs = [
perl
pkg-config
];
buildInputs = [
gnupg
gpgme
libgit2
libgpg-error
openssl
];
propagatedBuildInputs = [
lua
];
doCheck = false; # lux-lua tests are broken in nixpkgs
useNextest = true;
nativeCheckInputs = [
lua
nix
];
env = {
LIBGIT2_NO_VENDOR = 1;
LIBSSH2_SYS_USE_PKG_CONFIG = 1;
LUX_SKIP_IMPURE_TESTS = 1; # Disable impure unit tests
};
buildPhase = ''
runHook preBuild
cargo xtask-${luaFeature} dist
mkdir -p $out
runHook postBuild
'';
installPhase = ''
runHook preInstall
cp -r target/dist/share $out
cp -r target/dist/lib $out
mkdir -p $out/lib/lua
ln -s $out/share/lux-lua/${luaVersionDir} $out/lib/lua/${luaVersionDir}
runHook postInstall
'';
cargoTestFlags = "--lib"; # Disable impure integration tests
meta = {
description = "Lua API for the Lux package manager";
homepage = "https://lux.lumen-labs.org/";
changelog = "https://github.com/lumen-oss/lux/blob/${src.tag}/CHANGELOG.md";
license = lib.licenses.lgpl3Plus;
maintainers = with lib.maintainers; [
mrcjkb
];
platforms = lib.platforms.all;
};
}

View File

@@ -0,0 +1,53 @@
diff --git a/magick/wand/lib.lua b/magick/wand/lib.lua
index 21940a0..0d103dc 100644
--- a/magick/wand/lib.lua
+++ b/magick/wand/lib.lua
@@ -134,15 +134,6 @@ get_filters = function()
local prefixes = {
"/usr/include/ImageMagick",
"/usr/local/include/ImageMagick",
- unpack((function()
- local _accum_0 = { }
- local _len_0 = 1
- for p in get_flags():gmatch("-I([^%s]+)") do
- _accum_0[_len_0] = p
- _len_0 = _len_0 + 1
- end
- return _accum_0
- end)())
}
for _index_0 = 1, #prefixes do
local p = prefixes[_index_0]
@@ -204,12 +195,7 @@ try_to_load = function(...)
break
end
end
- if pcall(function()
- out = ffi.load(name)
- end) then
- return out
- end
- _continue_0 = true
+ return ffi.load(name)
until true
if not _continue_0 then
break
@@ -217,17 +203,7 @@ try_to_load = function(...)
end
return error("Failed to load ImageMagick (" .. tostring(...) .. ")")
end
-lib = try_to_load("MagickWand", function()
- local lname = get_flags():match("-l(MagickWand[^%s]*)")
- local suffix
- if ffi.os == "OSX" then
- suffix = ".dylib"
- elseif ffi.os == "Windows" then
- suffix = ".dll"
- else
- suffix = ".so"
- end
- return lname and "lib" .. lname .. suffix
+lib = try_to_load("@nix_wand@", function()
end)
return {
lib = lib,

View File

@@ -0,0 +1,51 @@
{
fetchFromGitHub,
buildLuarocksPackage,
lua,
pkg-config,
lib,
replaceVars,
zenity,
}:
buildLuarocksPackage {
pname = "nfd";
version = "scm-1";
src = fetchFromGitHub {
owner = "Vexatos";
repo = "nativefiledialog";
rev = "2f74a5758e8df9b27158d444953697bc13fe90d8";
sha256 = "1f52mb0s9zrpsqjp10bx92wzqmy1lq7fg1fk1nd6xmv57kc3b1qv";
fetchSubmodules = true;
};
# use zenity because default gtk impl just crashes
patches = [
(replaceVars ./zenity.patch {
inherit zenity;
})
];
knownRockspec = "lua/nfd-scm-1.rockspec";
luarocksConfig.variables.LUA_LIBDIR = "${lua}/lib";
nativeBuildInputs = [ pkg-config ];
postInstall = ''
find $out -name nfd_zenity.so -execdir mv {} nfd.so \;
'';
doInstallCheck = true;
installCheckInputs = [ lua.pkgs.busted ];
installCheckPhase = ''
busted lua/spec/
'';
meta = {
description = "Tiny, neat Lua library that invokes native file open and save dialogs";
homepage = "https://github.com/Alloyed/nativefiledialog/tree/master/lua";
license = lib.licenses.zlib;
maintainers = [ lib.maintainers.scoder12 ];
broken = lua.luaversion != "5.1";
};
}

View File

@@ -0,0 +1,47 @@
diff --git a/lua/Makefile.linux b/lua/Makefile.linux
index 9f5aa68..77660d4 100644
--- a/lua/Makefile.linux
+++ b/lua/Makefile.linux
@@ -37,5 +37,5 @@ nfd_zenity.o: src/nfd_zenity.c
clean:
rm nfd_common.o nfd_gtk.o nfd_wrap_lua.o nfd.so
-install: nfd.so
- cp nfd.so $(INST_LIBDIR)
+install:
+ cp nfd*.so $(INST_LIBDIR)
diff --git a/lua/nfd-scm-1.rockspec b/lua/nfd-scm-1.rockspec
index 503399d..2d0a7da 100644
--- a/lua/nfd-scm-1.rockspec
+++ b/lua/nfd-scm-1.rockspec
@@ -17,9 +17,6 @@ supported_platforms = { "linux", "macosx", "windows" }
external_dependencies = {
platforms = {
linux = {
- gtk3 = {
- library = "gtk-3",
- }
}
}
}
@@ -28,6 +25,7 @@ build = {
linux = {
type = "make",
makefile = "lua/Makefile.linux",
+ build_target = "nfd_zenity.so",
build_variables = {
CFLAGS="$(CFLAGS)",
LIBFLAG="$(LIBFLAG)",
diff --git a/src/nfd_zenity.c b/src/nfd_zenity.c
index 43ccc6d..3fcdea0 100644
--- a/src/nfd_zenity.c
+++ b/src/nfd_zenity.c
@@ -109,6 +109,8 @@ ZenityCommon(char** command,
command[i] = tmp;
}
+ // caller always sets command[0] to "zenity"
+ command[0] = strdup("@zenity@/bin/zenity");
AddFiltersToCommandArgs(command, commandLen, filterList);
int byteCount = 0;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,8 @@
[flake8]
# E111 => 4 spaces tabs
# don't let spaces else it is not recognized
# E123 buggy
ignore =
E501,E265,E402
max-line-length = 120