Commit graph

206 commits

Author SHA1 Message Date
Adam Joseph d128d47318 buildLuaPackage: fix cross
buildLuaPackage accesses lua.pkgs.luarocks, which became unspliced
at some point.  Let's use callPackage to get it, so we can be sure
it will be spliced.
2023-05-09 14:15:07 -07:00
Sandro cac19e0266
trivial-builders: move into the directory named alike (#223429)
While searching for something different I wondered why there is a
trivial-builders.nix file next to the trivial-builders directory where
only tests live. Lets fix that.
2023-05-06 00:16:26 +02:00
Matthieu Coudron 26dd4a84ed buildLuarocksPackage: fixes attributes being ignored
follow up of https://github.com/NixOS/nixpkgs/pull/224553 where
some arguments got ignored whil they were before taken into account.
2023-04-27 22:22:01 +02:00
Matthieu Coudron 30a70671f4 buildLuaPackage: enable __structuredAttrs rocks
it makes overriding easier, instead of having to know internals to
decide which of `sqlite = prev.luaLib.overrideLuarocks prev.sqlite (drv: {` or
`sqlite = prev.sqlite.overrideAttrs (drv: {` just use the latter
2023-04-22 22:09:35 +02:00
Anderson Torres ae21df36c5 build-lua-package.nix: change self to finalAttrs 2023-04-20 22:22:23 -03:00
Vladimír Čunát 8bb1d31ab5
Merge #223349: lua*Packages: fix the default namePrefix
...into staging
2023-03-29 08:09:34 +02:00
Florian Klink 9218f1a00c Revert "buildLuaPackage: throw instead of marking as broken package"
This reverts commit 0cd595cdb3.

It's causing build failures for knot-resolver and others.

Workaround for https://github.com/NixOS/nixpkgs/issues/223437
2023-03-27 22:12:59 +02:00
Vladimír Čunát a77bce6c1a
lua*Packages: fix the default namePrefix as intended 2023-03-27 09:05:25 +02:00
Matthieu Coudron 0cd595cdb3 buildLuaPackage: throw instead of marking as broken package
hopefully makes the output of nixpkgs-review more sensible.

Lua package sets are different and it makes more sense than for other
languages for packages to not be supported in specific package sets.
2023-03-26 01:45:24 +01:00
LeixB 59a4dd8678
lua-rocks-move-data: fix missing doc tags on luaPackages neovim plugins
fixes #220199

This makes `luarocksMoveDataHook` run before `vimPluginGenTags` since it
is added first to `preFixupHooks`.
2023-03-10 13:12:32 +01:00
Luna Nova 02fa99fd08 lua_5_3_compat, lua_5_4_compat: set LUA_COMPAT_5_x as LUA_COMPAT_ALL was removed
Fixes NixOS#218227
2023-02-28 01:56:06 +01:00
Artturin 4e3dcf364e treewide: makeSetupHook deps -> propagatedBuildInputs 2023-02-07 21:02:00 +02:00
Artturin 9a9c42e19f makeSetupHook: support depsTargetTargetPropagated 2023-02-07 21:00:18 +02:00
Guillaume Girol 90c78aee6c Merge branch 'nativeCheckInputs' into staging-nativeCheckInputs 2023-01-21 12:00:00 +00:00
Guillaume Girol b7042dc36a buildLuaPackage: adapt to native check inputs 2023-01-21 16:42:10 +01:00
Alyssa Ross 0ae87d514f treewide: add names to all setup hooks 2023-01-19 15:00:36 +00:00
Artturi f56de234bb
Merge pull request #207652 from Artturin/splicenixfmt 2023-01-07 17:42:25 +02:00
Sandro Jäckel 56acc4566e
luajit_openresty: init at 2.1-20220915 2022-12-26 02:57:06 +01:00
Sandro f4c3e67d80
Merge pull request #206807 from SuperSandro2000/lua-sourceVersion 2022-12-25 21:42:47 +01:00
Artturin 58fa78077c treewide: use splicing convenience functions 2022-12-25 14:05:03 +02:00
Sandro Jäckel b374880027
interpreters/lua: replace sourceVersion with lib.versions 2022-12-22 05:14:31 +01:00
figsoda ec8cb34358 treewide: fix typos 2022-12-17 19:39:44 -05:00
Daniel Nagy cfce957d4f
treewide: more meta changelog urls and mainPrograms (#200062)
* turbovnc: add changelog url

* memray: add changelog url

* ddcutil: add changelog url

* jc: add changelog url

* zed: add changelog url

* lua: use https homepage

* sil: use https url

* the-powder-toy: use https homepage

* tldr: add changelog url

* openjpeg: add changelog url

* scheme48: use https homepage

* bubblewrap: set meta.mainProgram

* zbar: set meta.mainProgram

* qpdf: add changelog url

* nvtop: set meta.mainProgram

* squashfs: add meta.mainProgram
2022-11-09 16:41:13 +01:00
github-actions[bot] 182a2100db
Merge master into staging-next 2022-10-14 00:04:53 +00:00
Matthieu Coudron c4b5c2574b lua: test the interpreter
Test with:
nix-build -A lua.tests pass

Tests are very limited for now, goal is mostly to put the infra into
place and enrich the tests when dealing with lua issues.
add luaPath/luaCpath as passthrough
makes it easier to generate LUA_PATH/LUA_CPATH
2022-10-14 00:10:40 +02:00
Matthieu Coudron 2acce7dfdc vimPlugins: make usage of luaPackages less confusing
right now the src is ignored in:

```
  lush-nvim = buildNeovimPlugin {
    pname = "lush.nvim";
    version = "2022-08-09";
    src = fetchFromGitHub {
      owner = "rktjmp";
      repo = "lush.nvim";
      rev = "6b9f399245de7bea8dac2c3bf91096ffdedfcbb7";
      sha256 = "0rb77rwmbm438bmbjfk5hwrrcn5sihsa1413bdpc27rw3rrn8v8z";
    };
    meta.homepage = "https://github.com/rktjmp/lush.nvim/";
  };
```

which is very confusing. With this PR, we correctly override the src and
the version of the package. We introduce a rockspecVersion attribute of
lua package to be able to still find the rockspec when the
"version" field needs to be different than "rockspecVersion".
2022-10-13 19:57:35 +02:00
Vladimír Čunát 00a757ed3f
Merge branch 'master' into staging 2022-10-13 08:27:55 +02:00
Yorick van Pelt 5af1ad13f6
lua: 5.4.3 -> 5.4.4
CVE-2021-44647, CVE-2021-44964, CVE-2021-43519
2022-10-11 12:25:51 +02:00
Stéphan Kochen 2623fc4a78 lua: add back Darwin makeBinaryWrapper fix 2022-10-09 12:15:14 +02:00
Artturin 39571bd6fa luaPackages: copy passthruFun from python 2022-08-26 20:55:30 +03:00
Artturin a13d387089 build-lua-package: remove unnecessary adding of buildInputs to nativeBuildInputs
and move externalDeps' back to buildInputs

both accidentally caused in  https://github.com/NixOS/nixpkgs/pull/178158/files
2022-08-26 20:55:30 +03:00
Artturin ec35f6341b lua-packages: try splicing 2022-08-26 20:04:02 +03:00
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