ravachol / kew

A command-line music player
GNU General Public License v2.0
575 stars 22 forks source link

Can't build cue using the install script #60

Closed Nias26 closed 1 year ago

Nias26 commented 1 year ago

I already saw an issue like mine in #40, but it didn't help. I've already installed all dependencies. I'm on 6.4.12-arch1-1 This is the build.log:

mkdir -p src/obj
gcc -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 -O1 `pkg-config --cflags gio-2.0 chafa libavformat fftw3f` -c -o src/obj/write_ascii.o include/imgtotxt/write_ascii.c
Package chafa was not found in the pkg-config search path.
Perhaps you should add the directory containing `chafa.pc'
to the PKG_CONFIG_PATH environment variable
No package 'chafa' found
Package libavformat was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavformat.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libavformat' found
Package fftw3f was not found in the pkg-config search path.
Perhaps you should add the directory containing `fftw3f.pc'
to the PKG_CONFIG_PATH environment variable
No package 'fftw3f' found
gcc -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 -O1 `pkg-config --cflags gio-2.0 chafa libavformat fftw3f` -c -o src/obj/soundgapless.o src/soundgapless.c
Package chafa was not found in the pkg-config search path.
Perhaps you should add the directory containing `chafa.pc'
to the PKG_CONFIG_PATH environment variable
No package 'chafa' found
Package libavformat was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavformat.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libavformat' found
Package fftw3f was not found in the pkg-config search path.
Perhaps you should add the directory containing `fftw3f.pc'
to the PKG_CONFIG_PATH environment variable
No package 'fftw3f' found
gcc -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 -O1 `pkg-config --cflags gio-2.0 chafa libavformat fftw3f` -c -o src/obj/songloader.o src/songloader.c
Package chafa was not found in the pkg-config search path.
Perhaps you should add the directory containing `chafa.pc'
to the PKG_CONFIG_PATH environment variable
No package 'chafa' found
Package libavformat was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavformat.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libavformat' found
Package fftw3f was not found in the pkg-config search path.
Perhaps you should add the directory containing `fftw3f.pc'
to the PKG_CONFIG_PATH environment variable
No package 'fftw3f' found
In file included from src/songloader.h:8,
                 from src/albumart.h:8,
                 from src/player.h:8,
                 from src/settings.h:9,
                 from src/metadata.h:9,
                 from src/songloader.h:5,
                 from src/songloader.c:1:
src/chafafunc.h:1:10: fatal error: chafa.h: File o directory non esistente
    1 | #include <chafa.h>
      |          ^~~~~~~~~
compilation terminated.
make: *** [Makefile:16: src/obj/songloader.o] Error 1
ravachol commented 1 year ago
  1. The error messages suggest adding the directory containing the .pc files to the PKG_CONFIG_PATH environment variable.

You can check your current pkg-config variable by running this command: pkg-config --variable pc_path pkg-config

It should reply with: /usr/lib/pkgconfig:/usr/share/pkgconfig

Or something similar. If it doesn't you can add this to your shell profile configuration file (e.g., ~/.bashrc or ~/.zshrc) as follows:

   export PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/share/pkgconfig:/usr/local/lib/pkgconfig"

Reload your shell or restart your terminal to apply the changes.

  1. chafa.h is missing. This could be a problem with an older versions of chafa, which does not work. Try running:

    pacman -S chafa

Then run the cue makefile again.

Nias26 commented 1 year ago

Still the same issue. The pkg_config_path wasn't set. So, I exported the line, restarted zsh and retyped pkg-config --variable pc_path pkg-configand still returns nothing, but it did export the line to PKG_CONFIG_PATH when I do echo $PKG_CONFIG_PATH. Chafa is at version 1.12.4-3 which is the latest. build.log still the same.

Nias26 commented 1 year ago

Still the same issue. The pkg_config_path wasn't set. So, I exported the line, restarted zsh and retyped pkg-config --variable pc_path pkg-configand still returns nothing, but it did export the line to PKG_CONFIG_PATH when I do echo $PKG_CONFIG_PATH. Chafa is at version 1.12.4-3 which is the latest. build.log still the same.

I can try to doing pkg-config --set-variable (but idk how to use it)

ravachol commented 1 year ago

Your pkg-config install may be broken. Maybe try: sudo pacman -S pkg-config

See if it installs it correctly. I don't know if you can do a set-variable, the examples I see are using the .bashrc script.

Nias26 commented 1 year ago

The install completed whitout errors. I'm going to look at some docs to see if I can set the variable myself. Thanks for the help.

Note:

Keep the issue open so when I find a solution, I'll post in here. Thanks.

ravachol commented 1 year ago

Np, I hope you find a solution!

Btw, on arch you should be able to just run: yay cue-git to install cue.. but it still does a "make"...so it wont work in your case.

Nias26 commented 1 year ago

Found the ISSUE (After hours of research)

I have brew installed on my machine and appparently brew had the package pkg-config installed, so everytime the machine tryed to use pkg-config, was using the brew one, which has wrong variables. The fix is this: brew remove pkg-config After that, the command pkg-config --variable pc_path pkg-config returns /usr/lib/pkgconfig (finally ╰(´︶`)╯) The installation went succefully.

ravachol commented 1 year ago

Nice! that's good to know. Thanks.