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

Changed files
+134 -85
maintainers
pkgs
-1
maintainers/scripts/luarocks-packages.csv
···
lusc_luv,,,,,,
lush.nvim,,,https://luarocks.org/dev,,,teto
luuid,,,,20120509-2,,
-
luv,,,,1.48.0-2,,
lyaml,,,,,,lblasc
lz.n,,,,,,mrcjkb
lze,,,,,,birdee
···
lusc_luv,,,,,,
lush.nvim,,,https://luarocks.org/dev,,,teto
luuid,,,,20120509-2,,
lyaml,,,,,,lblasc
lz.n,,,,,,mrcjkb
lze,,,,,,birdee
-31
pkgs/development/lua-modules/generated-packages.nix
···
}
) { };
-
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,
···
}
) { };
lyaml = callPackage (
{
buildLuarocksPackage,
+95
pkgs/development/lua-modules/luv/default.nix
···
···
+
{
+
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;
+
};
+
}
+36
pkgs/development/lua-modules/luv/lib.nix
···
···
+
{
+
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 ];
+
}
-53
pkgs/development/lua-modules/overrides.nix
···
fetchFromGitHub,
fetchpatch,
fetchurl,
-
fixDarwinDylibNames,
fzf,
glib,
glibc,
···
libpsl,
libpq,
libuuid,
-
libuv,
libxcrypt,
libyaml,
lua-language-server,
···
rm tests/plenary/job_spec.lua tests/plenary/scandir_spec.lua tests/plenary/curl_spec.lua
make test
runHook postCheck
-
'';
-
});
-
-
# 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
'';
});
···
fetchFromGitHub,
fetchpatch,
fetchurl,
fzf,
glib,
glibc,
···
libpsl,
libpq,
libuuid,
libxcrypt,
libyaml,
lua-language-server,
···
rm tests/plenary/job_spec.lua tests/plenary/scandir_spec.lua tests/plenary/curl_spec.lua
make test
runHook postCheck
'';
});
+3
pkgs/top-level/lua-packages.nix
···
}
) { };
luxio = callPackage (
{
fetchurl,
···
}
) { };
+
luv = callPackage ../development/lua-modules/luv { };
+
libluv = callPackage ../development/lua-modules/luv/lib.nix { };
+
luxio = callPackage (
{
fetchurl,