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.
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).
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.
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
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
Recently, we made it harder for external code to use some stdenv-only bash
variables by unsetting them in [1] But Lua's `withPackages` was sourcing some
setup hooks in [2], which required those bash variables.
I say great! We caught something bad: Lua should use normal dependencies, even
though that is harder with `buildEnv`. Now it works that way, and everything is
fine.
[1]: 9d3911f806/pkgs/stdenv/generic/setup.sh (L574-L578)
[2]: 9d3911f806/pkgs/development/interpreters/lua-5/wrapper.nix (L23-L27)
CC @matthewbauer
- Lua packages now consistently use LUA_PATH/LUA_CPATH rather than a mix
of those and NIX_LUA_PATH/NIX_LUA_CPATH
- Lua libraries are now consistently only added to the search path
variables if:
1) The library actually has a corresponding directory to search
2) The library is not already present in the search path
This should help prevent the search paths from growing overly large
- Fixed bugs in some path helpers
- Changed the affected shell script indentation to 2 spaces; nixpkgs
shell scripts are inconsistently split between 2 and 4 space
indentation, but 2 matches better with the Nix expressions, so IMO it
makes more sense
There ver very many conflicts, basically all due to
name -> pname+version. Fortunately, almost everything was auto-resolved
by kdiff3, and for now I just fixed up a couple evaluation problems,
as verified by the tarball job. There might be some fallback to these
conflicts, but I believe it should be minimal.
Hydra nixpkgs: ?compare=1538299
`"lua" + lua.luaversion + "-"` resolves to "lua51-" for both Lua
5.1 and LuaJIT packages. With this, LuaJIT packages instead get
`lua.name + "-"`, which currently resolves to "luajit-2.1.0-beta3-".
This makes it easy to distinguish the two in store paths etc.
Summary of main changes:
- Now makes use of luarocks dependency resolution (builds will fail if
rockspec dependencies are unmet)
- Renamed argument `external_deps` -> `exernalDeps` and add
functionality to handle external dependencies that are multiple-output
derivations
- Added an `extraVariables` argument for appending to the contents of
luarocks config `variables` table
- The `rockspecFilename` argument default is now actually used
- The `disabled` argument can now be overriden with a less-restrictive
check, as it now just sets `meta.broken` instead of throwing an error
during eval
- The `doCheck` argument is now actually honored if set to `true`
* lua: generate packages from luarocks
* luarocks-nix: update
* removed packages already available in nixpkgs
* adressing reviews
update script can now accept another csv file as input with -c
* Remove obsolete comment