3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #171975 from alexshpilkin/add-lua-maths

This commit is contained in:
Matthieu Coudron 2022-05-09 10:58:30 +02:00 committed by GitHub
commit 135e27c148
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 95 additions and 0 deletions

View file

@ -22,6 +22,8 @@ ldoc,https://github.com/stevedonovan/LDoc.git,,,,,
lgi,,,,,,
linenoise,https://github.com/hoelzro/lua-linenoise.git,,,,,
ljsyscall,,,,,lua5_1,lblasc
lmathx,,,,,lua5_3,alexshpilkin
lmpfrlib,,,,,lua5_3,alexshpilkin
lpeg,,,,,,vyp
lpeg_patterns,,,,,,
lpeglabel,,,,,,

1 name src ref server version luaversion maintainers
22 lgi
23 linenoise https://github.com/hoelzro/lua-linenoise.git
24 ljsyscall lua5_1 lblasc
25 lmathx lua5_3 alexshpilkin
26 lmpfrlib lua5_3 alexshpilkin
27 lpeg vyp
28 lpeg_patterns
29 lpeglabel

View file

@ -659,6 +659,57 @@ buildLuarocksPackage {
};
}) {};
lmathx = callPackage({ buildLuarocksPackage, luaOlder, luaAtLeast
, fetchurl, lua
}:
buildLuarocksPackage {
pname = "lmathx";
version = "20150624-1";
knownRockspec = (fetchurl {
url = "https://luarocks.org/lmathx-20150624-1.rockspec";
sha256 = "181wzsj1mxjyia43y8zwaydxahnl7a70qzcgc8jhhgic7jyi9pgv";
}).outPath;
src = fetchurl {
url = "http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/5.3/lmathx.tar.gz";
sha256 = "1r0ax3lq4xx6469aqc6qlfl3jynlghzhl5j65mpdj0kyzv4nknzf";
};
propagatedBuildInputs = [ lua ];
meta = {
homepage = "http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#lmathx";
description = "C99 extensions for the math library";
maintainers = with lib.maintainers; [ alexshpilkin ];
license.fullName = "Public domain";
};
}) {};
lmpfrlib = callPackage({ buildLuarocksPackage, luaOlder, luaAtLeast
, fetchurl, lua
}:
buildLuarocksPackage {
pname = "lmpfrlib";
version = "20170112-2";
knownRockspec = (fetchurl {
url = "https://luarocks.org/lmpfrlib-20170112-2.rockspec";
sha256 = "1x7qiwmk5b9fi87fn7yvivdsis8h9fk9r3ipqiry5ahx72vzdm7d";
}).outPath;
src = fetchurl {
url = "http://www.circuitwizard.de/lmpfrlib/lmpfrlib.c";
sha256 = "00d32cwvk298k3vyrjkdmfjgc69x1fwyks3hs7dqr2514zdhgssm";
};
disabled = with lua; (luaOlder "5.3") || (luaAtLeast "5.5");
propagatedBuildInputs = [ lua ];
meta = {
homepage = "http://www.circuitwizard.de/lmpfrlib/lmpfrlib.html";
description = "Lua API for the GNU MPFR library";
maintainers = with lib.maintainers; [ alexshpilkin ];
license.fullName = "LGPL";
};
}) {};
lpeg = callPackage({ buildLuarocksPackage, luaOlder, luaAtLeast
, fetchurl, lua
}:

View file

@ -129,6 +129,48 @@ with prev;
'';
});
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