ravachol / kew

A terminal music player for Linux.
GNU General Public License v2.0
971 stars 26 forks source link

I can't get it to build on VoidLinux Musl. Could you make a binary release? If possible using Musl? #71

Closed xplshn closed 11 months ago

xplshn commented 11 months ago

Musl can be installed on Debian, Ubuntu, Arch and other systems. The only problem is that kew depends on bits/sigaction.h which is a part of libc6, and that cannot be installed on Musl systems.

ravachol commented 11 months ago

It turns out bits/sigaction.h wasn't really needed. I don't think. Please grab the latest (not the tagged release) and let me know how it went.

xplshn commented 11 months ago

Here's the logs, compiling with clang:

clang -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include-static -c -o src/obj/mpris.o src/mpris.c
clang -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include-static -c -o src/obj/playerops.o src/playerops.c
src/playerops.c:464:17: warning: expression result unused [-Wunused-value]
                currentSong;
                ^~~~~~~~~~~
1 warning generated.
clang -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include-static -c -o src/obj/volume.o src/volume.c
clang -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include-static -c -o src/obj/cutils.o src/cutils.c
clang -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include-static -c -o src/obj/soundgapless.o src/soundgapless.c
src/soundgapless.c:405:14: warning: address of 'device' will always evaluate to 'true' [-Wpointer-bool-conversion]
        if (&device)
        ~~   ^~~~~~
1 warning generated.
clang -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include-static -c -o src/obj/songloader.o src/songloader.c
clang -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include-static -c -o src/obj/file.o src/file.c
clang -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include-static -c -o src/obj/chafafunc.o src/chafafunc.c
clang -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include-static -c -o src/obj/cache.o src/cache.c
clang -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include-static -c -o src/obj/metadata.o src/metadata.c
clang -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include-static -c -o src/obj/playlist.o src/playlist.c
clang -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include-static -c -o src/obj/stringfunc.o src/stringfunc.c
clang -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include-static -c -o src/obj/term.o src/term.c
clang -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include-static -c -o src/obj/settings.o src/settings.c
clang -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include-static -c -o src/obj/player.o src/player.c
src/player.c:178:84: warning: expression result unused [-Wunused-value]
                displayCover(songdata, preferredWidth, preferredHeight, coverAnsi) - 1;
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~
1 warning generated.
clang -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include-static -c -o src/obj/albumart.o src/albumart.c
clang -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include-static -c -o src/obj/visuals.o src/visuals.c
clang -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include-static -c -o src/obj/kew.o src/kew.c
src/kew.c:402:49: warning: address of array 'songData->metadata->title' will always evaluate to 'true' [-Wpointer-bool-conversion]
                            songData->metadata->title ? songData->metadata->title : "",
                            ~~~~~~~~~~~~~~~~~~~~^~~~~ ~
src/kew.c:403:49: warning: address of array 'songData->metadata->artist' will always evaluate to 'true' [-Wpointer-bool-conversion]
                            songData->metadata->artist ? songData->metadata->artist : "",
                            ~~~~~~~~~~~~~~~~~~~~^~~~~~ ~
src/kew.c:404:49: warning: address of array 'songData->metadata->album' will always evaluate to 'true' [-Wpointer-bool-conversion]
                            songData->metadata->album ? songData->metadata->album : "",
                            ~~~~~~~~~~~~~~~~~~~~^~~~~ ~
src/kew.c:405:39: warning: address of array 'songData->coverArtPath' will always evaluate to 'true' [-Wpointer-bool-conversion]
                            songData->coverArtPath ? songData->coverArtPath : "",
                            ~~~~~~~~~~^~~~~~~~~~~~ ~
src/kew.c:697:16: error: cannot assign to variable 'stderr' with const-qualified type 'FILE *const' (aka 'struct _IO_FILE *const')
        stderr = fdopen(STDERR_FILENO, "w");
        ~~~~~~ ^
/usr/include/stdio.h:64:20: note: variable 'stderr' declared const here
extern FILE *const stderr;
~~~~~~~~~~~~~~~~~~~^~~~~~
4 warnings and 1 error generated.
make: *** [Makefile:17: src/obj/kew.o] Error 1

Now with GCC:

[anto@beef kew]$ make clean
rm -rf src/obj kew
[anto@beef kew]$ make
mkdir -p src/obj
x86_64-linux-musl-gcc -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -static -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -c -o src/obj/write_ascii.o include/imgtotxt/write_ascii.c
x86_64-linux-musl-gcc -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -static -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -c -o src/obj/mpris.o src/mpris.c
x86_64-linux-musl-gcc -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -static -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -c -o src/obj/playerops.o src/playerops.c
x86_64-linux-musl-gcc -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -static -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -c -o src/obj/volume.o src/volume.c
x86_64-linux-musl-gcc -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -static -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -c -o src/obj/cutils.o src/cutils.c
x86_64-linux-musl-gcc -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -static -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -c -o src/obj/soundgapless.o src/soundgapless.c
x86_64-linux-musl-gcc -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -static -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -c -o src/obj/songloader.o src/songloader.c
x86_64-linux-musl-gcc -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -static -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -c -o src/obj/file.o src/file.c
x86_64-linux-musl-gcc -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -static -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -c -o src/obj/chafafunc.o src/chafafunc.c
x86_64-linux-musl-gcc -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -static -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -c -o src/obj/cache.o src/cache.c
x86_64-linux-musl-gcc -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -static -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -c -o src/obj/metadata.o src/metadata.c
x86_64-linux-musl-gcc -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -static -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -c -o src/obj/playlist.o src/playlist.c
x86_64-linux-musl-gcc -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -static -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -c -o src/obj/stringfunc.o src/stringfunc.c
x86_64-linux-musl-gcc -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -static -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -c -o src/obj/term.o src/term.c
x86_64-linux-musl-gcc -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -static -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -c -o src/obj/settings.o src/settings.c
x86_64-linux-musl-gcc -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -static -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -c -o src/obj/player.o src/player.c
x86_64-linux-musl-gcc -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -static -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -c -o src/obj/albumart.o src/albumart.c
x86_64-linux-musl-gcc -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -static -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -c -o src/obj/visuals.o src/visuals.c
x86_64-linux-musl-gcc -I/usr/include/stb -Iinclude/imgtotxt/ext -Iinclude/imgtotxt -I/usr/include/ffmpeg -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libavformat -Iinclude/miniaudio -O3 -g -static -pthread -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/chafa -I/usr/lib64/chafa/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -c -o src/obj/kew.o src/kew.c
src/kew.c: In function 'cleanupOnExit':
src/kew.c:697:16: error: assignment of read-only variable 'stderr'
  697 |         stderr = fdopen(STDERR_FILENO, "w");
      |                ^
make: *** [Makefile:17: src/obj/kew.o] Error 1
xplshn commented 11 months ago

I fixed the error. I will make a PR, but please, test it thoroughly before, I can't do much right now as I haven't got any music in my PC downloaded, you know, (Bad third world internet, Imma leave it downloading overnight)

ravachol commented 11 months ago

Hi,

thank you for this. I have fixed the other warnings.