2019-06-16 20:59:06 +01:00
|
|
|
{ pkgs, ... }:
|
2019-02-04 11:30:58 +00:00
|
|
|
self: super:
|
|
|
|
with super;
|
|
|
|
{
|
|
|
|
##########################################3
|
|
|
|
#### manual fixes for generated packages
|
|
|
|
##########################################3
|
2019-06-13 12:01:10 +01:00
|
|
|
bit32 = super.bit32.override({
|
2019-06-20 14:20:02 +01: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
|
|
|
|
];
|
2019-06-13 12:01:10 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
busted = super.busted.override({
|
|
|
|
postConfigure = ''
|
|
|
|
substituteInPlace ''${rockspecFilename} \
|
|
|
|
--replace "'lua_cliargs = 3.0-1'," "'lua_cliargs >= 3.0-1',"
|
|
|
|
'';
|
|
|
|
postInstall = ''
|
|
|
|
install -D completions/zsh/_busted $out/share/zsh/site-functions/_busted
|
|
|
|
install -D completions/bash/busted.bash $out/share/bash-completion/completions/busted
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
|
|
|
|
cqueues = super.cqueues.override(rec {
|
|
|
|
# Parse out a version number without the Lua version inserted
|
|
|
|
version = with pkgs.lib; let
|
|
|
|
version' = super.cqueues.version;
|
2019-09-24 10:24:13 +01:00
|
|
|
rel = splitVersion version';
|
2019-06-13 12:01:10 +01:00
|
|
|
date = head rel;
|
|
|
|
rev = last (splitString "-" (last rel));
|
|
|
|
in "${date}-${rev}";
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkgs.gnum4
|
|
|
|
];
|
|
|
|
externalDeps = [
|
|
|
|
{ name = "CRYPTO"; dep = pkgs.openssl; }
|
|
|
|
{ name = "OPENSSL"; dep = pkgs.openssl; }
|
|
|
|
];
|
|
|
|
disabled = luaOlder "5.1" || luaAtLeast "5.4";
|
|
|
|
# Upstream rockspec is pointlessly broken into separate rockspecs, per Lua
|
|
|
|
# version, which doesn't work well for us, so modify it
|
|
|
|
postConfigure = let inherit (super.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"
|
|
|
|
'';
|
2019-02-05 15:57:53 +00:00
|
|
|
});
|
2019-02-04 11:30:58 +00:00
|
|
|
|
2019-06-13 12:01:10 +01:00
|
|
|
cyrussasl = super.cyrussasl.override({
|
|
|
|
externalDeps = [
|
|
|
|
{ name = "LIBSASL"; dep = pkgs.cyrus_sasl; }
|
|
|
|
];
|
2019-02-04 11:30:58 +00:00
|
|
|
});
|
|
|
|
|
2019-06-13 12:01:10 +01:00
|
|
|
http = super.http.override({
|
|
|
|
patches = [
|
|
|
|
(pkgs.fetchpatch {
|
|
|
|
name = "invalid-state-progression.patch";
|
|
|
|
url = "https://github.com/daurnimator/lua-http/commit/cb7b59474a.diff";
|
|
|
|
sha256 = "1vmx039n3nqfx50faqhs3wgiw28ws416rhw6vh6srmh9i826dac7";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
/* TODO: separate docs derivation? (pandoc is heavy)
|
|
|
|
nativeBuildInputs = [ pandoc ];
|
|
|
|
makeFlags = [ "-C doc" "lua-http.html" "lua-http.3" ];
|
|
|
|
*/
|
2019-02-04 11:30:58 +00:00
|
|
|
});
|
|
|
|
|
2020-06-15 23:27:16 +01:00
|
|
|
ldbus = super.ldbus.override({
|
|
|
|
extraVariables = {
|
|
|
|
DBUS_DIR="${pkgs.dbus.lib}";
|
|
|
|
DBUS_ARCH_INCDIR="${pkgs.dbus.lib}/lib/dbus-1.0/include";
|
|
|
|
DBUS_INCDIR="${pkgs.dbus.dev}/include/dbus-1.0";
|
|
|
|
};
|
|
|
|
buildInputs = with pkgs; [
|
|
|
|
dbus
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2019-08-24 12:41:55 +01:00
|
|
|
ljsyscall = super.ljsyscall.override(rec {
|
|
|
|
version = "unstable-20180515";
|
|
|
|
# package hasn't seen any release for a long time
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
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";
|
|
|
|
|
|
|
|
propagatedBuildInputs = with pkgs.lib; optional (!isLuaJIT) luaffi;
|
|
|
|
});
|
|
|
|
|
2019-06-13 12:01:10 +01:00
|
|
|
lgi = super.lgi.override({
|
|
|
|
nativeBuildInputs = [
|
2021-01-19 06:50:56 +00:00
|
|
|
pkgs.pkg-config
|
2019-06-13 12:01:10 +01:00
|
|
|
];
|
|
|
|
buildInputs = [
|
|
|
|
pkgs.glib
|
2019-10-31 12:10:55 +00:00
|
|
|
pkgs.gobject-introspection
|
2019-06-13 12:01:10 +01:00
|
|
|
];
|
2021-08-30 20:42:52 +01:00
|
|
|
patches = [
|
|
|
|
(pkgs.fetchpatch {
|
|
|
|
name = "lgi-find-cairo-through-typelib.patch";
|
|
|
|
url = "https://github.com/psychon/lgi/commit/46a163d9925e7877faf8a4f73996a20d7cf9202a.patch";
|
|
|
|
sha256 = "0gfvvbri9kyzhvq3bvdbj2l6mwvlz040dk4mrd5m9gz79f7w109c";
|
|
|
|
})
|
|
|
|
];
|
2021-08-16 16:44:40 +01:00
|
|
|
|
|
|
|
# there is only a rockspec.in in the repo, the actual rockspec must be generated
|
|
|
|
preConfigure = ''
|
|
|
|
make rock
|
|
|
|
'';
|
2019-02-04 11:30:58 +00:00
|
|
|
});
|
2019-06-13 12:01:10 +01:00
|
|
|
|
2019-02-04 11:30:58 +00:00
|
|
|
lrexlib-gnu = super.lrexlib-gnu.override({
|
2019-06-13 12:01:10 +01:00
|
|
|
buildInputs = [
|
|
|
|
pkgs.gnulib
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
|
|
|
lrexlib-pcre = super.lrexlib-pcre.override({
|
|
|
|
externalDeps = [
|
|
|
|
{ name = "PCRE"; dep = pkgs.pcre; }
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
|
|
|
lrexlib-posix = super.lrexlib-posix.override({
|
|
|
|
buildInputs = [
|
|
|
|
pkgs.glibc.dev
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
|
|
|
lua-iconv = super.lua-iconv.override({
|
|
|
|
buildInputs = [
|
|
|
|
pkgs.libiconv
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2020-06-06 12:17:12 +01:00
|
|
|
lua-lsp = super.lua-lsp.override({
|
|
|
|
# until Alloyed/lua-lsp#28
|
|
|
|
postConfigure = ''
|
|
|
|
substituteInPlace ''${rockspecFilename} \
|
|
|
|
--replace '"lpeglabel ~> 1.5",' '"lpeglabel >= 1.5",'
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
|
2019-06-06 04:00:49 +01:00
|
|
|
lua-zlib = super.lua-zlib.override({
|
2019-06-13 12:01:10 +01:00
|
|
|
buildInputs = [
|
|
|
|
pkgs.zlib.dev
|
|
|
|
];
|
|
|
|
disabled = luaOlder "5.1" || luaAtLeast "5.4";
|
2019-06-06 04:00:49 +01:00
|
|
|
});
|
2019-06-13 12:01:10 +01:00
|
|
|
|
|
|
|
luadbi-mysql = super.luadbi-mysql.override({
|
2020-02-26 00:09:31 +00:00
|
|
|
extraVariables = {
|
|
|
|
# Can't just be /include and /lib, unfortunately needs the trailing 'mysql'
|
2020-09-09 21:52:27 +01:00
|
|
|
MYSQL_INCDIR="${pkgs.libmysqlclient.dev}/include/mysql";
|
2020-02-26 00:09:31 +00:00
|
|
|
MYSQL_LIBDIR="${pkgs.libmysqlclient}/lib/mysql";
|
|
|
|
};
|
2019-06-13 12:01:10 +01:00
|
|
|
buildInputs = [
|
2021-06-04 15:08:41 +01:00
|
|
|
pkgs.mariadb.client
|
2019-09-22 08:38:09 +01:00
|
|
|
pkgs.libmysqlclient
|
2019-06-13 12:01:10 +01:00
|
|
|
];
|
2019-02-05 16:29:07 +00:00
|
|
|
});
|
2019-06-13 12:01:10 +01:00
|
|
|
|
|
|
|
luadbi-postgresql = super.luadbi-postgresql.override({
|
|
|
|
buildInputs = [
|
|
|
|
pkgs.postgresql
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
|
|
|
luadbi-sqlite3 = super.luadbi-sqlite3.override({
|
|
|
|
externalDeps = [
|
|
|
|
{ name = "SQLITE"; dep = pkgs.sqlite; }
|
|
|
|
];
|
2019-02-05 16:11:54 +00:00
|
|
|
});
|
2019-06-13 12:01:10 +01:00
|
|
|
|
|
|
|
luaevent = super.luaevent.override({
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
luasocket
|
|
|
|
];
|
|
|
|
externalDeps = [
|
|
|
|
{ name = "EVENT"; dep = pkgs.libevent; }
|
|
|
|
];
|
|
|
|
disabled = luaOlder "5.1" || luaAtLeast "5.4";
|
|
|
|
});
|
|
|
|
|
|
|
|
luaexpat = super.luaexpat.override({
|
|
|
|
externalDeps = [
|
|
|
|
{ name = "EXPAT"; dep = pkgs.expat; }
|
|
|
|
];
|
2020-08-09 08:26:07 +01:00
|
|
|
patches = [
|
|
|
|
./luaexpat.patch
|
|
|
|
];
|
2019-06-13 12:01:10 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
# TODO Somehow automatically amend buildInputs for things that need luaffi
|
|
|
|
# but are in luajitPackages?
|
|
|
|
luaffi = super.luaffi.override({
|
|
|
|
# The packaged .src.rock version is pretty old, and doesn't work with Lua 5.3
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
owner = "facebook"; repo = "luaffifb";
|
|
|
|
rev = "532c757e51c86f546a85730b71c9fef15ffa633d";
|
|
|
|
sha256 = "1nwx6sh56zfq99rcs7sph0296jf6a9z72mxknn0ysw9fd7m1r8ig";
|
|
|
|
};
|
|
|
|
knownRockspec = with super.luaffi; "${pname}-${version}.rockspec";
|
|
|
|
disabled = luaOlder "5.1" || luaAtLeast "5.4" || isLuaJIT;
|
|
|
|
});
|
|
|
|
|
|
|
|
luaossl = super.luaossl.override({
|
|
|
|
externalDeps = [
|
|
|
|
{ name = "CRYPTO"; dep = pkgs.openssl; }
|
|
|
|
{ name = "OPENSSL"; dep = pkgs.openssl; }
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
|
|
|
luasec = super.luasec.override({
|
|
|
|
externalDeps = [
|
|
|
|
{ name = "OPENSSL"; dep = pkgs.openssl; }
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
|
|
|
luasql-sqlite3 = super.luasql-sqlite3.override({
|
|
|
|
externalDeps = [
|
|
|
|
{ name = "SQLITE"; dep = pkgs.sqlite; }
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
|
|
|
luasystem = super.luasystem.override({
|
2019-11-14 05:00:00 +00:00
|
|
|
buildInputs = pkgs.lib.optionals pkgs.stdenv.isLinux [
|
2019-06-13 12:01:10 +01:00
|
|
|
pkgs.glibc
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2019-06-05 05:21:38 +01:00
|
|
|
luazip = super.luazip.override({
|
2019-06-13 12:01:10 +01:00
|
|
|
buildInputs = [
|
|
|
|
pkgs.zziplib
|
|
|
|
];
|
2019-06-05 05:21:38 +01:00
|
|
|
});
|
2019-06-13 12:01:10 +01:00
|
|
|
|
2019-09-05 19:04:27 +01:00
|
|
|
lua-yajl = super.lua-yajl.override({
|
|
|
|
buildInputs = [
|
|
|
|
pkgs.yajl
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2019-06-13 12:01:10 +01:00
|
|
|
luuid = super.luuid.override(old: {
|
|
|
|
externalDeps = [
|
|
|
|
{ name = "LIBUUID"; dep = pkgs.libuuid; }
|
|
|
|
];
|
|
|
|
meta = old.meta // {
|
|
|
|
platforms = pkgs.lib.platforms.linux;
|
|
|
|
};
|
|
|
|
# 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
|
2019-10-27 13:03:25 +00:00
|
|
|
patchFlags = [ "-p2" ];
|
2019-06-13 12:01:10 +01:00
|
|
|
patches = [
|
|
|
|
./luuid.patch
|
|
|
|
];
|
|
|
|
postConfigure = let inherit (super.luuid) version pname; in ''
|
|
|
|
sed -Ei ''${rockspecFilename} -e 's|lua >= 5.2|lua >= 5.1,|'
|
|
|
|
'';
|
|
|
|
disabled = luaOlder "5.1" || (luaAtLeast "5.4");
|
|
|
|
});
|
|
|
|
|
|
|
|
luv = super.luv.override({
|
2019-05-16 17:06:43 +01:00
|
|
|
# Use system libuv instead of building local and statically linking
|
|
|
|
# This is a hacky way to specify -DWITH_SHARED_LIBUV=ON which
|
2019-06-13 12:01:10 +01:00
|
|
|
# is not possible with luarocks and the current luv rockspec
|
2019-05-16 17:06:43 +01:00
|
|
|
# While at it, remove bundled libuv source entirely to be sure.
|
|
|
|
# We may wish to drop bundled lua submodules too...
|
|
|
|
preBuild = ''
|
|
|
|
sed -i 's,\(option(WITH_SHARED_LIBUV.*\)OFF,\1ON,' CMakeLists.txt
|
|
|
|
rm -rf deps/libuv
|
|
|
|
'';
|
2019-10-01 23:08:13 +01:00
|
|
|
|
|
|
|
buildInputs = [ pkgs.libuv ];
|
2019-08-01 12:53:56 +01:00
|
|
|
|
|
|
|
passthru = {
|
2019-10-01 23:08:13 +01:00
|
|
|
libluv = self.luv.override ({
|
2019-08-01 12:53:56 +01:00
|
|
|
preBuild = self.luv.preBuild + ''
|
2019-10-01 23:08:13 +01:00
|
|
|
sed -i 's,\(option(BUILD_MODULE.*\)ON,\1OFF,' CMakeLists.txt
|
|
|
|
sed -i 's,\(option(BUILD_SHARED_LIBS.*\)OFF,\1ON,' CMakeLists.txt
|
2021-09-27 10:10:27 +01:00
|
|
|
sed -i 's,${"\${.*INSTALL_INC_DIR}"},${placeholder "out"}/include/luv,' CMakeLists.txt
|
2019-08-01 12:53:56 +01:00
|
|
|
'';
|
2019-10-01 23:08:13 +01:00
|
|
|
|
|
|
|
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");
|
2019-08-01 12:53:56 +01:00
|
|
|
});
|
|
|
|
};
|
2019-02-17 12:38:23 +00:00
|
|
|
});
|
2019-04-30 09:35:29 +01:00
|
|
|
|
2020-06-06 12:17:12 +01:00
|
|
|
lyaml = super.lyaml.override({
|
|
|
|
buildInputs = [
|
|
|
|
pkgs.libyaml
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
2020-04-26 20:28:40 +01:00
|
|
|
mpack = super.mpack.override({
|
|
|
|
buildInputs = [ pkgs.libmpack ];
|
|
|
|
# the rockspec doesn't use the makefile so you may need to export more flags
|
|
|
|
USE_SYSTEM_LUA = "yes";
|
|
|
|
USE_SYSTEM_MPACK = "yes";
|
|
|
|
});
|
2019-08-01 12:53:56 +01:00
|
|
|
|
2019-06-13 12:01:10 +01:00
|
|
|
rapidjson = super.rapidjson.override({
|
2019-04-30 09:35:29 +01:00
|
|
|
preBuild = ''
|
|
|
|
sed -i '/set(CMAKE_CXX_FLAGS/d' CMakeLists.txt
|
|
|
|
sed -i '/set(CMAKE_C_FLAGS/d' CMakeLists.txt
|
|
|
|
'';
|
|
|
|
});
|
2020-06-06 12:17:12 +01:00
|
|
|
|
2020-07-01 16:58:50 +01:00
|
|
|
readline = (super.readline.override ({
|
|
|
|
unpackCmd = ''
|
|
|
|
unzip "$curSrc"
|
|
|
|
tar xf *.tar.gz
|
|
|
|
'';
|
|
|
|
propagatedBuildInputs = super.readline.propagatedBuildInputs ++ [ pkgs.readline ];
|
|
|
|
extraVariables = rec {
|
|
|
|
READLINE_INCDIR = "${pkgs.readline.dev}/include";
|
|
|
|
HISTORY_INCDIR = READLINE_INCDIR;
|
|
|
|
};
|
|
|
|
})).overrideAttrs (old: {
|
|
|
|
# Without this, source root is wrongly set to ./readline-2.6/doc
|
|
|
|
setSourceRoot = ''
|
2021-08-03 17:55:47 +01:00
|
|
|
sourceRoot=./readline-3.0
|
2020-07-01 16:58:50 +01:00
|
|
|
'';
|
|
|
|
});
|
2021-07-30 01:25:15 +01:00
|
|
|
|
2021-08-30 20:42:52 +01:00
|
|
|
std-_debug = super.std-_debug.overrideAttrs(oa: {
|
|
|
|
# run make to generate lib/std/_debug/version.lua
|
|
|
|
preConfigure = ''
|
|
|
|
make all
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
|
|
|
|
std-normalize = super.std-normalize.overrideAttrs(oa: {
|
|
|
|
# run make to generate lib/std/_debug/version.lua
|
|
|
|
preConfigure = ''
|
|
|
|
make all
|
|
|
|
'';
|
|
|
|
});
|
2021-07-30 01:25:15 +01:00
|
|
|
|
2021-09-11 23:01:49 +01:00
|
|
|
# TODO just while testing, remove afterwards
|
|
|
|
# toVimPlugin should do it instead
|
|
|
|
gitsigns-nvim = super.gitsigns-nvim.overrideAttrs(oa: {
|
|
|
|
nativeBuildInputs = oa.nativeBuildInputs or [] ++ [ pkgs.vimUtils.vimGenDocHook ];
|
|
|
|
});
|
|
|
|
|
2021-07-30 01:25:15 +01:00
|
|
|
# aliases
|
|
|
|
cjson = super.lua-cjson;
|
2019-05-01 08:43:59 +01:00
|
|
|
}
|