Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rockspec modules #547

Merged
merged 1 commit into from
Jan 3, 2023
Merged

Conversation

Aire-One
Copy link
Contributor

Hello 👋

After installing the rock with the command from the wiki https://github.com/lcpz/lain/wiki

luarocks install lcpz/lain

The installation works successfully, but the installed package is broken.

$ lua -lluarocks.loader
Lua 5.4.4  Copyright (C) 1994-2022 Lua.org, PUC-Rio
> lain = require "lain"
/home/aireone/.luarocks/share/lua/5.4/lain/init.lua:12: module 'lain.layout' not found:
        No LuaRocks module found for lain.layout
        no field package.preload['lain.layout']
        no file '/usr/share/lua/5.4/lain/layout.lua'
        no file '/usr/share/lua/5.4/lain/layout/init.lua'
        no file '/usr/lib/lua/5.4/lain/layout.lua'
        no file '/usr/lib/lua/5.4/lain/layout/init.lua'
        no file './lain/layout.lua'
        no file './lain/layout/init.lua'
        no file '/home/aireone/.luarocks/share/lua/5.4/lain/layout.lua'
        no file '/home/aireone/.luarocks/share/lua/5.4/lain/layout/init.lua'
        no file '/usr/lib/lua/5.4/lain/layout.so'
        no file '/usr/lib/lua/5.4/loadall.so'
        no file './lain/layout.so'
        no file '/home/aireone/.luarocks/lib/lua/5.4/lain/layout.so'
        no file '/usr/lib/lua/5.4/lain.so'
        no file '/usr/lib/lua/5.4/loadall.so'
        no file './lain.so'
        no file '/home/aireone/.luarocks/lib/lua/5.4/lain.so'
stack traceback:
        [C]: in function 'require'
        /home/aireone/.luarocks/share/lua/5.4/lain/init.lua:12: in main chunk
        [C]: in function 'require'
        stdin:1: in main chunk
        [C]: in ?

/home/aireone/.luarocks/share/lua/5.4/lain/init.lua:12: module 'lain.layout' not found points to https://github.com/lcpz/lain/blob/master/init.lua#L12

And ls in this directory only outputs the init.lua file (as expected)

$ ls /home/aireone/.luarocks/share/lua/5.4/lain/
init.lua

According to https://github.com/luarocks/luarocks/wiki/Creating-a-rock#building-a-module, the modules = { lain = "init.lua" } configuration tells Luarocks to install only the init.lua file.

This PR fix the modules list and make the rockspec file install all the modules (expect util/dkjson.lua which is installed by the required dependencies).

It can be tested locally with the installation command (Note to anyone wanting to test that without cloning the repo: you can also use an HTTP URL to the file on GitHub):

luarocks --local install lain-scm-1.rockspec

After that, the rock can be loaded successfully from an Awesome WM config.

Here is the output luarocks show lain gives me. As expected, there is now the full list of modules installed.

$ luarocks show lain

lain scm-1 - Layout, widgets and utilities for Awesome WM

Alternative layouts, asynchronous widgets and utility functions for Awesome WM.
Non-Lua dependency: curl (for IMAP, MPD and weather widgets).

License:        GPL2
Homepage:       https://github.com/lcpz/lain
Installed in:   /home/aireone/.luarocks

Modules:
        lain.helpers (/home/aireone/.luarocks/share/lua/5.4/lain/helpers.lua)
        lain.init (/home/aireone/.luarocks/share/lua/5.4/lain/init.lua)
        lain.layout.cascade (/home/aireone/.luarocks/share/lua/5.4/lain/layout/cascade.lua)
        lain.layout.centerwork (/home/aireone/.luarocks/share/lua/5.4/lain/layout/centerwork.lua)
        lain.layout.init (/home/aireone/.luarocks/share/lua/5.4/lain/layout/init.lua)
        lain.layout.termfair (/home/aireone/.luarocks/share/lua/5.4/lain/layout/termfair.lua)
        lain.util.init (/home/aireone/.luarocks/share/lua/5.4/lain/util/init.lua)
        lain.util.markup (/home/aireone/.luarocks/share/lua/5.4/lain/util/markup.lua)
        lain.util.menu_iterator (/home/aireone/.luarocks/share/lua/5.4/lain/util/menu_iterator.lua)
        lain.util.quake (/home/aireone/.luarocks/share/lua/5.4/lain/util/quake.lua)
        lain.util.separators (/home/aireone/.luarocks/share/lua/5.4/lain/util/separators.lua)
        lain.widget.alsa (/home/aireone/.luarocks/share/lua/5.4/lain/widget/alsa.lua)
        lain.widget.alsabar (/home/aireone/.luarocks/share/lua/5.4/lain/widget/alsabar.lua)
        lain.widget.bat (/home/aireone/.luarocks/share/lua/5.4/lain/widget/bat.lua)
        lain.widget.cal (/home/aireone/.luarocks/share/lua/5.4/lain/widget/cal.lua)
        lain.widget.contrib.init (/home/aireone/.luarocks/share/lua/5.4/lain/widget/contrib/init.lua)
        lain.widget.contrib.moc (/home/aireone/.luarocks/share/lua/5.4/lain/widget/contrib/moc.lua)
        lain.widget.contrib.redshift (/home/aireone/.luarocks/share/lua/5.4/lain/widget/contrib/redshift.lua)
        lain.widget.contrib.task (/home/aireone/.luarocks/share/lua/5.4/lain/widget/contrib/task.lua)
        lain.widget.contrib.tp_smapi (/home/aireone/.luarocks/share/lua/5.4/lain/widget/contrib/tp_smapi.lua)
        lain.widget.cpu (/home/aireone/.luarocks/share/lua/5.4/lain/widget/cpu.lua)
        lain.widget.fs (/home/aireone/.luarocks/share/lua/5.4/lain/widget/fs.lua)
        lain.widget.imap (/home/aireone/.luarocks/share/lua/5.4/lain/widget/imap.lua)
        lain.widget.init (/home/aireone/.luarocks/share/lua/5.4/lain/widget/init.lua)
        lain.widget.mem (/home/aireone/.luarocks/share/lua/5.4/lain/widget/mem.lua)
        lain.widget.mpd (/home/aireone/.luarocks/share/lua/5.4/lain/widget/mpd.lua)
        lain.widget.net (/home/aireone/.luarocks/share/lua/5.4/lain/widget/net.lua)
        lain.widget.pulse (/home/aireone/.luarocks/share/lua/5.4/lain/widget/pulse.lua)
        lain.widget.pulsebar (/home/aireone/.luarocks/share/lua/5.4/lain/widget/pulsebar.lua)
        lain.widget.sysload (/home/aireone/.luarocks/share/lua/5.4/lain/widget/sysload.lua)
        lain.widget.temp (/home/aireone/.luarocks/share/lua/5.4/lain/widget/temp.lua)
        lain.widget.weather (/home/aireone/.luarocks/share/lua/5.4/lain/widget/weather.lua)

Depends on:
        lua >= 5.3 (using 5.4-1)
        dkjson >= 2.6-1 (using 2.6-1)

Indirectly pulling:
        dkjson (using 2.6-1)

@Aire-One Aire-One mentioned this pull request Dec 27, 2022
["lain.widget.sysload"] = "widget/sysload.lua",
["lain.widget.temp"] = "widget/temp.lua",
["lain.widget.weather"] = "widget/weather.lua",
},
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the commas at lines 5, 11, 15, 53 and 54 necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, they aren't. I have added them out of habit (or rather, my formatter put them and I kept them).

I have force-pushed to remove them.

@lcpz lcpz merged commit d0b9588 into lcpz:master Jan 3, 2023
lcpz added a commit that referenced this pull request Jan 3, 2023
@Aire-One Aire-One deleted the fix/luarocks-build-modules branch January 3, 2023 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants