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,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 ];
}