Commit Graph

174 Commits

Author SHA1 Message Date
Robert Scott
dd107ca580 lua5_4: add patch for CVE-2022-33099 2022-07-23 13:37:52 +01:00
Matthieu Coudron
ce505a3984
vimPlugins: use lua derivation if it exists (#178180)
Neovim plugins are now more often than not written in lua.
One advantage of the lua ecosystem over vim's is the existence of
luarocks and the rockspec format, which allows to specify a package
dependencies formally.
I would like more neovim plugins to have a formal description,
"rockspec" being the current candidate.
This MR allows to use nix lua packages as neovim plugins, so as to enjoy
every benefit that rockspecs bring:
- dependdency discovery
- ability to run test suite
- luarocks versioning
- rockspec metadata

the vim update.py script will check if an attribute with the vim plugin
pname exists in lua51Packages. If it does, it uses
buildNeovimPluginFrom2Nix on it, which modifies the luarocks config to
do an almost flat install (luarocks will install the package in the lua
folder instead of share/5.1/lua etc).
It also calls toVimPlugin on it to get all the vim plugin niceties.

The list of packages that could benefit from this is available at
https://luarocks.org/labels/neovim
but I hope it grows.
2022-06-19 14:18:16 +02:00
github-actions[bot]
b7aba4fb0f
Merge master into staging-next 2022-06-19 00:02:36 +00:00
Matthieu Coudron
011911bc54 luarocks-check-hook: init
The hook is added to buildLuarocksPackage when doCheck is set to true.
2022-06-18 21:23:45 +02:00
Robin Gloster
5a7d0b6b34
lua5_4: fix CVE-2022-28805 2022-05-30 21:04:17 +02:00
Robin Gloster
04d41ba8cc
lua5_2: add patch for CVE-2022-28805
Derived from 1f3c6f4534
2022-05-30 21:04:16 +02:00
Vladimír Čunát
4ddea71bbd
Re-Revert "lua: fix on darwin by using makeBinaryWrapper (#172749)"
This reverts commit 9f4060c552.
After the previous merge commit this should work now.
2022-05-23 10:28:05 +02:00
Vladimír Čunát
9f4060c552
Revert "lua: fix on darwin by using makeBinaryWrapper (#172749)"
This reverts commit 92f4c6ed82.
On aarch64-darwin this completely broke lua instead of improving it;
let's revert at least until that's resolved.
https://github.com/NixOS/nixpkgs/pull/172749#issuecomment-1133759233
2022-05-22 15:45:36 +02:00
Jeremy Wall
92f4c6ed82
lua: fix on darwin by using makeBinaryWrapper (#172749) 2022-05-17 09:45:38 +00:00
Jonathan Ringer
afce445208 lua/setup-hook: remove empty hook 2021-11-08 18:56:18 -08:00
Matthieu Coudron
253af9151f luaPackages: update
- luarocks-nix: bumped to pass args too, `package_X = callPackage ...`.
  It allows to remove the annoying `with self`.
  This new version disables tests (because broken) and now emits derivation
  with a callPackage in front.
- replaced X.override with lib.overrideLuarocks, it should be used
whenever buildInputs/extraVariables is changed since it impacts the
generated luarocks config.
Once structured attributes are in, it will be easier to have the
luarocks config generated by a hook and we probably will be able to
replace all overrideLuarocks by overrideAttrs.
2021-10-18 19:48:07 +02:00
Artturin
1d93a080a6 lua: add conditional to use linux-readline as the plat on 5.4+
since 5.4 linux plat no longer builds with readline support

Closes https://github.com/NixOS/nixpkgs/issues/141701
2021-10-16 20:18:59 +02:00
Matthieu Coudron
abc36451d7 lua: create a folder for hooks
- moved lua hooks to a specific folder as I foresee to add more
- moved generateLuarocksConfig to lib
- fix getLuaPath
- removed the useless rockspecDir
2021-09-27 23:42:54 +02:00
Matthieu Coudron
496b8abf78 Apply suggestions from code review
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2021-09-12 03:03:56 +02:00
Matthieu Coudron
88842910b5 lua: introduced a lua lib
Goal is to improve separation between packages and utilities.
Can help with autocompletion/navigate nixpkgs faster.
Also it will help standardize how LUA_PATH is exported across packages,
so that one can more easily make lua changes across nixpkgs (for
    instance changing where lua modules are installed).
2021-09-12 03:03:56 +02:00
Vladimír Čunát
1c866bd1ae
Merge #135672: LuaJIT: bump, fix issue with pcall 2021-09-05 16:43:30 +02:00
Matthieu Coudron
e62a0eac8f buildLuarocksPackage: cleanup 2021-08-31 22:16:28 +02:00
Matthieu Coudron
a2fd477970 lua: restore knownRockspec and lgi
- fix std._debug build
- fixed std-normalize
- pinned stdlib since the git version  causes issues with awesome

cleanup
2021-08-31 00:42:26 +02:00
Matthieu Coudron
15e5c92495 luaPackages: update 2021-08-31 00:07:28 +02:00
Matthieu Coudron
5b73af6f5b update-luarocks-packages: support in-repo rockspecs
to handle derivations that are not registered or updated on
luarocks.org, for instance neovim plugins.
2021-08-29 19:39:42 +02:00
Luka Blaskovic
d5fe0d2b6e Revert "luajit_openresty: init"
This reverts commit 0b467dfa95.
2021-08-25 10:33:56 +00:00
Gregory Anders
0b467dfa95 luajit_openresty: init 2021-08-19 05:52:24 -06:00
Marco A L Barbosa
0e4c13ba16 lua: remove unecessary postBuild for lua 5.3
I Think this is not necessary anymore since 34f8d7e15a
2021-06-22 11:34:50 -03:00
Marco A L Barbosa
8f8b8d5000 lua: support static only builds 2021-06-22 11:34:33 -03:00
Janne Heß
cf7fde4b02 lua5_4: 5.4.2 -> 5.4.3 2021-05-31 22:22:11 +02:00
Alyssa Ross
665732d877 lua: fix linkage
This fixes a couple of problems:

 * Lua 5.1 doesn't have SYSLIBS, so wasn't being linked with any
   libraries.

 * SYSLIBS doesn't include -lm, so we had to add that manually to
   pkgconfig.  LIBS includes -lm, so we don't need that hack any more.
2021-05-15 09:33:46 -07:00
Alyssa Ross
1758c0ac65 lua5_4: fix eval
This patch was removed in 34f8d7e15a ("lua: one dso patch to rule
them all"), and the reference to it in lua5_4 was removed at the time,
but it seems to have found its way back somehow (probably through a
merge?).

(cherry picked from commit 5b278213a2)
2021-05-15 09:33:46 -07:00
Alyssa Ross
3f5ecec613 Revert "staging-next: lua5: fix eval, add lib.so.patch"
This reverts commit 537a1940e8.

This patch was deliberately removed in 34f8d7e15a ("lua: one dso
patch to rule them all").  The correct fix is to remove the reference
to it that was reintroduced, rather than re-adding the patch.
2021-05-15 09:33:46 -07:00
Alyssa Ross
399223fdf7 Revert "lua5_*: tweak linking libraries"
This reverts commit 539ad4f811.

The correct fix here is to fix our addition to the Makefile.
2021-05-15 09:33:46 -07:00
Vladimír Čunát
539ad4f811
lua5_*: tweak linking libraries
All liblua.so were missing a library or two;
I'm not sure if there's a better way to add them.  Check:
ldd -r ./result/lib/liblua.so
2021-05-15 09:36:05 +02:00
Jonathan Ringer
537a1940e8
staging-next: lua5: fix eval, add lib.so.patch 2021-05-14 23:38:34 -07:00
Jonathan Ringer
0546e68ef7
Merge remote-tracking branch 'origin/master' into staging-next 2021-05-14 21:57:09 -07:00
Konstantin Alekseev
feb867f2fd
lua-5.4: fix build on darwin (#123028) 2021-05-14 16:38:50 -04:00
Vladimír Čunát
55282bd6f6
lua5_1: fixup a recent regression
Commit 57832e625c (PR #119860) switched to using SYSCFLAGS,
but lua 5.1 calls it MYCFLAGS.  We noticed due to broken luarocks build:
https://hydra.nixos.org/build/142663274
2021-05-14 22:08:38 +02:00
Alyssa Ross
25d4f0d334
lua: use stdenv.cc.targetPrefix
This evaluates to an empty string when not cross compiling, so by
using this instead of stdenv.hostPlatform.config we can eliminate a
conditional.
2021-04-19 16:58:32 +00:00
Alyssa Ross
8abdf1db65
lua: don't try to -ldl -lm on non-Linux OSes
On other OSes, like NetBSD, these are part of libc.  Fortunately, the
Lua Makefile already knows about this, and has a SYSLIBS variable we
can use for this.
2021-04-19 16:58:29 +00:00
Alyssa Ross
34f8d7e15a
lua: one dso patch to rule them all
We do this same patch in three different ways for four different Lua
versions, even though the structure of the Makefile barely changes
between releases.  We can easily consolidate this by just modifying
the Makefile ourselves instead of using patches (Makefiles are very
amenable to this).
2021-04-19 16:58:26 +00:00
Alyssa Ross
936b27b5d4
lua: support non-Linux non-Darwin operating systems 2021-04-19 13:05:06 +00:00
Alyssa Ross
57832e625c
lua: don't always set LUA_USE_LINUX
This is supposed to be automatically set by Lua's Makefile if PLAT is
set appropriately, but it was being overridden by us overridding
CFLAGS.  Setting it manually was a hack.  The correct thing to do was
to make sure SYSCFLAGS (where Lua's Makefile puts LUA_USE_LINUX) was
still included in our custom CFLAGS.
2021-04-19 12:57:35 +00:00
sternenseemann
c2a89d5bca development/interpreters/lua-5: remove unused files
These nix expressions from the lua-5 directory are imported nowhere and
can be removed safely.
2021-03-02 15:32:22 +01:00
volth
bc0d605cf1 treewide: fix double quoted strings in meta.description
Signed-off-by: Ben Siraphob <bensiraphob@gmail.com>
2021-01-24 19:56:59 +07:00
jakobrs
460b9f53b2 lua: Add more symlinks to lua.pc
This creates a symlink to lua.pc for every name of the file used by Arch:

For a version of Lua (for example, 5.4) we now have:
- lib/pkgconfig/lua.pc
- lib/pkgconfig/lua-5.4.pc
- lib/pkgconfig/lua5.4.pc
- lib/pkgconfig/lua54.pc
2021-01-24 11:01:04 +01:00
Ben Siraphob
001c0cbe54 pkgs/development/interpreters: stdenv.lib -> lib 2021-01-23 20:29:03 +07:00
Daniel Nagy
9ce1ebb3c2
lua5_3: 5.3.5 -> 5.3.6
We also remove the CVE-2019-6706 patch because it has been merged
upstream. See:

https://www.lua.org/work/diffs-lua-5.3.5-lua-5.3.6.html
2020-12-29 23:28:17 +01:00
Arnout Engelen
d29ab49bb9 lua: add 5.4.2 2020-12-27 16:01:28 +01:00
Michael Reilly
84cf00f980
treewide: Per RFC45, remove all unquoted URLs 2020-04-10 17:54:53 +01:00
Matthieu Coudron
006aeb5704 buidLuarocksPackage: add a checkPhase 2020-02-26 01:14:30 +01:00
Matthieu Coudron
6eeb434b33 buildLuarocksPackage: extraVariables is now an attrset 2020-02-26 01:14:29 +01:00
Matthieu Coudron
7aee5b838b build-lua-package: dont patchShebangs folder
It can be source of trouble for some read-only folders (libluv for
instance) and slow down install.
2020-02-25 17:34:29 +01:00
Chuck
d13360bfb7 lua5: Fix src URLs
The 672c3c1d2a refactor accidentally
dropped the last version component from the source URLs.  This change
puts its back.

$ for lua in lua5_{1,2,3};do nix-instantiate --json --eval . -A $lua.src.urls | jq -r '.[]' | xargs nix-prefetch-url; done

Before this change:

lua-5.1.tar.gz 1hbjhh211p82vhwqhx4mmhmvhv56060acnka80gbmfdk3q3bjnvz (wrong hash because this is lua 5.1.0.  We want 5.1.5 )
lua-5.2.tar.gz HTTP error 404
lua-5.3.tar.gz HTTP error 404

After this change:

lua-5.1.5.tar.gz 0cskd4w0g6rdm2q8q3i4n1h3j8kylhs3rq8mxwl9vwlmlxbgqh16
lua-5.2.4.tar.gz 0jwznq0l8qg9wh5grwg07b5cy3lzngvl5m2nl1ikp6vqssmf9qmr <-- Desired hash
lua-5.3.5.tar.gz 1b2qn2rv96nmbm6zab4l877bd4zq7wpwm8drwjiy2ih4jqzysbhc

Converted to base16 with `nix-hash --type sha256 --to-base16`:

lua-5.1.5.tar.gz 2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333 <-- Desired hash
lua-5.2.4.tar.gz b9e2e4aad6789b3b63a056d442f7b39f0ecfca3ae0f1fc0ae4e9614401b69f4b
lua-5.3.5.tar.gz 0c2eed3f960446e1a3e4b9a1ca2f3ff893b6ce41942cf54d5dd59ab4b3b058ac <-- Desired hash
2020-01-31 18:00:45 -08:00