luaPackages.luv: 1.48.0-2 -> 1.50.0-1 (#393966)

This commit is contained in:
Gaétan Lepage 2025-04-26 09:13:12 +02:00 committed by GitHub
commit d12267ab0a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 134 additions and 85 deletions

View file

@ -106,7 +106,6 @@ luazip,,,,,,
lusc_luv,,,,,,
lush.nvim,,,https://luarocks.org/dev,,,teto
luuid,,,,20120509-2,,
luv,,,,1.48.0-2,,
lyaml,,,,,,lblasc
lz.n,,,,,,mrcjkb
lze,,,,,,birdee

1 name rockspec ref server version luaversion maintainers
106 lusc_luv
107 lush.nvim https://luarocks.org/dev teto
108 luuid 20120509-2
luv 1.48.0-2
109 lyaml lblasc
110 lz.n mrcjkb
111 lze birdee

View file

@ -3491,37 +3491,6 @@ final: prev: {
}
) { };
luv = callPackage (
{
buildLuarocksPackage,
cmake,
fetchurl,
luaOlder,
}:
buildLuarocksPackage {
pname = "luv";
version = "1.48.0-2";
knownRockspec =
(fetchurl {
url = "mirror://luarocks/luv-1.48.0-2.rockspec";
sha256 = "0353bjn9z90a1hd7rksdfrd9fbdd31hbvdaxr1fb0fh0bc1cpy94";
}).outPath;
src = fetchurl {
url = "https://github.com/luvit/luv/releases/download/1.48.0-2/luv-1.48.0-2.tar.gz";
sha256 = "0yivq14dw0vjyl8ibrgdgrj9fbhjyy4yf3m4jc15bxmlxggisfic";
};
disabled = luaOlder "5.1";
nativeBuildInputs = [ cmake ];
meta = {
homepage = "https://github.com/luvit/luv";
description = "Bare libuv bindings for lua";
license.fullName = "Apache 2.0";
};
}
) { };
lyaml = callPackage (
{
buildLuarocksPackage,

View file

@ -0,0 +1,95 @@
{
lib,
buildLuarocksPackage,
cmake,
fetchFromGitHub,
libuv,
lua,
luaOlder,
nix-update-script,
runCommand,
}:
buildLuarocksPackage rec {
pname = "luv";
version = "1.50.0-1";
src = fetchFromGitHub {
owner = "luvit";
repo = "luv";
rev = version;
# Need deps/lua-compat-5.3 only
fetchSubmodules = true;
hash = "sha256-PS3+qpELpX0tr7UqrlnE4NYScJb50j+9J4fbH9CTr/s=";
};
# to make sure we dont use bundled deps
prePatch = ''
rm -rf deps/lua deps/luajit deps/libuv
'';
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
'';
doInstallCheck = true;
installCheckPhase = ''
rm tests/test-{dns,thread,tty}.lua
luarocks test
'';
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,36 @@
{
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

@ -15,7 +15,6 @@
fetchFromGitHub,
fetchpatch,
fetchurl,
fixDarwinDylibNames,
fzf,
glib,
glibc,
@ -33,7 +32,6 @@
libpsl,
libpq,
libuuid,
libuv,
libxcrypt,
libyaml,
lua-language-server,
@ -846,57 +844,6 @@ in
'';
});
# as advised in https://github.com/luarocks/luarocks/issues/1402#issuecomment-1080616570
# we shouldn't use luarocks machinery to build complex cmake components
libluv = stdenv.mkDerivation {
pname = "libluv";
inherit (prev.luv) version meta src;
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
postUnpack = ''
rm -rf deps/lua deps/libuv
'';
buildInputs = [
libuv
final.lua
];
nativeBuildInputs = [
pkg-config
cmake
] ++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ];
};
luv = prev.luv.overrideAttrs (oa: {
nativeBuildInputs = oa.nativeBuildInputs ++ [ pkg-config ];
buildInputs = [ libuv ];
# Use system libuv instead of building local and statically linking
luarocksConfig = lib.recursiveUpdate oa.luarocksConfig {
variables = {
WITH_SHARED_LIBUV = "ON";
};
};
# we unset the LUA_PATH since the hook erases the interpreter defaults (To fix)
# tests is not run since they are not part of the tarball anymore
preCheck = ''
unset LUA_PATH
rm tests/test-{dns,thread}.lua
'';
});
lyaml = prev.lyaml.overrideAttrs (oa: {
buildInputs = [
libyaml

View file

@ -205,6 +205,9 @@ rec {
}
) { };
luv = callPackage ../development/lua-modules/luv { };
libluv = callPackage ../development/lua-modules/luv/lib.nix { };
luxio = callPackage (
{
fetchurl,