rxi / lite

A lightweight text editor written in Lua
MIT License
7.34k stars 350 forks source link

Centos Installation #168

Open njohnjoel opened 4 years ago

njohnjoel commented 4 years ago

Hi Team , Do you have instructions to install lite on centos ?

SwissalpS commented 4 years ago

Install gcc, lua and SDL2 development libraries. then in terminal clone the repo

git clone https://github.com/rxi/lite.git
cd lite
./build.sh

If there were no errors you can move lite to somewhere on path or make a symlink to it. If there were errors, resolve the missing dependencies and build again.

njohnjoel commented 3 years ago

[joelj@global lite]$ ./build.sh compiling (unix)... In file included from src/api/renderer.c:2:0: src/renderer.h:4:22: fatal error: SDL2/SDL.h: No such file or directory

include <SDL2/SDL.h>

                  ^

compilation terminated. In file included from src/api/renderer_font.c:2:0: src/renderer.h:4:22: fatal error: SDL2/SDL.h: No such file or directory

include <SDL2/SDL.h>

                  ^

compilation terminated. src/api/system.c:1:22: fatal error: SDL2/SDL.h: No such file or directory

include <SDL2/SDL.h>

                  ^

compilation terminated. In file included from src/lib/stb/stb_truetype.c:2:0: src/lib/stb/stb_truetype.h: In function ‘stbtt_GetGlyphSDF’: src/lib/stb/stb_truetype.h:4517:54: warning: ‘((void )&res+8)’ may be used uninitialized in this function [-Wmaybe-uninitialized] px = ititx0 + 2titx1 + tt*x2; ^ src/main.c:2:22: fatal error: SDL2/SDL.h: No such file or directory

include <SDL2/SDL.h>

                  ^

compilation terminated. In file included from src/rencache.h:5:0, from src/rencache.c:2: src/renderer.h:4:22: fatal error: SDL2/SDL.h: No such file or directory

include <SDL2/SDL.h>

                  ^

compilation terminated. In file included from src/renderer.c:6:0: src/renderer.h:4:22: fatal error: SDL2/SDL.h: No such file or directory

include <SDL2/SDL.h>

                  ^

compilation terminated. cleaning up... done [joelj@global lite]$

SwissalpS commented 3 years ago

Either you have not installed SDL2 or it is not on include path. Maybe you have SDL2 installed but not the dev-package?

njohnjoel commented 3 years ago

How can I fix this ?

SwissalpS commented 3 years ago

have you tried yum install SDL2-devel as root?

Edit: similar to what I had:

njohnjoel commented 3 years ago

[root@global ~]# yum install SDL2-devel Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile

Install completed .

======================================== Now I get the following error

[joelj@global lite]$ ./build.sh compiling (unix)... In file included from src/lib/stb/stb_truetype.c:2:0: src/lib/stb/stb_truetype.h: In function ‘stbtt_GetGlyphSDF’: src/lib/stb/stb_truetype.h:4517:54: warning: ‘((void )&res+8)’ may be used uninitialized in this function [-Wmaybe-uninitialized] px = ititx0 + 2titx1 + tt*x2; ^ linking... cleaning up... done [joelj@global lite]$

SwissalpS commented 3 years ago

cool, just a warning, if used correctly, should not matter. The compiled binary is running, right?

njohnjoel commented 3 years ago

Its not launching the application after the error , I had restarted the machine to try it

SwissalpS commented 3 years ago

no need to reboot What did you do to try and launch it?

njohnjoel commented 3 years ago

The application is not launching ... I just ran the build.sh

SwissalpS commented 3 years ago

so you did not do: ./lite at all?

SwissalpS commented 3 years ago

the build script builds the binary called 'lite'. It needs to be launched after build is complete :D

njohnjoel commented 3 years ago

cool that worked

SwissalpS commented 3 years ago

If you like launching lite with GUI, you can make a lite.desktop file, something like this. Where to put the .desktop file depends on variables I don't know the values to, so try: ~/.local/share/applications/lite.desktop I'm assuming you use gnome.

jelizarovas commented 3 years ago

trying to install it on my chromeboox, compiles fine, but when i run ./lite i get

root@penguin:/home/jelizarovas/lite-1.11# ./lite
No protocol specified
error: XDG_RUNTIME_DIR not set in the environment.
No protocol specified
error: XDG_RUNTIME_DIR not set in the environment.
lite: src/renderer.c:60: ren_init: Assertion `win' failed.
Aborted (core dumped)
jelizarovas commented 3 years ago

well... i just had to exit root and it launched