Commit Graph

9 Commits

Author SHA1 Message Date
Matthieu C.
6427d04c23 lua:: reworked setup-hook to source utils.sh
which contains lua shell utilities that can be reused during the
creation of an environment.
Makes sense because the generation of LUA_PATH is a bit different than
other ecosystems.
2024-05-01 00:18:44 +02:00
Matthieu C.
a4d954080f lua: fixed the way to create environments
`paths =  requiredLuaModules (extraLibs ++ [ lua ] );` would discard lua
and so in absence of a propagated lua, the lua.withPackages would return
an empty bin/ directory.
2024-05-01 00:11:49 +02:00
Vladimír Čunát
3bcf0470d8
Revert #303176: "buildLuarocksPackage: rework fixup phase"
This reverts commit ddefcf284c.
Breakages need figuring out, reverting for now:
https://github.com/NixOS/nixpkgs/pull/303176#issuecomment-2053910614
2024-04-15 07:17:32 +02:00
Matthieu Coudron
ddefcf284c buildLuarocksPackage: rework fixup phase
I was working on lua tests, enabling nlua and I started overriding
postFixup, which removed the default phase for build-luarocks-package so
instead let's make it a proper phase.
2024-04-11 00:30:31 +02:00
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
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
34b3a809ef buildLuarocksPackage: rename file to match its role 2023-07-10 10:34:34 +02:00