lite icon indicating copy to clipboard operation
lite copied to clipboard

Add Makefile, update build instructions

Open deric opened this issue 4 years ago • 4 comments

I've added a simple Makefile but I'm struggling a bit project structure. E.g. when installing to /usr/local Lua files could be placed in /usr/local/share/lua/5.2/core.lua. It would be nicer to put also package name on path, so that Lite's files won't collide with some other Lua package, e.g. /usr/local/share/lua/5.2/lite/core.lua

Error: [string "local core..."]:8: module 'core' not found:
        no field package.preload['core']
        no file '/usr/local/bin/data/core/init.lua'
        no file '/usr/local/bin/data/core.lua'
        no file '/usr/local/share/lua/5.2/core.lua'
        no file '/usr/local/share/lua/5.2/core/init.lua'
        no file '/usr/local/lib/lua/5.2/core.lua'
        no file '/usr/local/lib/lua/5.2/core/init.lua'
        no file './core.lua'
        no file '/usr/local/lib/lua/5.2/core.so'
        no file '/usr/local/lib/lua/5.2/loadall.so'
        no file './core.so'

Also, fonts are currently hard-coded relatively to executable:

data/plugins/scale.lua:19:font_cache[style.code_font] = { EXEDIR .. "/data/fonts/monospace.ttf", 13.5 * SCALE }

but this would be for another PR. Is it ok to modify this path?

A Linux program structure might look like

/usr/local/bin/lite
/usr/local/share/lua/5.2/lite/core/...
/usr/local/share/lua/5.2/lite/fonts/...
/var/lib/lite/plugins/
/var/lib/lite/user/
~/.local/lite/plugins/
~/.local/lite/user/

Currently all files needs to be placed relatively to e.g. /usr/local/bin/lite file, in /usr/local/bin/lite/data/ directory which isn't nice.

deric avatar Feb 19 '21 18:02 deric

Hey, I am getting the error you included at the beginning of you post. How can I resolve this?

andrew-manger avatar Mar 13 '21 01:03 andrew-manger

@andrew-manger As the message say, lua files aren't on any of searched location. You've probably moved the main binary lite out out project's main directory.

deric avatar Mar 13 '21 07:03 deric

I didn't move anything. I built the program and then copied 'lite' to /bin/bash/ and it gave me this error. I'm trying to figure out how to fix it, not what I did wrong.

andrew-manger avatar Mar 13 '21 23:03 andrew-manger

That's pretty much the same, you can create a symlink to your build directory:

ln -s /home/yourdir/src/lite /usr/local/bin/lite

deric avatar Mar 15 '21 08:03 deric