Re: Bug#818900: [Lua Policy] integrate debian's lua modules into Debian's Luarocks
On Mon, Mar 21, 2016 at 03:06:28PM +, Bas Wijnen wrote: > On Mon, Mar 21, 2016 at 02:37:44PM +, lumin wrote: > > When I'm dealing with one of my ITP's I found that this is > > a noticeable problem to Debian's lua packages. And I think > > this may require some changes to our lua policy, or the dh-lua > > scripts. > > What you describe should be fixed. There is a problem with how your scripts > work, though: if some packages are installed before luarocks, they will not be > indexed. Not unless luarocks scans for installed packages on installation > anyway. If it can do that, it might make more sense to just trigger that > procedure when a new lua module is installed as well. > > Making that part of dh-lua seems like the way to go. Undoubtedly. Each lua package could ship a luarocks manifest, something like /usr/lib/luarocks/5.1/rocks/lua-cjson/2.1.0-1/manifest Such manifest could be generated by some code pretty close to postinst script attached to the bugreport, but at package build time (by dh-lua) and not at package installation time. Lumin, if you have time, please try to patch dh-lua. You could look for the code that generates .pc files, and start from that. Otherwise I'll do it myself, but I'm a bit busy these days. Best, -- Enrico Tassi
Re: Bug#818900: [Lua Policy] integrate debian's lua modules into Debian's Luarocks
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, Mar 21, 2016 at 02:37:44PM +, lumin wrote: > When I'm dealing with one of my ITP's I found that this is > a noticeable problem to Debian's lua packages. And I think > this may require some changes to our lua policy, or the dh-lua > scripts. What you describe should be fixed. There is a problem with how your scripts work, though: if some packages are installed before luarocks, they will not be indexed. Not unless luarocks scans for installed packages on installation anyway. If it can do that, it might make more sense to just trigger that procedure when a new lua module is installed as well. Making that part of dh-lua seems like the way to go. Thanks, Bas -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQIcBAEBAgAGBQJW8A3zAAoJEJzRfVgHwHE6Qu8QAIglXrTQ5g3fuMIfAMoUz+Z/ qmtOu18LBZ+c20D1GgXRSz5AC+v9/9qLrEwYxM5smmOOaW7nEtNDfBOBY2Zme4Mm NcTe1kqzaR/QOQ6zCRANzTD5ZcLsk88DSRxXby0cOBBXrPr+QtDruDESre3Wmu67 BW24kAD79kAp+W/gLxN2IIvRPMkOWF2/Q8ElxujD6Hm1qLanpkIvkJwqoQmrRnrL eN/EG+LbOOwoJ+sXeH/SXE/Cox6XrECahb2PQQPlxRN3KElMnu+JspV76eOAF53r sn7hsPl7TfNHHC63ciWOiMv5JfXGGikl3/UMfJSCiqQB29iE3H7/xLkK/euEI0wL cVUEMeVC6AsgldAGlufiqIgQgXK4pcms+sOt6/AlnwkWL6JtoQuf3cp0dCFtGMtu 0AUcre3I/9DG7lrkHFcI1GITt//kXsDajodhqIfgzK+rfmctfNb79fe3Indb/1OI t0u7AompBTqTA+adojbjvRgj2XXmcgk/hcUGzTlD6Rfwkbv3dHE4EicUOdM/XL2g jhSbNmrfnpAWg9Mf5rcGyB9uFjiKIz2pcI7zfl/B9B12zWsgpt4qq8l0Ktl0apcs OwlQ6Ocp5m/N7vq3x2Ml7i2Rbo6JsinVeQJ9Q4zA+1V0uozR5s2yMYbL92X8AcWp YDmDAUpOfKl91w6h17+F =GHup -END PGP SIGNATURE-
Bug#818900: [Lua Policy] integrate debian's lua modules into Debian's Luarocks
Package: lua5.1-policy Version: 33 Severity: wishlist X-Debbugs-CC: debian-devel@lists.debian.org, h...@hisham.hm Hi, (Talking about policy, hence CC'ing -devel) (CC'ing luarocks upstream) When I'm dealing with one of my ITP's I found that this is a noticeable problem to Debian's lua packages. And I think this may require some changes to our lua policy, or the dh-lua scripts. Luarocks is a lua module manager, just like pip to python. However Debian's luarocks is blind to Debian's lua modules, i.e. `luarocks list` won't list lua modules installed by dpkg, besides, lua modules installed by dpkg won't participate lua module dependency resolution, that's bad. When pulling new lua modules from the internet with `luarocks`, it will scan lua module dependency and automatically pull missing modules and install them. For example, I need to install a lua module that is not packaged by us, say lua-xxx, and it depends on lua-cjson. Then `luarocks install xxx` will cause luarocks to install a new lua-cjson module, ignoring the lua-cjson package installed by dpkg. Why do we provide lua-cjson package? *** What to do to make improvement? *** IMHO following changes should be considered: 1. update default configuration file of luarocks /etc/luarocks/config-5.1.lua ```patch rocks_trees = { home..[[/.luarocks]], [[/usr/local]], +[[/usr]], } + deps_mode = 'all' ``` 2. let luarocks package install this directory /usr/lib/luarocks/rocks/ 3. update lua-* packages with luarocks integration, e.g. update their postinst and prerm scripts. To this point I have a solution that works but is not good enough: (patch parts copied from my locally modified lua-cjson package) ```patch --- /dev/null +++ b/debian/lua-cjson.postinst @@ -0,0 +1,31 @@ +#!/bin/sh +set -e + +prepare_luarocks () +{ + local rockdir + rockdir='/usr/lib/luarocks/rocks/lua-cjson/2.1.0-1/' + mkdir -p $rockdir + echo 'rock_manifest = {}' > $rockdir/rock_manifest + cp /usr/share/doc/lua-cjson/lua-cjson-2.1.0-1.rockspec $rockdir + if [ -x /usr/bin/luarocks-admin ]; then +luarocks-admin make-manifest --local-tree --tree=/usr + fi +} [...] ``` and this one ```patch --- /dev/null +++ b/debian/lua-cjson.prerm @@ -0,0 +1,27 @@ +#!/bin/sh +set -e + +remove_luarocks () +{ + if [ -x /usr/bin/luarocks ]; then + luarocks remove lua-cjson --local-tree --tree=/usr + fi +} + ``` Thanks! :-) -- .''`. : :' : `. `' `-