2022-09-30 11:47:45 +00:00
|
|
|
# do not add pkgs, it messes up splicing
|
|
|
|
{ stdenv
|
|
|
|
, cmake
|
|
|
|
, cyrus_sasl
|
|
|
|
, dbus
|
|
|
|
, expat
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, fetchurl
|
|
|
|
, fixDarwinDylibNames
|
|
|
|
, glib
|
|
|
|
, glibc
|
|
|
|
, gmp
|
|
|
|
, gnulib
|
|
|
|
, gnum4
|
|
|
|
, gobject-introspection
|
|
|
|
, installShellFiles
|
|
|
|
, lib
|
|
|
|
, libevent
|
|
|
|
, libiconv
|
|
|
|
, libmpack
|
|
|
|
, libmysqlclient
|
|
|
|
, libuuid
|
|
|
|
, libuv
|
2022-10-30 15:09:59 +00:00
|
|
|
, libxcrypt
|
2022-09-30 11:47:45 +00:00
|
|
|
, libyaml
|
|
|
|
, mariadb
|
|
|
|
, mpfr
|
|
|
|
, neovim-unwrapped
|
2022-12-02 08:20:57 +00:00
|
|
|
, openssl
|
2022-09-30 11:47:45 +00:00
|
|
|
, pcre
|
|
|
|
, pkg-config
|
|
|
|
, postgresql
|
|
|
|
, readline
|
|
|
|
, sqlite
|
|
|
|
, unbound
|
|
|
|
, vimPlugins
|
|
|
|
, vimUtils
|
|
|
|
, yajl
|
|
|
|
, zlib
|
|
|
|
, zziplib
|
|
|
|
}:
|
|
|
|
|
2021-10-17 09:34:42 +00:00
|
|
|
final: prev:
|
|
|
|
with prev;
|
2020-04-24 23:36:52 +00:00
|
|
|
{
|
|
|
|
##########################################3
|
|
|
|
#### manual fixes for generated packages
|
|
|
|
##########################################3
|
2022-09-30 11:47:45 +00:00
|
|
|
bit32 = prev.bit32.overrideAttrs (oa: {
|
2020-04-24 23:36:52 +00:00
|
|
|
# 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
|
|
|
|
# more
|
|
|
|
patches = [
|
|
|
|
./bit32.patch
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
busted = prev.busted.overrideAttrs (oa: {
|
2022-06-26 10:26:21 +00:00
|
|
|
nativeBuildInputs = oa.nativeBuildInputs ++ [
|
2022-09-30 11:47:45 +00:00
|
|
|
installShellFiles
|
2022-06-16 17:23:12 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
postConfigure = ''
|
|
|
|
substituteInPlace ''${rockspecFilename} \
|
|
|
|
--replace "'lua_cliargs = 3.0-1'," "'lua_cliargs >= 3.0-1',"
|
|
|
|
'';
|
|
|
|
postInstall = ''
|
2022-06-16 17:23:12 +00:00
|
|
|
installShellCompletion --cmd busted \
|
|
|
|
--zsh completions/zsh/_busted \
|
|
|
|
--bash completions/bash/busted.bash
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
cqueues = (prev.luaLib.overrideLuarocks prev.cqueues (drv: {
|
2020-04-24 23:36:52 +00:00
|
|
|
externalDeps = [
|
2022-12-02 08:20:57 +00:00
|
|
|
{ name = "CRYPTO"; dep = openssl; }
|
|
|
|
{ name = "OPENSSL"; dep = openssl; }
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
disabled = luaOlder "5.1" || luaAtLeast "5.4";
|
2022-09-30 11:47:45 +00:00
|
|
|
})).overrideAttrs (oa: rec {
|
2021-10-17 09:34:42 +00:00
|
|
|
# Parse out a version number without the Lua version inserted
|
2022-09-30 11:47:45 +00:00
|
|
|
version = with lib; let
|
2021-10-17 09:34:42 +00:00
|
|
|
version' = prev.cqueues.version;
|
|
|
|
rel = splitVersion version';
|
|
|
|
date = head rel;
|
|
|
|
rev = last (splitString "-" (last rel));
|
2022-09-30 11:47:45 +00:00
|
|
|
in
|
|
|
|
"${date}-${rev}";
|
2022-06-26 10:26:21 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = oa.nativeBuildInputs ++ [
|
2022-09-30 11:47:45 +00:00
|
|
|
gnum4
|
2022-06-26 10:26:21 +00:00
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# Upstream rockspec is pointlessly broken into separate rockspecs, per Lua
|
|
|
|
# version, which doesn't work well for us, so modify it
|
2022-09-30 11:47:45 +00:00
|
|
|
postConfigure = let inherit (prev.cqueues) pname; in
|
|
|
|
''
|
|
|
|
# 'all' target auto-detects correct Lua version, which is fine for us as
|
|
|
|
# we only have the right one available :)
|
|
|
|
sed -Ei ''${rockspecFilename} \
|
|
|
|
-e 's|lua == 5.[[:digit:]]|lua >= 5.1, <= 5.3|' \
|
|
|
|
-e 's|build_target = "[^"]+"|build_target = "all"|' \
|
|
|
|
-e 's|version = "[^"]+"|version = "${version}"|'
|
|
|
|
specDir=$(dirname ''${rockspecFilename})
|
|
|
|
cp ''${rockspecFilename} "$specDir/${pname}-${version}.rockspec"
|
|
|
|
rockspecFilename="$specDir/${pname}-${version}.rockspec"
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
cyrussasl = prev.luaLib.overrideLuarocks prev.cyrussasl (drv: {
|
2020-04-24 23:36:52 +00:00
|
|
|
externalDeps = [
|
2022-09-30 11:47:45 +00:00
|
|
|
{ name = "LIBSASL"; dep = cyrus_sasl; }
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
fennel = prev.fennel.overrideAttrs(oa: {
|
|
|
|
nativeBuildInputs = oa.nativeBuildInputs ++ [
|
|
|
|
installShellFiles
|
|
|
|
];
|
|
|
|
postInstall = ''
|
|
|
|
installManPage fennel.1
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
|
|
|
|
http = prev.http.overrideAttrs (oa: {
|
2020-04-24 23:36:52 +00:00
|
|
|
patches = [
|
2022-09-30 11:47:45 +00:00
|
|
|
(fetchpatch {
|
2020-04-24 23:36:52 +00:00
|
|
|
name = "invalid-state-progression.patch";
|
|
|
|
url = "https://github.com/daurnimator/lua-http/commit/cb7b59474a.diff";
|
|
|
|
sha256 = "1vmx039n3nqfx50faqhs3wgiw28ws416rhw6vh6srmh9i826dac7";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
/* TODO: separate docs derivation? (pandoc is heavy)
|
2022-09-30 11:47:45 +00:00
|
|
|
nativeBuildInputs = [ pandoc ];
|
|
|
|
makeFlags = [ "-C doc" "lua-http.html" "lua-http.3" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
*/
|
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
ldbus = prev.luaLib.overrideLuarocks prev.ldbus (drv: {
|
2020-06-18 07:06:33 +00:00
|
|
|
extraVariables = {
|
2022-09-30 11:47:45 +00:00
|
|
|
DBUS_DIR = "${dbus.lib}";
|
|
|
|
DBUS_ARCH_INCDIR = "${dbus.lib}/lib/dbus-1.0/include";
|
|
|
|
DBUS_INCDIR = "${dbus.dev}/include/dbus-1.0";
|
2020-06-18 07:06:33 +00:00
|
|
|
};
|
2022-09-30 11:47:45 +00:00
|
|
|
buildInputs = [
|
2020-06-18 07:06:33 +00:00
|
|
|
dbus
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
ljsyscall = prev.luaLib.overrideLuarocks prev.ljsyscall (drv: rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
version = "unstable-20180515";
|
|
|
|
# package hasn't seen any release for a long time
|
2022-09-30 11:47:45 +00:00
|
|
|
src = fetchFromGitHub {
|
2020-04-24 23:36:52 +00:00
|
|
|
owner = "justincormack";
|
|
|
|
repo = "ljsyscall";
|
|
|
|
rev = "e587f8c55aad3955dddab3a4fa6c1968037b5c6e";
|
|
|
|
sha256 = "06v52agqyziwnbp2my3r7liv245ddmb217zmyqakh0ldjdsr8lz4";
|
|
|
|
};
|
|
|
|
knownRockspec = "rockspec/ljsyscall-scm-1.rockspec";
|
|
|
|
# actually library works fine with lua 5.2
|
|
|
|
preConfigure = ''
|
|
|
|
sed -i 's/lua == 5.1/lua >= 5.1, < 5.3/' ${knownRockspec}
|
|
|
|
'';
|
|
|
|
disabled = luaOlder "5.1" || luaAtLeast "5.3";
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
propagatedBuildInputs = with lib; optional (!isLuaJIT) luaffi;
|
2020-04-24 23:36:52 +00:00
|
|
|
});
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
lgi = prev.lgi.overrideAttrs (oa: {
|
|
|
|
nativeBuildInputs = oa.nativeBuildInputs ++ [
|
2022-09-30 11:47:45 +00:00
|
|
|
pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
buildInputs = [
|
2022-09-30 11:47:45 +00:00
|
|
|
glib
|
|
|
|
gobject-introspection
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
patches = [
|
2022-09-30 11:47:45 +00:00
|
|
|
(fetchpatch {
|
2020-04-24 23:36:52 +00:00
|
|
|
name = "lgi-find-cairo-through-typelib.patch";
|
|
|
|
url = "https://github.com/psychon/lgi/commit/46a163d9925e7877faf8a4f73996a20d7cf9202a.patch";
|
|
|
|
sha256 = "0gfvvbri9kyzhvq3bvdbj2l6mwvlz040dk4mrd5m9gz79f7w109c";
|
|
|
|
})
|
|
|
|
];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
# https://github.com/lgi-devs/lgi/pull/300
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace lgi/Makefile tests/Makefile \
|
|
|
|
--replace 'PKG_CONFIG =' 'PKG_CONFIG ?='
|
|
|
|
'';
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
# there is only a rockspec.in in the repo, the actual rockspec must be generated
|
|
|
|
preConfigure = ''
|
|
|
|
make rock
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
lmathx = prev.luaLib.overrideLuarocks prev.lmathx (drv:
|
2022-05-18 14:49:53 +00:00
|
|
|
if luaAtLeast "5.1" && luaOlder "5.2" then {
|
|
|
|
version = "20120430.51-1";
|
2022-09-30 11:47:45 +00:00
|
|
|
knownRockspec = (fetchurl {
|
|
|
|
url = "https://luarocks.org/lmathx-20120430.51-1.rockspec";
|
2022-05-18 14:49:53 +00:00
|
|
|
sha256 = "148vbv2g3z5si2db7rqg5bdily7m4sjyh9w6r3jnx3csvfaxyhp0";
|
|
|
|
}).outPath;
|
2022-09-30 11:47:45 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://web.tecgraf.puc-rio.br/~lhf/ftp/lua/5.1/lmathx.tar.gz";
|
2022-05-18 14:49:53 +00:00
|
|
|
sha256 = "0sa553d0zlxhvpsmr4r7d841f16yq4wr3fg7i07ibxkz6yzxax51";
|
|
|
|
};
|
|
|
|
} else
|
2022-09-30 11:47:45 +00:00
|
|
|
if luaAtLeast "5.2" && luaOlder "5.3" then {
|
|
|
|
version = "20120430.52-1";
|
|
|
|
knownRockspec = (fetchurl {
|
|
|
|
url = "https://luarocks.org/lmathx-20120430.52-1.rockspec";
|
|
|
|
sha256 = "14rd625sipakm72wg6xqsbbglaxyjba9nsajsfyvhg0sz8qjgdya";
|
|
|
|
}).outPath;
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/5.2/lmathx.tar.gz";
|
|
|
|
sha256 = "19dwa4z266l2njgi6fbq9rak4rmx2fsx1s0p9sl166ar3mnrdwz5";
|
|
|
|
};
|
|
|
|
} else
|
|
|
|
{
|
|
|
|
disabled = luaOlder "5.1" || luaAtLeast "5.5";
|
|
|
|
# works fine with 5.4 as well
|
|
|
|
postConfigure = ''
|
|
|
|
substituteInPlace ''${rockspecFilename} \
|
|
|
|
--replace 'lua ~> 5.3' 'lua >= 5.3, < 5.5'
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
|
|
|
|
lmpfrlib = prev.luaLib.overrideLuarocks prev.lmpfrlib (drv: {
|
2022-05-18 14:49:53 +00:00
|
|
|
externalDeps = [
|
2022-09-30 11:47:45 +00:00
|
|
|
{ name = "GMP"; dep = gmp; }
|
|
|
|
{ name = "MPFR"; dep = mpfr; }
|
2022-05-18 14:49:53 +00:00
|
|
|
];
|
|
|
|
unpackPhase = ''
|
|
|
|
cp $src $(stripHash $src)
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
lrexlib-gnu = prev.luaLib.overrideLuarocks prev.lrexlib-gnu (drv: {
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2022-09-30 11:47:45 +00:00
|
|
|
gnulib
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
lrexlib-pcre = prev.luaLib.overrideLuarocks prev.lrexlib-pcre (drv: {
|
2020-04-24 23:36:52 +00:00
|
|
|
externalDeps = [
|
2022-09-30 11:47:45 +00:00
|
|
|
{ name = "PCRE"; dep = pcre; }
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
lrexlib-posix = prev.luaLib.overrideLuarocks prev.lrexlib-posix (drv: {
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2022-09-30 11:47:45 +00:00
|
|
|
glibc.dev
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
lua-iconv = prev.luaLib.overrideLuarocks prev.lua-iconv (drv: {
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2022-09-30 11:47:45 +00:00
|
|
|
libiconv
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
lua-lsp = prev.lua-lsp.overrideAttrs (oa: {
|
2020-06-18 07:06:33 +00:00
|
|
|
# until Alloyed/lua-lsp#28
|
|
|
|
postConfigure = ''
|
|
|
|
substituteInPlace ''${rockspecFilename} \
|
2022-06-16 17:23:12 +00:00
|
|
|
--replace '"dkjson ~> 2.5",' '"dkjson >= 2.5",'
|
2020-06-18 07:06:33 +00:00
|
|
|
'';
|
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
lua-zlib = prev.luaLib.overrideLuarocks prev.lua-zlib (drv: {
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2022-09-30 11:47:45 +00:00
|
|
|
zlib.dev
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
disabled = luaOlder "5.1" || luaAtLeast "5.4";
|
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
luadbi-mysql = prev.luaLib.overrideLuarocks prev.luadbi-mysql (drv: {
|
2020-04-24 23:36:52 +00:00
|
|
|
extraVariables = {
|
|
|
|
# Can't just be /include and /lib, unfortunately needs the trailing 'mysql'
|
2022-09-30 11:47:45 +00:00
|
|
|
MYSQL_INCDIR = "${libmysqlclient.dev}/include/mysql";
|
|
|
|
MYSQL_LIBDIR = "${libmysqlclient}/lib/mysql";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
buildInputs = [
|
2022-09-30 11:47:45 +00:00
|
|
|
mariadb.client
|
|
|
|
libmysqlclient
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
luadbi-postgresql = prev.luaLib.overrideLuarocks prev.luadbi-postgresql (drv: {
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2022-09-30 11:47:45 +00:00
|
|
|
postgresql
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
luadbi-sqlite3 = prev.luaLib.overrideLuarocks prev.luadbi-sqlite3 (drv: {
|
2020-04-24 23:36:52 +00:00
|
|
|
externalDeps = [
|
2022-09-30 11:47:45 +00:00
|
|
|
{ name = "SQLITE"; dep = sqlite; }
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
luaevent = prev.luaLib.overrideLuarocks prev.luaevent (drv: {
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
luasocket
|
|
|
|
];
|
|
|
|
externalDeps = [
|
2022-09-30 11:47:45 +00:00
|
|
|
{ name = "EVENT"; dep = libevent; }
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
disabled = luaOlder "5.1" || luaAtLeast "5.4";
|
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
luaexpat = prev.luaLib.overrideLuarocks prev.luaexpat (drv: {
|
2020-04-24 23:36:52 +00:00
|
|
|
externalDeps = [
|
2022-09-30 11:47:45 +00:00
|
|
|
{ name = "EXPAT"; dep = expat; }
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
});
|
|
|
|
|
|
|
|
# TODO Somehow automatically amend buildInputs for things that need luaffi
|
|
|
|
# but are in luajitPackages?
|
2022-09-30 11:47:45 +00:00
|
|
|
luaffi = prev.luaLib.overrideLuarocks prev.luaffi (drv: {
|
2020-04-24 23:36:52 +00:00
|
|
|
# The packaged .src.rock version is pretty old, and doesn't work with Lua 5.3
|
2022-09-30 11:47:45 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "facebook";
|
|
|
|
repo = "luaffifb";
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = "532c757e51c86f546a85730b71c9fef15ffa633d";
|
|
|
|
sha256 = "1nwx6sh56zfq99rcs7sph0296jf6a9z72mxknn0ysw9fd7m1r8ig";
|
|
|
|
};
|
2021-10-17 09:34:42 +00:00
|
|
|
knownRockspec = with prev.luaffi; "${pname}-${version}.rockspec";
|
2020-04-24 23:36:52 +00:00
|
|
|
disabled = luaOlder "5.1" || luaAtLeast "5.4" || isLuaJIT;
|
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
luaossl = prev.luaLib.overrideLuarocks prev.luaossl (drv: {
|
2020-04-24 23:36:52 +00:00
|
|
|
externalDeps = [
|
2022-12-02 08:20:57 +00:00
|
|
|
{ name = "CRYPTO"; dep = openssl; }
|
|
|
|
{ name = "OPENSSL"; dep = openssl; }
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
luaposix = prev.luaLib.overrideLuarocks prev.luaposix (drv: {
|
|
|
|
externalDeps = [
|
|
|
|
{ name = "CRYPT"; dep = libxcrypt; }
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
luasec = prev.luaLib.overrideLuarocks prev.luasec (drv: {
|
2020-04-24 23:36:52 +00:00
|
|
|
externalDeps = [
|
2022-12-02 08:20:57 +00:00
|
|
|
{ name = "OPENSSL"; dep = openssl; }
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
luasql-sqlite3 = prev.luaLib.overrideLuarocks prev.luasql-sqlite3 (drv: {
|
2020-04-24 23:36:52 +00:00
|
|
|
externalDeps = [
|
2022-09-30 11:47:45 +00:00
|
|
|
{ name = "SQLITE"; dep = sqlite; }
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
luasystem = prev.luaLib.overrideLuarocks prev.luasystem (drv: lib.optionalAttrs stdenv.isLinux {
|
|
|
|
buildInputs = [ glibc.out ];
|
2022-05-18 14:49:53 +00:00
|
|
|
});
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
luazip = prev.luaLib.overrideLuarocks prev.luazip (drv: {
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2022-09-30 11:47:45 +00:00
|
|
|
zziplib
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
lua-yajl = prev.luaLib.overrideLuarocks prev.lua-yajl (drv: {
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2022-09-30 11:47:45 +00:00
|
|
|
yajl
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
luaunbound = prev.luaLib.overrideLuarocks prev.luaunbound (drv: {
|
2022-04-27 09:35:20 +00:00
|
|
|
externalDeps = [
|
2022-09-30 11:47:45 +00:00
|
|
|
{ name = "libunbound"; dep = unbound; }
|
2022-04-27 09:35:20 +00:00
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
lush-nvim = prev.luaLib.overrideLuarocks prev.lush-nvim (drv: {
|
2022-09-30 11:47:45 +00:00
|
|
|
doCheck = false;
|
|
|
|
});
|
|
|
|
|
|
|
|
luuid = (prev.luaLib.overrideLuarocks prev.luuid (drv: {
|
2020-04-24 23:36:52 +00:00
|
|
|
externalDeps = [
|
2022-09-30 11:47:45 +00:00
|
|
|
{ name = "LIBUUID"; dep = libuuid; }
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
2021-10-17 09:34:42 +00:00
|
|
|
disabled = luaOlder "5.1" || (luaAtLeast "5.4");
|
2022-09-30 11:47:45 +00:00
|
|
|
})).overrideAttrs (oa: {
|
2021-10-17 09:34:42 +00:00
|
|
|
meta = oa.meta // {
|
2022-09-30 11:47:45 +00:00
|
|
|
platforms = lib.platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
# Trivial patch to make it work in both 5.1 and 5.2. Basically just the
|
|
|
|
# tiny diff between the two upstream versions placed behind an #if.
|
|
|
|
# Upstreams:
|
|
|
|
# 5.1: http://webserver2.tecgraf.puc-rio.br/~lhf/ftp/lua/5.1/luuid.tar.gz
|
|
|
|
# 5.2: http://webserver2.tecgraf.puc-rio.br/~lhf/ftp/lua/5.2/luuid.tar.gz
|
|
|
|
patchFlags = [ "-p2" ];
|
|
|
|
patches = [
|
|
|
|
./luuid.patch
|
|
|
|
];
|
2022-12-28 21:21:41 +00:00
|
|
|
postConfigure = ''
|
|
|
|
sed -Ei ''${rockspecFilename} -e 's|lua >= 5.2|lua >= 5.1,|'
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
2022-04-03 18:54:34 +00:00
|
|
|
# as advised in https://github.com/luarocks/luarocks/issues/1402#issuecomment-1080616570
|
|
|
|
# we shouldn't use luarocks machinery to build complex cmake components
|
2022-09-30 11:47:45 +00:00
|
|
|
libluv = stdenv.mkDerivation {
|
2022-04-03 18:54:34 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
pname = "libluv";
|
|
|
|
inherit (prev.luv) version meta src;
|
2022-04-03 18:54:34 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
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
|
|
|
|
'';
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
buildInputs = [ libuv final.lua ];
|
2022-04-03 18:54:34 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
nativeBuildInputs = [ pkg-config cmake ]
|
|
|
|
++ lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ];
|
2022-04-03 18:54:34 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
luv = prev.luaLib.overrideLuarocks prev.luv (drv: {
|
2022-04-03 18:54:34 +00:00
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
buildInputs = [ libuv ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-03 18:54:34 +00:00
|
|
|
# Use system libuv instead of building local and statically linking
|
|
|
|
extraVariables = {
|
|
|
|
"WITH_SHARED_LIBUV" = "ON";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2022-04-03 18:54:34 +00:00
|
|
|
|
|
|
|
# we unset the LUA_PATH since the hook erases the interpreter defaults (To fix)
|
2022-06-16 17:23:12 +00:00
|
|
|
# tests is not run since they are not part of the tarball anymore
|
|
|
|
preCheck = ''
|
2022-04-03 18:54:34 +00:00
|
|
|
unset LUA_PATH
|
|
|
|
rm tests/test-{dns,thread}.lua
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.libluv = final.libluv;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
lyaml = prev.luaLib.overrideLuarocks prev.lyaml (oa: {
|
2020-06-18 07:06:33 +00:00
|
|
|
buildInputs = [
|
2022-09-30 11:47:45 +00:00
|
|
|
libyaml
|
2020-06-18 07:06:33 +00:00
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
mpack = prev.luaLib.overrideLuarocks prev.mpack (drv: {
|
|
|
|
buildInputs = [ libmpack ];
|
2020-05-29 06:06:01 +00:00
|
|
|
# the rockspec doesn't use the makefile so you may need to export more flags
|
|
|
|
USE_SYSTEM_LUA = "yes";
|
|
|
|
USE_SYSTEM_MPACK = "yes";
|
|
|
|
});
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
rapidjson = prev.rapidjson.overrideAttrs (oa: {
|
2020-04-24 23:36:52 +00:00
|
|
|
preBuild = ''
|
|
|
|
sed -i '/set(CMAKE_CXX_FLAGS/d' CMakeLists.txt
|
|
|
|
sed -i '/set(CMAKE_C_FLAGS/d' CMakeLists.txt
|
|
|
|
'';
|
|
|
|
});
|
2020-06-18 07:06:33 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
readline = (prev.luaLib.overrideLuarocks prev.readline (drv: {
|
2020-07-18 16:06:22 +00:00
|
|
|
unpackCmd = ''
|
|
|
|
unzip "$curSrc"
|
|
|
|
tar xf *.tar.gz
|
|
|
|
'';
|
2022-09-30 11:47:45 +00:00
|
|
|
propagatedBuildInputs = prev.readline.propagatedBuildInputs ++ [ readline.out ];
|
2020-07-18 16:06:22 +00:00
|
|
|
extraVariables = rec {
|
2022-09-30 11:47:45 +00:00
|
|
|
READLINE_INCDIR = "${readline.dev}/include";
|
2020-07-18 16:06:22 +00:00
|
|
|
HISTORY_INCDIR = READLINE_INCDIR;
|
|
|
|
};
|
|
|
|
})).overrideAttrs (old: {
|
|
|
|
# Without this, source root is wrongly set to ./readline-2.6/doc
|
|
|
|
setSourceRoot = ''
|
2022-09-30 11:47:45 +00:00
|
|
|
sourceRoot=./readline-${lib.versions.majorMinor old.version}
|
2020-07-18 16:06:22 +00:00
|
|
|
'';
|
|
|
|
});
|
2021-08-10 14:31:46 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
sqlite = prev.luaLib.overrideLuarocks prev.sqlite (drv: {
|
2022-06-26 10:26:21 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
2022-09-30 11:47:45 +00:00
|
|
|
checkInputs = [ final.plenary-nvim neovim-unwrapped ];
|
2022-06-26 10:26:21 +00:00
|
|
|
|
|
|
|
# we override 'luarocks test' because otherwise neovim doesn't find/load the plenary plugin
|
|
|
|
checkPhase = ''
|
2022-11-27 09:42:12 +00:00
|
|
|
export LIBSQLITE="${sqlite.out}/lib/libsqlite3${stdenv.hostPlatform.extensions.sharedLibrary}"
|
2022-06-26 10:26:21 +00:00
|
|
|
export HOME="$TMPDIR";
|
|
|
|
|
|
|
|
nvim --headless -i NONE \
|
2022-09-30 11:47:45 +00:00
|
|
|
-u test/minimal_init.vim --cmd "set rtp+=${vimPlugins.plenary-nvim}" \
|
2022-06-26 10:26:21 +00:00
|
|
|
-c "PlenaryBustedDirectory test/auto/ { minimal_init = './test/minimal_init.vim' }"
|
|
|
|
'';
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
std-_debug = prev.std-_debug.overrideAttrs (oa: {
|
2021-09-18 10:52:07 +00:00
|
|
|
# run make to generate lib/std/_debug/version.lua
|
|
|
|
preConfigure = ''
|
|
|
|
make all
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
std-normalize = prev.std-normalize.overrideAttrs (oa: {
|
2021-09-18 10:52:07 +00:00
|
|
|
# run make to generate lib/std/_debug/version.lua
|
|
|
|
preConfigure = ''
|
|
|
|
make all
|
|
|
|
'';
|
|
|
|
});
|
2022-10-21 18:38:19 +00:00
|
|
|
vusted = prev.vusted.overrideAttrs (_: {
|
|
|
|
# make sure vusted_entry.vim doesn't get wrapped
|
|
|
|
postInstall = ''
|
|
|
|
chmod -x $out/bin/vusted_entry.vim
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
|
2021-08-10 14:31:46 +00:00
|
|
|
|
|
|
|
# aliases
|
2021-10-17 09:34:42 +00:00
|
|
|
cjson = prev.lua-cjson;
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|