uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
14
pkgs/development/lua-modules/bit32.patch
Normal file
14
pkgs/development/lua-modules/bit32.patch
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
diff -Naur lua-compat-5.2/c-api/compat-5.2.h lua-compat-5.2-patched/c-api/compat-5.2.h
|
||||
--- lua-compat-5.2/c-api/compat-5.2.h 2015-02-19 09:23:42.000000000 +1100
|
||||
+++ lua-compat-5.2-patched/c-api/compat-5.2.h 2019-06-17 17:58:13.585361793 +1000
|
||||
@@ -146,8 +146,10 @@
|
||||
#define lua_pushglobaltable(L) \
|
||||
lua_pushvalue(L, LUA_GLOBALSINDEX)
|
||||
|
||||
+#if !defined(luaL_newlib)
|
||||
#define luaL_newlib(L, l) \
|
||||
(lua_newtable((L)),luaL_setfuncs((L), (l), 0))
|
||||
+#endif
|
||||
|
||||
void luaL_checkversion (lua_State *L);
|
||||
|
||||
29
pkgs/development/lua-modules/default.nix
Normal file
29
pkgs/development/lua-modules/default.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# inspired by pkgs/development/haskell-modules/default.nix
|
||||
{ pkgs, lib
|
||||
, lua
|
||||
, overrides ? (final: prev: {})
|
||||
}:
|
||||
|
||||
let
|
||||
|
||||
inherit (lib) extends;
|
||||
|
||||
initialPackages = (pkgs.callPackage ../../top-level/lua-packages.nix {
|
||||
inherit lua;
|
||||
});
|
||||
|
||||
overridenPackages = import ./overrides.nix { inherit pkgs; };
|
||||
|
||||
generatedPackages = if (builtins.pathExists ./generated-packages.nix) then
|
||||
(final: prev: pkgs.callPackage ./generated-packages.nix { inherit (final) callPackage; } final prev) else (final: prev: {});
|
||||
|
||||
extensible-self = lib.makeExtensible
|
||||
(extends overrides
|
||||
(extends overridenPackages
|
||||
(extends generatedPackages
|
||||
initialPackages
|
||||
)
|
||||
)
|
||||
);
|
||||
in
|
||||
extensible-self
|
||||
2699
pkgs/development/lua-modules/generated-packages.nix
Normal file
2699
pkgs/development/lua-modules/generated-packages.nix
Normal file
File diff suppressed because it is too large
Load diff
28
pkgs/development/lua-modules/generic/default.nix
Normal file
28
pkgs/development/lua-modules/generic/default.nix
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{ lua, writeText, toLuaModule }:
|
||||
|
||||
{ disabled ? false
|
||||
, propagatedBuildInputs ? [ ]
|
||||
, ...
|
||||
} @ attrs:
|
||||
|
||||
if disabled then
|
||||
throw "${attrs.name} not supported by interpreter lua-${lua.luaversion}"
|
||||
else
|
||||
toLuaModule (lua.stdenv.mkDerivation (
|
||||
{
|
||||
makeFlags = [
|
||||
"PREFIX=$(out)"
|
||||
"LUA_LIBDIR=$(out)/lib/lua/${lua.luaversion}"
|
||||
"LUA_INC=-I${lua}/include"
|
||||
];
|
||||
}
|
||||
//
|
||||
attrs
|
||||
//
|
||||
{
|
||||
name = "lua${lua.luaversion}-" + attrs.pname + "-" + attrs.version;
|
||||
propagatedBuildInputs = propagatedBuildInputs ++ [
|
||||
lua # propagate it for its setup-hook
|
||||
];
|
||||
}
|
||||
))
|
||||
146
pkgs/development/lua-modules/lib.nix
Normal file
146
pkgs/development/lua-modules/lib.nix
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
{ pkgs, lib, lua }:
|
||||
let
|
||||
requiredLuaModules = drvs: with lib; let
|
||||
modules = filter hasLuaModule drvs;
|
||||
in unique ([lua] ++ modules ++ concatLists (catAttrs "requiredLuaModules" modules));
|
||||
# Check whether a derivation provides a lua module.
|
||||
hasLuaModule = drv: drv ? luaModule;
|
||||
|
||||
|
||||
/*
|
||||
Use this to override the arguments passed to buildLuarocksPackage
|
||||
*/
|
||||
overrideLuarocks = drv: f: (drv.override (args: args // {
|
||||
buildLuarocksPackage = drv: (args.buildLuarocksPackage drv).override f;
|
||||
})) // {
|
||||
overrideScope = scope: overrideLuarocks (drv.overrideScope scope) f;
|
||||
};
|
||||
|
||||
in
|
||||
rec {
|
||||
inherit overrideLuarocks;
|
||||
inherit hasLuaModule requiredLuaModules;
|
||||
|
||||
luaPathList = [
|
||||
"share/lua/${lua.luaversion}/?.lua"
|
||||
"share/lua/${lua.luaversion}/?/init.lua"
|
||||
];
|
||||
luaCPathList = [
|
||||
"lib/lua/${lua.luaversion}/?.so"
|
||||
];
|
||||
|
||||
/* generate paths without a prefix
|
||||
*/
|
||||
luaPathRelStr = lib.concatStringsSep ";" luaPathList;
|
||||
luaCPathRelStr = lib.concatStringsSep ";" luaCPathList;
|
||||
|
||||
/* generate LUA_(C)PATH value for a specific derivation, i.e., with absolute paths
|
||||
*/
|
||||
genLuaPathAbsStr = drv: lib.concatMapStringsSep ";" (x: "${drv}/${x}") luaPathList;
|
||||
genLuaCPathAbsStr = drv: lib.concatMapStringsSep ";" (x: "${drv}/${x}") luaCPathList;
|
||||
|
||||
/* Generate a LUA_PATH with absolute paths
|
||||
*/
|
||||
# genLuaPathAbs = drv:
|
||||
# lib.concatStringsSep ";" (map (x: "${drv}/x") luaPathList);
|
||||
|
||||
luaAtLeast = lib.versionAtLeast lua.luaversion;
|
||||
luaOlder = lib.versionOlder lua.luaversion;
|
||||
isLua51 = (lib.versions.majorMinor lua.version) == "5.1";
|
||||
isLua52 = (lib.versions.majorMinor lua.version) == "5.2";
|
||||
isLua53 = lua.luaversion == "5.3";
|
||||
isLuaJIT = lib.getName lua == "luajit";
|
||||
|
||||
/* generates the relative path towards the folder where
|
||||
seems stable even when using lua_modules_path = ""
|
||||
|
||||
Example:
|
||||
getDataFolder luaPackages.stdlib
|
||||
=> stdlib-41.2.2-1-rocks/stdlib/41.2.2-1/doc
|
||||
*/
|
||||
getDataFolder = drv:
|
||||
"${drv.pname}-${drv.version}-rocks/${drv.pname}/${drv.version}";
|
||||
|
||||
/* Convert derivation to a lua module.
|
||||
so that luaRequireModules can be run later
|
||||
*/
|
||||
toLuaModule = drv:
|
||||
drv.overrideAttrs( oldAttrs: {
|
||||
# Use passthru in order to prevent rebuilds when possible.
|
||||
passthru = (oldAttrs.passthru or {}) // {
|
||||
luaModule = lua;
|
||||
requiredLuaModules = requiredLuaModules drv.propagatedBuildInputs;
|
||||
};
|
||||
});
|
||||
|
||||
/* generate luarocks config
|
||||
|
||||
generateLuarocksConfig {
|
||||
externalDeps = [ { name = "CRYPTO"; dep = pkgs.openssl; } ];
|
||||
rocksSubdir = "subdir";
|
||||
};
|
||||
*/
|
||||
generateLuarocksConfig = {
|
||||
externalDeps
|
||||
|
||||
# a list of lua derivations
|
||||
, requiredLuaRocks
|
||||
, extraVariables ? {}
|
||||
, rocksSubdir
|
||||
}: let
|
||||
rocksTrees = lib.imap0
|
||||
(i: dep: "{ name = [[dep-${toString i}]], root = '${dep}', rocks_dir = '${dep}/${dep.rocksSubdir}' }")
|
||||
requiredLuaRocks;
|
||||
|
||||
# Explicitly point luarocks to the relevant locations for multiple-output
|
||||
# derivations that are external dependencies, to work around an issue it has
|
||||
# (https://github.com/luarocks/luarocks/issues/766)
|
||||
depVariables = lib.concatMap ({name, dep}: [
|
||||
"${name}_INCDIR='${lib.getDev dep}/include';"
|
||||
"${name}_LIBDIR='${lib.getLib dep}/lib';"
|
||||
"${name}_BINDIR='${lib.getBin dep}/bin';"
|
||||
]) externalDeps';
|
||||
|
||||
# example externalDeps': [ { name = "CRYPTO"; dep = pkgs.openssl; } ]
|
||||
externalDeps' = lib.filter (dep: !lib.isDerivation dep) externalDeps;
|
||||
|
||||
externalDepsDirs = map
|
||||
(x: "'${builtins.toString x}'")
|
||||
(lib.filter (lib.isDerivation) externalDeps);
|
||||
|
||||
extraVariablesStr = lib.concatStringsSep "\n "
|
||||
(lib.mapAttrsToList (k: v: "${k}='${v}';") extraVariables);
|
||||
in ''
|
||||
local_cache = ""
|
||||
-- To prevent collisions when creating environments, we install the rock
|
||||
-- files into per-package subdirectories
|
||||
rocks_subdir = '${rocksSubdir}'
|
||||
-- first tree is the default target where new rocks are installed,
|
||||
-- any other trees in the list are treated as additional sources of installed rocks for matching dependencies.
|
||||
rocks_trees = {
|
||||
{name = "current", root = '${placeholder "out"}', rocks_dir = "current" },
|
||||
${lib.concatStringsSep "\n, " rocksTrees}
|
||||
}
|
||||
'' + lib.optionalString lua.pkgs.isLuaJIT ''
|
||||
-- Luajit provides some additional functionality built-in; this exposes
|
||||
-- that to luarock's dependency system
|
||||
rocks_provided = {
|
||||
jit='${lua.luaversion}-1';
|
||||
ffi='${lua.luaversion}-1';
|
||||
luaffi='${lua.luaversion}-1';
|
||||
bit='${lua.luaversion}-1';
|
||||
}
|
||||
'' + ''
|
||||
-- For single-output external dependencies
|
||||
external_deps_dirs = {
|
||||
${lib.concatStringsSep "\n, " externalDepsDirs}
|
||||
}
|
||||
variables = {
|
||||
-- Some needed machinery to handle multiple-output external dependencies,
|
||||
-- as per https://github.com/luarocks/luarocks/issues/766
|
||||
${lib.optionalString (lib.length depVariables > 0) ''
|
||||
${lib.concatStringsSep "\n " depVariables}''}
|
||||
${extraVariablesStr}
|
||||
}
|
||||
'';
|
||||
}
|
||||
16
pkgs/development/lua-modules/luuid.patch
Normal file
16
pkgs/development/lua-modules/luuid.patch
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
diff -Naur 5.2/uuid/luuid.c rock/uuid/luuid.c
|
||||
--- 5.2/uuid/luuid.c 2012-05-10 11:22:00.000000000 +1000
|
||||
+++ rock/uuid/luuid.c 2019-06-13 15:13:10.374134079 +1000
|
||||
@@ -64,7 +64,11 @@
|
||||
|
||||
LUALIB_API int luaopen_uuid(lua_State *L)
|
||||
{
|
||||
- luaL_newlib(L,R);
|
||||
+ #if LUA_VERSION_NUM == 501
|
||||
+ luaL_register(L,MYNAME,R);
|
||||
+ #else
|
||||
+ luaL_newlib(L,R);
|
||||
+ #endif
|
||||
lua_pushliteral(L,"version"); /** version */
|
||||
lua_pushliteral(L,MYVERSION);
|
||||
lua_settable(L,-3);
|
||||
430
pkgs/development/lua-modules/overrides.nix
Normal file
430
pkgs/development/lua-modules/overrides.nix
Normal file
|
|
@ -0,0 +1,430 @@
|
|||
{ pkgs }:
|
||||
final: prev:
|
||||
with prev;
|
||||
{
|
||||
##########################################3
|
||||
#### manual fixes for generated packages
|
||||
##########################################3
|
||||
bit32 = prev.bit32.overrideAttrs(oa: {
|
||||
# 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
|
||||
];
|
||||
});
|
||||
|
||||
busted = prev.busted.overrideAttrs(oa: {
|
||||
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 = (prev.lib.overrideLuarocks prev.cqueues (drv: {
|
||||
nativeBuildInputs = [
|
||||
pkgs.gnum4
|
||||
];
|
||||
externalDeps = [
|
||||
{ name = "CRYPTO"; dep = pkgs.openssl; }
|
||||
{ name = "OPENSSL"; dep = pkgs.openssl; }
|
||||
];
|
||||
disabled = luaOlder "5.1" || luaAtLeast "5.4";
|
||||
})).overrideAttrs(oa: rec {
|
||||
# Parse out a version number without the Lua version inserted
|
||||
version = with pkgs.lib; let
|
||||
version' = prev.cqueues.version;
|
||||
rel = splitVersion version';
|
||||
date = head rel;
|
||||
rev = last (splitString "-" (last rel));
|
||||
in "${date}-${rev}";
|
||||
# Upstream rockspec is pointlessly broken into separate rockspecs, per Lua
|
||||
# version, which doesn't work well for us, so modify it
|
||||
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"
|
||||
'';
|
||||
});
|
||||
|
||||
cyrussasl = prev.lib.overrideLuarocks prev.cyrussasl (drv: {
|
||||
externalDeps = [
|
||||
{ name = "LIBSASL"; dep = pkgs.cyrus_sasl; }
|
||||
];
|
||||
});
|
||||
|
||||
http = prev.http.overrideAttrs(oa: {
|
||||
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" ];
|
||||
*/
|
||||
});
|
||||
|
||||
ldbus = prev.lib.overrideLuarocks prev.ldbus (drv: {
|
||||
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
|
||||
];
|
||||
});
|
||||
|
||||
ljsyscall = prev.lib.overrideLuarocks prev.ljsyscall (drv: 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;
|
||||
});
|
||||
|
||||
lgi = prev.lib.overrideLuarocks prev.lgi (drv: {
|
||||
nativeBuildInputs = [
|
||||
pkgs.pkg-config
|
||||
];
|
||||
buildInputs = [
|
||||
pkgs.glib
|
||||
pkgs.gobject-introspection
|
||||
];
|
||||
patches = [
|
||||
(pkgs.fetchpatch {
|
||||
name = "lgi-find-cairo-through-typelib.patch";
|
||||
url = "https://github.com/psychon/lgi/commit/46a163d9925e7877faf8a4f73996a20d7cf9202a.patch";
|
||||
sha256 = "0gfvvbri9kyzhvq3bvdbj2l6mwvlz040dk4mrd5m9gz79f7w109c";
|
||||
})
|
||||
];
|
||||
|
||||
# there is only a rockspec.in in the repo, the actual rockspec must be generated
|
||||
preConfigure = ''
|
||||
make rock
|
||||
'';
|
||||
});
|
||||
|
||||
lmathx = prev.lib.overrideLuarocks prev.lmathx (drv:
|
||||
if luaAtLeast "5.1" && luaOlder "5.2" then {
|
||||
version = "20120430.51-1";
|
||||
knownRockspec = (pkgs.fetchurl {
|
||||
url = "https://luarocks.org/lmathx-20120430.51-1.rockspec";
|
||||
sha256 = "148vbv2g3z5si2db7rqg5bdily7m4sjyh9w6r3jnx3csvfaxyhp0";
|
||||
}).outPath;
|
||||
src = pkgs.fetchurl {
|
||||
url = "https://web.tecgraf.puc-rio.br/~lhf/ftp/lua/5.1/lmathx.tar.gz";
|
||||
sha256 = "0sa553d0zlxhvpsmr4r7d841f16yq4wr3fg7i07ibxkz6yzxax51";
|
||||
};
|
||||
} else
|
||||
if luaAtLeast "5.2" && luaOlder "5.3" then {
|
||||
version = "20120430.52-1";
|
||||
knownRockspec = (pkgs.fetchurl {
|
||||
url = "https://luarocks.org/lmathx-20120430.52-1.rockspec";
|
||||
sha256 = "14rd625sipakm72wg6xqsbbglaxyjba9nsajsfyvhg0sz8qjgdya";
|
||||
}).outPath;
|
||||
src = pkgs.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.lib.overrideLuarocks prev.lmpfrlib (drv: {
|
||||
externalDeps = [
|
||||
{ name = "GMP"; dep = pkgs.gmp; }
|
||||
{ name = "MPFR"; dep = pkgs.mpfr; }
|
||||
];
|
||||
unpackPhase = ''
|
||||
cp $src $(stripHash $src)
|
||||
'';
|
||||
});
|
||||
|
||||
lrexlib-gnu = prev.lib.overrideLuarocks prev.lrexlib-gnu (drv: {
|
||||
buildInputs = [
|
||||
pkgs.gnulib
|
||||
];
|
||||
});
|
||||
|
||||
lrexlib-pcre = prev.lib.overrideLuarocks prev.lrexlib-pcre (drv: {
|
||||
externalDeps = [
|
||||
{ name = "PCRE"; dep = pkgs.pcre; }
|
||||
];
|
||||
});
|
||||
|
||||
lrexlib-posix = prev.lib.overrideLuarocks prev.lrexlib-posix (drv: {
|
||||
buildInputs = [
|
||||
pkgs.glibc.dev
|
||||
];
|
||||
});
|
||||
|
||||
lua-iconv = prev.lib.overrideLuarocks prev.lua-iconv (drv: {
|
||||
buildInputs = [
|
||||
pkgs.libiconv
|
||||
];
|
||||
});
|
||||
|
||||
lua-lsp = prev.lua-lsp.overrideAttrs(oa: {
|
||||
# until Alloyed/lua-lsp#28
|
||||
postConfigure = ''
|
||||
substituteInPlace ''${rockspecFilename} \
|
||||
--replace '"lpeglabel ~> 1.5",' '"lpeglabel >= 1.5",'
|
||||
'';
|
||||
});
|
||||
|
||||
lua-zlib = prev.lib.overrideLuarocks prev.lua-zlib (drv: {
|
||||
buildInputs = [
|
||||
pkgs.zlib.dev
|
||||
];
|
||||
disabled = luaOlder "5.1" || luaAtLeast "5.4";
|
||||
});
|
||||
|
||||
luadbi-mysql = prev.lib.overrideLuarocks prev.luadbi-mysql (drv: {
|
||||
extraVariables = {
|
||||
# Can't just be /include and /lib, unfortunately needs the trailing 'mysql'
|
||||
MYSQL_INCDIR="${pkgs.libmysqlclient.dev}/include/mysql";
|
||||
MYSQL_LIBDIR="${pkgs.libmysqlclient}/lib/mysql";
|
||||
};
|
||||
buildInputs = [
|
||||
pkgs.mariadb.client
|
||||
pkgs.libmysqlclient
|
||||
];
|
||||
});
|
||||
|
||||
luadbi-postgresql = prev.lib.overrideLuarocks prev.luadbi-postgresql (drv: {
|
||||
buildInputs = [
|
||||
pkgs.postgresql
|
||||
];
|
||||
});
|
||||
|
||||
luadbi-sqlite3 = prev.lib.overrideLuarocks prev.luadbi-sqlite3 (drv: {
|
||||
externalDeps = [
|
||||
{ name = "SQLITE"; dep = pkgs.sqlite; }
|
||||
];
|
||||
});
|
||||
|
||||
luaevent = prev.lib.overrideLuarocks prev.luaevent (drv: {
|
||||
propagatedBuildInputs = [
|
||||
luasocket
|
||||
];
|
||||
externalDeps = [
|
||||
{ name = "EVENT"; dep = pkgs.libevent; }
|
||||
];
|
||||
disabled = luaOlder "5.1" || luaAtLeast "5.4";
|
||||
});
|
||||
|
||||
luaexpat = prev.lib.overrideLuarocks prev.luaexpat (drv: {
|
||||
externalDeps = [
|
||||
{ name = "EXPAT"; dep = pkgs.expat; }
|
||||
];
|
||||
});
|
||||
|
||||
# TODO Somehow automatically amend buildInputs for things that need luaffi
|
||||
# but are in luajitPackages?
|
||||
luaffi = prev.lib.overrideLuarocks prev.luaffi (drv: {
|
||||
# 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 prev.luaffi; "${pname}-${version}.rockspec";
|
||||
disabled = luaOlder "5.1" || luaAtLeast "5.4" || isLuaJIT;
|
||||
});
|
||||
|
||||
luaossl = prev.lib.overrideLuarocks prev.luaossl (drv: {
|
||||
externalDeps = [
|
||||
{ name = "CRYPTO"; dep = pkgs.openssl; }
|
||||
{ name = "OPENSSL"; dep = pkgs.openssl; }
|
||||
];
|
||||
});
|
||||
|
||||
luasec = prev.lib.overrideLuarocks prev.luasec (drv: {
|
||||
externalDeps = [
|
||||
{ name = "OPENSSL"; dep = pkgs.openssl; }
|
||||
];
|
||||
});
|
||||
|
||||
luasql-sqlite3 = prev.lib.overrideLuarocks prev.luasql-sqlite3 (drv: {
|
||||
externalDeps = [
|
||||
{ name = "SQLITE"; dep = pkgs.sqlite; }
|
||||
];
|
||||
});
|
||||
|
||||
luasystem = prev.lib.overrideLuarocks prev.luasystem (drv: pkgs.lib.optionalAttrs pkgs.stdenv.isLinux {
|
||||
buildInputs = [ pkgs.glibc.out ];
|
||||
});
|
||||
|
||||
luazip = prev.lib.overrideLuarocks prev.luazip (drv: {
|
||||
buildInputs = [
|
||||
pkgs.zziplib
|
||||
];
|
||||
});
|
||||
|
||||
lua-yajl = prev.lib.overrideLuarocks prev.lua-yajl (drv: {
|
||||
buildInputs = [
|
||||
pkgs.yajl
|
||||
];
|
||||
});
|
||||
|
||||
luaunbound = prev.lib.overrideLuarocks prev.luaunbound(drv: {
|
||||
externalDeps = [
|
||||
{ name = "libunbound"; dep = pkgs.unbound; }
|
||||
];
|
||||
});
|
||||
|
||||
luuid = (prev.lib.overrideLuarocks prev.luuid (drv: {
|
||||
externalDeps = [
|
||||
{ name = "LIBUUID"; dep = pkgs.libuuid; }
|
||||
];
|
||||
disabled = luaOlder "5.1" || (luaAtLeast "5.4");
|
||||
})).overrideAttrs(oa: {
|
||||
meta = oa.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
|
||||
patchFlags = [ "-p2" ];
|
||||
patches = [
|
||||
./luuid.patch
|
||||
];
|
||||
postConfigure = let inherit (prev.luuid) version pname; in ''
|
||||
sed -Ei ''${rockspecFilename} -e 's|lua >= 5.2|lua >= 5.1,|'
|
||||
'';
|
||||
});
|
||||
|
||||
|
||||
# as advised in https://github.com/luarocks/luarocks/issues/1402#issuecomment-1080616570
|
||||
# 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.cmake ]
|
||||
++ pkgs.lib.optionals pkgs.stdenv.isDarwin [ pkgs.fixDarwinDylibNames ];
|
||||
};
|
||||
|
||||
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
|
||||
extraVariables = {
|
||||
"WITH_SHARED_LIBUV" = "ON";
|
||||
};
|
||||
|
||||
# we unset the LUA_PATH since the hook erases the interpreter defaults (To fix)
|
||||
installCheckPhase = ''
|
||||
unset LUA_PATH
|
||||
rm tests/test-{dns,thread}.lua
|
||||
lua tests/run.lua
|
||||
'';
|
||||
|
||||
passthru.libluv = final.libluv;
|
||||
|
||||
});
|
||||
|
||||
lyaml = prev.lib.overrideLuarocks prev.lyaml (oa: {
|
||||
buildInputs = [
|
||||
pkgs.libyaml
|
||||
];
|
||||
});
|
||||
|
||||
mpack = prev.lib.overrideLuarocks prev.mpack (drv: {
|
||||
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";
|
||||
});
|
||||
|
||||
rapidjson = prev.rapidjson.overrideAttrs(oa: {
|
||||
preBuild = ''
|
||||
sed -i '/set(CMAKE_CXX_FLAGS/d' CMakeLists.txt
|
||||
sed -i '/set(CMAKE_C_FLAGS/d' CMakeLists.txt
|
||||
'';
|
||||
});
|
||||
|
||||
readline = (prev.lib.overrideLuarocks prev.readline (drv: {
|
||||
unpackCmd = ''
|
||||
unzip "$curSrc"
|
||||
tar xf *.tar.gz
|
||||
'';
|
||||
propagatedBuildInputs = prev.readline.propagatedBuildInputs ++ [ pkgs.readline.out ];
|
||||
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 = ''
|
||||
sourceRoot=./readline-3.0
|
||||
'';
|
||||
});
|
||||
|
||||
std-_debug = prev.std-_debug.overrideAttrs(oa: {
|
||||
# run make to generate lib/std/_debug/version.lua
|
||||
preConfigure = ''
|
||||
make all
|
||||
'';
|
||||
});
|
||||
|
||||
std-normalize = prev.std-normalize.overrideAttrs(oa: {
|
||||
# run make to generate lib/std/_debug/version.lua
|
||||
preConfigure = ''
|
||||
make all
|
||||
'';
|
||||
});
|
||||
|
||||
# TODO just while testing, remove afterwards
|
||||
# toVimPlugin should do it instead
|
||||
gitsigns-nvim = prev.gitsigns-nvim.overrideAttrs(oa: {
|
||||
nativeBuildInputs = oa.nativeBuildInputs or [] ++ [ pkgs.vimUtils.vimGenDocHook ];
|
||||
});
|
||||
|
||||
# aliases
|
||||
cjson = prev.lua-cjson;
|
||||
}
|
||||
23
pkgs/development/lua-modules/zip.patch
Normal file
23
pkgs/development/lua-modules/zip.patch
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
--- a/Makefile 2007-10-30 01:59:10.000000000 +0300
|
||||
+++ b/Makefile 2014-09-18 11:04:53.176320021 +0400
|
||||
@@ -6,10 +6,6 @@
|
||||
|
||||
include $(CONFIG)
|
||||
|
||||
-ifeq "$(LUA_VERSION_NUM)" "500"
|
||||
-COMPAT_O= $(COMPAT_DIR)/compat-5.1.o
|
||||
-endif
|
||||
-
|
||||
SRCS= src/lua$T.c
|
||||
OBJS= src/lua$T.o $(COMPAT_O)
|
||||
|
||||
@@ -19,9 +15,6 @@
|
||||
src/$(LIBNAME): $(OBJS)
|
||||
export MACOSX_DEPLOYMENT_TARGET="10.3"; $(CC) $(CFLAGS) $(LIB_OPTION) -o src/$(LIBNAME) $(OBJS) -lzzip
|
||||
|
||||
-$(COMPAT_DIR)/compat-5.1.o: $(COMPAT_DIR)/compat-5.1.c
|
||||
- $(CC) -c $(CFLAGS) -o $@ $(COMPAT_DIR)/compat-5.1.c
|
||||
-
|
||||
install: src/$(LIBNAME)
|
||||
mkdir -p $(LUA_LIBDIR)
|
||||
cp src/$(LIBNAME) $(LUA_LIBDIR)
|
||||
Loading…
Add table
Add a link
Reference in a new issue