lua-modules/overrides.nix: run nixpkgs-fmt

This commit is contained in:
Artturin 2022-08-24 19:06:16 +03:00
parent a2c61752fb
commit a59a6bc4ea

View file

@ -5,7 +5,7 @@ with prev;
##########################################3 ##########################################3
#### manual fixes for generated packages #### manual fixes for generated packages
##########################################3 ##########################################3
bit32 = prev.bit32.overrideAttrs(oa: { bit32 = prev.bit32.overrideAttrs (oa: {
# Small patch in order to no longer redefine a Lua 5.2 function that Luajit # Small patch in order to no longer redefine a Lua 5.2 function that Luajit
# 2.1 also provides, see https://github.com/LuaJIT/LuaJIT/issues/325 for # 2.1 also provides, see https://github.com/LuaJIT/LuaJIT/issues/325 for
# more # more
@ -14,7 +14,7 @@ with prev;
]; ];
}); });
busted = prev.busted.overrideAttrs(oa: { busted = prev.busted.overrideAttrs (oa: {
nativeBuildInputs = oa.nativeBuildInputs ++ [ nativeBuildInputs = oa.nativeBuildInputs ++ [
pkgs.installShellFiles pkgs.installShellFiles
]; ];
@ -35,14 +35,15 @@ with prev;
{ name = "OPENSSL"; dep = pkgs.openssl_1_1; } { name = "OPENSSL"; dep = pkgs.openssl_1_1; }
]; ];
disabled = luaOlder "5.1" || luaAtLeast "5.4"; disabled = luaOlder "5.1" || luaAtLeast "5.4";
})).overrideAttrs(oa: rec { })).overrideAttrs (oa: rec {
# Parse out a version number without the Lua version inserted # Parse out a version number without the Lua version inserted
version = with pkgs.lib; let version = with pkgs.lib; let
version' = prev.cqueues.version; version' = prev.cqueues.version;
rel = splitVersion version'; rel = splitVersion version';
date = head rel; date = head rel;
rev = last (splitString "-" (last rel)); rev = last (splitString "-" (last rel));
in "${date}-${rev}"; in
"${date}-${rev}";
nativeBuildInputs = oa.nativeBuildInputs ++ [ nativeBuildInputs = oa.nativeBuildInputs ++ [
pkgs.gnum4 pkgs.gnum4
@ -50,7 +51,8 @@ with prev;
# Upstream rockspec is pointlessly broken into separate rockspecs, per Lua # Upstream rockspec is pointlessly broken into separate rockspecs, per Lua
# version, which doesn't work well for us, so modify it # version, which doesn't work well for us, so modify it
postConfigure = let inherit (prev.cqueues) pname; in '' postConfigure = let inherit (prev.cqueues) pname; in
''
# 'all' target auto-detects correct Lua version, which is fine for us as # 'all' target auto-detects correct Lua version, which is fine for us as
# we only have the right one available :) # we only have the right one available :)
sed -Ei ''${rockspecFilename} \ sed -Ei ''${rockspecFilename} \
@ -69,7 +71,7 @@ with prev;
]; ];
}); });
http = prev.http.overrideAttrs(oa: { http = prev.http.overrideAttrs (oa: {
patches = [ patches = [
(pkgs.fetchpatch { (pkgs.fetchpatch {
name = "invalid-state-progression.patch"; name = "invalid-state-progression.patch";
@ -85,9 +87,9 @@ with prev;
ldbus = prev.luaLib.overrideLuarocks prev.ldbus (drv: { ldbus = prev.luaLib.overrideLuarocks prev.ldbus (drv: {
extraVariables = { extraVariables = {
DBUS_DIR="${pkgs.dbus.lib}"; DBUS_DIR = "${pkgs.dbus.lib}";
DBUS_ARCH_INCDIR="${pkgs.dbus.lib}/lib/dbus-1.0/include"; DBUS_ARCH_INCDIR = "${pkgs.dbus.lib}/lib/dbus-1.0/include";
DBUS_INCDIR="${pkgs.dbus.dev}/include/dbus-1.0"; DBUS_INCDIR = "${pkgs.dbus.dev}/include/dbus-1.0";
}; };
buildInputs = with pkgs; [ buildInputs = with pkgs; [
dbus dbus
@ -201,7 +203,7 @@ with prev;
]; ];
}); });
lua-lsp = prev.lua-lsp.overrideAttrs(oa: { lua-lsp = prev.lua-lsp.overrideAttrs (oa: {
# until Alloyed/lua-lsp#28 # until Alloyed/lua-lsp#28
postConfigure = '' postConfigure = ''
substituteInPlace ''${rockspecFilename} \ substituteInPlace ''${rockspecFilename} \
@ -219,8 +221,8 @@ with prev;
luadbi-mysql = prev.luaLib.overrideLuarocks prev.luadbi-mysql (drv: { luadbi-mysql = prev.luaLib.overrideLuarocks prev.luadbi-mysql (drv: {
extraVariables = { extraVariables = {
# Can't just be /include and /lib, unfortunately needs the trailing 'mysql' # Can't just be /include and /lib, unfortunately needs the trailing 'mysql'
MYSQL_INCDIR="${pkgs.libmysqlclient.dev}/include/mysql"; MYSQL_INCDIR = "${pkgs.libmysqlclient.dev}/include/mysql";
MYSQL_LIBDIR="${pkgs.libmysqlclient}/lib/mysql"; MYSQL_LIBDIR = "${pkgs.libmysqlclient}/lib/mysql";
}; };
buildInputs = [ buildInputs = [
pkgs.mariadb.client pkgs.mariadb.client
@ -261,7 +263,8 @@ with prev;
luaffi = prev.luaLib.overrideLuarocks prev.luaffi (drv: { luaffi = prev.luaLib.overrideLuarocks prev.luaffi (drv: {
# The packaged .src.rock version is pretty old, and doesn't work with Lua 5.3 # The packaged .src.rock version is pretty old, and doesn't work with Lua 5.3
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "facebook"; repo = "luaffifb"; owner = "facebook";
repo = "luaffifb";
rev = "532c757e51c86f546a85730b71c9fef15ffa633d"; rev = "532c757e51c86f546a85730b71c9fef15ffa633d";
sha256 = "1nwx6sh56zfq99rcs7sph0296jf6a9z72mxknn0ysw9fd7m1r8ig"; sha256 = "1nwx6sh56zfq99rcs7sph0296jf6a9z72mxknn0ysw9fd7m1r8ig";
}; };
@ -305,7 +308,7 @@ with prev;
]; ];
}); });
luaunbound = prev.luaLib.overrideLuarocks prev.luaunbound(drv: { luaunbound = prev.luaLib.overrideLuarocks prev.luaunbound (drv: {
externalDeps = [ externalDeps = [
{ name = "libunbound"; dep = pkgs.unbound; } { name = "libunbound"; dep = pkgs.unbound; }
]; ];
@ -316,7 +319,7 @@ with prev;
{ name = "LIBUUID"; dep = pkgs.libuuid; } { name = "LIBUUID"; dep = pkgs.libuuid; }
]; ];
disabled = luaOlder "5.1" || (luaAtLeast "5.4"); disabled = luaOlder "5.1" || (luaAtLeast "5.4");
})).overrideAttrs(oa: { })).overrideAttrs (oa: {
meta = oa.meta // { meta = oa.meta // {
platforms = pkgs.lib.platforms.linux; platforms = pkgs.lib.platforms.linux;
}; };
@ -329,7 +332,8 @@ with prev;
patches = [ patches = [
./luuid.patch ./luuid.patch
]; ];
postConfigure = let inherit (prev.luuid) version pname; in '' postConfigure = let inherit (prev.luuid) version pname; in
''
sed -Ei ''${rockspecFilename} -e 's|lua >= 5.2|lua >= 5.1,|' sed -Ei ''${rockspecFilename} -e 's|lua >= 5.2|lua >= 5.1,|'
''; '';
}); });
@ -394,7 +398,7 @@ with prev;
USE_SYSTEM_MPACK = "yes"; USE_SYSTEM_MPACK = "yes";
}); });
rapidjson = prev.rapidjson.overrideAttrs(oa: { rapidjson = prev.rapidjson.overrideAttrs (oa: {
preBuild = '' preBuild = ''
sed -i '/set(CMAKE_CXX_FLAGS/d' CMakeLists.txt sed -i '/set(CMAKE_CXX_FLAGS/d' CMakeLists.txt
sed -i '/set(CMAKE_C_FLAGS/d' CMakeLists.txt sed -i '/set(CMAKE_C_FLAGS/d' CMakeLists.txt
@ -435,14 +439,14 @@ with prev;
}); });
std-_debug = prev.std-_debug.overrideAttrs(oa: { std-_debug = prev.std-_debug.overrideAttrs (oa: {
# run make to generate lib/std/_debug/version.lua # run make to generate lib/std/_debug/version.lua
preConfigure = '' preConfigure = ''
make all make all
''; '';
}); });
std-normalize = prev.std-normalize.overrideAttrs(oa: { std-normalize = prev.std-normalize.overrideAttrs (oa: {
# run make to generate lib/std/_debug/version.lua # run make to generate lib/std/_debug/version.lua
preConfigure = '' preConfigure = ''
make all make all
@ -451,8 +455,8 @@ with prev;
# TODO just while testing, remove afterwards # TODO just while testing, remove afterwards
# toVimPlugin should do it instead # toVimPlugin should do it instead
gitsigns-nvim = prev.gitsigns-nvim.overrideAttrs(oa: { gitsigns-nvim = prev.gitsigns-nvim.overrideAttrs (oa: {
nativeBuildInputs = oa.nativeBuildInputs or [] ++ [ pkgs.vimUtils.vimGenDocHook ]; nativeBuildInputs = oa.nativeBuildInputs or [ ] ++ [ pkgs.vimUtils.vimGenDocHook ];
}); });
# aliases # aliases