Commit Graph

227 Commits

Author SHA1 Message Date
Matthieu Coudron
50e877ed89 buildLuarocksPackage: accept structured luarocks config
There is an arbitrary mapping being done right now between
nixpkgs lua infrastructre and luarocks config schema.
This is confusing if you use lua so let's make it possible to use the
lua names in the nixpkgs, thanks to the lib.generators.toLua convertor.

The only nixpkgs thing to remember should be to put the config into `luarocksConfig`

`buildLuarocksPackage.extraVariables` should become `buildLuarocksPackage.luarocksConfig.variables`
2024-02-17 15:58:13 +01:00
Matthieu Coudron
000b7bfd47
buildLuarocksPackage: ability to self reference extraConfig (#288253)
makes overrideAttrs for lua packages even more powerful.
As a consequence, it simplifies the implementation of buildNeovimPlugin.
2024-02-12 18:11:24 +01:00
Matthieu Coudron
089f45ce69
buildLuarocksPackage: remove rockspecDir (#288036)
it was used only once and complexifies the buildLuarocksPackage function uselessly.
because buildLuarocksPackage accepts ... args, it wont trigger eval failures but this may break out of tree packages where the build can't find the rockspec anymore. Specify the path via `knownRockspec` if that's the case.
2024-02-11 15:09:01 +01:00
Matthieu Coudron
ff5b2d7d00 lua.tests: add test for relative import
better error message as well
extracted from https://github.com/NixOS/nixpkgs/pull/273342

written by heyarne
2024-02-06 23:21:41 +01:00
Jan Tojnar
80020c7db4 Merge branch 'master' into staging-next
; Conflicts:
;	pkgs/development/lua-modules/generated-packages.nix
;	pkgs/development/lua-modules/overrides.nix
2023-12-31 02:31:32 +01:00
Sergei Trofimovich
09a5f17eec lua-wrapper: fix luaPath and luaCpath definitions
Before the change:

    $ nix-instantiate --eval --strict --expr 'with import ./. {}; with corsix-th.luaEnv; [luaPath luaCpath]'
    error:
       error: attribute 'lib' missing

After the change:

    $ nix-instantiate --eval --strict --expr 'with import ./. {}; with corsix-th.luaEnv; [luaPath luaCpath]'
    [ "/nix/store/f17ah5zjri1yjacc1c50g9xlr8qqwbgh-lua-5.2.4-env/share/lua/5.2/?.lua;/nix/store/f17ah5zjri1yjacc1c50g9xlr8qqwbgh-lua-5.2.4-env/share/lua/5.2/?/init.lua" "/nix/store/f17ah5zjri1yjacc1c50g9xlr8qqwbgh-lua-5.2.4-env/lib/lua/5.2/?.so" ]
2023-12-30 22:37:06 +01:00
github-actions[bot]
93bd5ac278
Merge staging-next into staging 2023-12-15 18:01:36 +00:00
Adam Joseph
80472e3754 treewide: add __attrsFailEvaluation and __recurseIntoDerivationForReleaseJobs 2023-12-15 05:13:46 -08:00
Vladimír Čunát
f5eed8de6a
Merge #224295: lua: split manual into separate output
...into staging
2023-12-13 10:41:30 +01:00
Matthieu Coudron
e03c9c3f1b
buildLuarocksPackage: save luarocks config as derivation (#269402)
* buildLuarocksPackage: save luarocks config as derivation

while debugging luarocks packages, it's exhausting to have to build
them, look at what random folder they've been built to finally look for
their config.


With this you can run
    nix build lua51Packages.plenary-nvim.configFile -f . 

and infer what luarocks will do.

* Update pkgs/development/interpreters/lua-5/build-luarocks-package.nix

Co-authored-by: Marc Jakobi <mrcjkb89@outlook.com>

---------

Co-authored-by: Marc Jakobi <mrcjkb89@outlook.com>
2023-11-24 00:08:45 +01:00
Matthieu Coudron
79245fc3e7
lua: use finalAttrs for interpreters (#264381) 2023-11-23 10:19:14 +01:00
Matthieu Coudron
64b50c6f93 luaPackages: introduce an alias mechanism
so that we can deprecate modules
2023-10-14 22:03:12 +02:00
Adam Joseph
cbc8aa437c treewide: use uncurried version of makeScopeWithSplicing 2023-08-14 02:51:10 +03:00
Silvan Mosberger
a0b8caf3bc
Revert "lib.customisation: uncurry makeScopeWithSplicing" 2023-07-28 23:04:09 +02:00
Artturin
3716ef19d8 lib.makeScopeWithSplicing: provide default for keep,extra
These are often unneeded by the user.
2023-07-28 17:41:01 +03:00
Adam Joseph
cb13669b00 lib.customisation: uncurry makeScopeWithSplicing
Deeply-curried functions are pretty error-prone in untyped languages
like Nix.  This is a particularly bad case because
`top-level/splice.nix` *also* declares a makeScopeWithSplicing, but
it takes *two fewer arguments*.

Let's switch to attrset-passing form, to provide some minimal level
of sanity-checking.
2023-07-27 21:31:59 -07:00
Matthieu Coudron
34b3a809ef buildLuarocksPackage: rename file to match its role 2023-07-10 10:34:34 +02:00
Felix Buehler
6672dde558 treewide: use optionalAttrs instead of 'else {}' 2023-06-25 11:01:34 -03:00
Dmitry Bogatov
496a143d84
Update pkgs/development/interpreters/lua-5/interpreter.nix
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2023-06-06 11:27:43 +00:00
Weijia Wang
c5f569a09a lua5_4: 5.4.4 -> 5.4.6 2023-05-26 09:19:41 +03:00
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
Dmitry Bogatov
c0bc18bf2f lua: split manual into separate output
Also, make sure that "doc" outputs of different versions of lua are
co-installable, so user can install multiple manuals and read them
side-by-side.
2023-04-01 20:31:59 -04: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