luaPackages.libuv: bump to v1.43.0

as required by neovim master
This commit is contained in:
Matthieu Coudron 2022-03-29 03:46:00 +02:00
parent 8bb4179147
commit 2e5732b320
2 changed files with 53 additions and 30 deletions

View file

@ -2028,22 +2028,32 @@ buildLuarocksPackage {
}; };
}) {}; }) {};
luv = callPackage({ buildLuarocksPackage, luaOlder, luaAtLeast luv = callPackage ({ buildLuarocksPackage, luaOlder, luaAtLeast
, fetchurl, lua , cmake, fetchurl, lua
}: }:
buildLuarocksPackage { buildLuarocksPackage {
pname = "luv"; pname = "luv";
version = "1.43.0-0"; version = "1.43.0-0";
knownRockspec = (fetchurl { knownRockspec = (fetchurl {
url = "https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/luv-1.43.0-0.rockspec"; url = "https://luarocks.org/luv-1.43.0-0.rockspec";
sha256 = "0z5a7yp20xbb3f9w73skm9fj89gxxqv72nrxjq3kycsc6c2v3m8f"; sha256 = "0z5a7yp20xbb3f9w73skm9fj89gxxqv72nrxjq3kycsc6c2v3m8f";
}).outPath; }).outPath;
src = fetchurl {
url = "https://github.com/luvit/luv/releases/download/1.43.0-0/luv-1.43.0-0.tar.gz"; src = fetchgit ( removeAttrs (builtins.fromJSON ''{
sha256 = "1qlx1r79sfn8r20yx19bhdr0v58ykpwgwzy5vma9p2ngrlynyyjn"; "url": "https://github.com/luvit/luv.git",
}; "rev": "1.43.0-0",
"date": "2022-03-12T16:05:50+08:00",
"path": "/nix/store/d7f3sdw5l0cm8xkjdm4m6jkmx794w48j-luv",
"sha256": "sha256-CcUX69XzgWlJEwHUhhtqs9sDA5TNIusKek5yV2Nt3Wc=",
"fetchLFS": false,
"fetchSubmodules": true,
"deepClone": false,
"leaveDotGit": false
}
'') ["date" "path"]) ;
disabled = with lua; (luaOlder "5.1"); disabled = with lua; (luaOlder "5.1");
nativeBuildInputs = [ cmake ];
propagatedBuildInputs = [ lua ]; propagatedBuildInputs = [ lua ];
meta = { meta = {

View file

@ -280,34 +280,47 @@ with prev;
''; '';
}); });
# as advised in https://github.com/luarocks/luarocks/issues/1402
# we shouldn't use luarocks machinery to build complex cmake components
libluv = pkgs.stdenv.mkDerivation {
inherit (prev.luv) pname version meta src;
cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
"-DBUILD_MODULE=OFF"
"-DWITH_SHARED_LIBUV=ON"
];
buildInputs = [ pkgs.libuv ];
nativeBuildInputs = [ pkgs.pkg-config pkgs.fixDarwinDylibNames pkgs.cmake ];
# Fixup linking libluv.dylib, for some reason it's not linked against lua correctly.
NIX_LDFLAGS = pkgs.lib.optionalString pkgs.stdenv.isDarwin
(if isLuaJIT then "-lluajit-${lua.luaversion}" else "-llua");
};
luv = prev.lib.overrideLuarocks prev.luv (drv: { luv = prev.lib.overrideLuarocks prev.luv (drv: {
buildInputs = [ pkgs.pkg-config pkgs.libuv ];
doInstallCheck = true;
# Use system libuv instead of building local and statically linking # Use system libuv instead of building local and statically linking
# This is a hacky way to specify -DWITH_SHARED_LIBUV=ON which extraVariables = {
# is not possible with luarocks and the current luv rockspec "WITH_SHARED_LIBUV" = "ON";
# While at it, remove bundled libuv source entirely to be sure. };
# We may wish to drop bundled lua submodules too...
preBuild = '' # we unset the LUA_PATH since the hook erases the interpreter defaults (To fix)
sed -i 's,\(option(WITH_SHARED_LIBUV.*\)OFF,\1ON,' CMakeLists.txt installCheckPhase = ''
rm -rf deps/libuv unset LUA_PATH
rm tests/test-{dns,thread}.lua
lua tests/run.lua
''; '';
buildInputs = [ pkgs.libuv ]; passthru.libluv = final.libluv;
passthru = {
libluv = final.luv.overrideAttrs (oa: {
preBuild = final.luv.preBuild + ''
sed -i 's,\(option(BUILD_MODULE.*\)ON,\1OFF,' CMakeLists.txt
sed -i 's,\(option(BUILD_SHARED_LIBS.*\)OFF,\1ON,' CMakeLists.txt
sed -i 's,${"\${.*INSTALL_INC_DIR}"},${placeholder "out"}/include/luv,' CMakeLists.txt
'';
nativeBuildInputs = [ pkgs.fixDarwinDylibNames ];
# Fixup linking libluv.dylib, for some reason it's not linked against lua correctly.
NIX_LDFLAGS = pkgs.lib.optionalString pkgs.stdenv.isDarwin
(if isLuaJIT then "-lluajit-${lua.luaversion}" else "-llua");
});
};
}); });
lyaml = prev.lib.overrideLuarocks prev.lyaml (oa: { lyaml = prev.lib.overrideLuarocks prev.lyaml (oa: {