ravachol / kew

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

opusfile installed but can't be found #105

Closed xplshn closed 8 months ago

xplshn commented 8 months ago
[anto@/portstree/masterdir kew]$ CC="zig cc" make                                                                  
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
zig cc -I/usr/include -I/usr/include/ogg/ -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 -O2 -g  -fstack-protector-strong -Wformat -Werror=format-security -fPIE -fstack-protector -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wall -Wpointer-arith -c -o src/obj/soundcommon.o src/soundcommon.c
In file included from src/soundcommon.c:1:
In file included from src/soundcommon.h:6:
include/miniaudio/miniaudio_libopus.h:19:10: fatal error: 'opusfile.h' file not found
#include <opusfile.h>
         ^~~~~~~~~~~~
1 error generated.
make: *** [Makefile:20: src/obj/soundcommon.o] Error 1
[anto@/portstree/masterdir kew]$ xbps-query -Rs avformat
[*] libavformat-4.4.4_5     FFmpeg file format library
[-] libavformat-dbg-4.4.4_5 FFmpeg file format library (debug files)
[anto@/portstree/masterdir kew]$ xbps-query -Rs opusfile-devel ; xbps-query -Rs opus | grep devel
[*] opusfile-devel-0.12_3 Library for opening, seeking, and decoding .opus files - development files
[-] libopusenc-devel-0.2.1_1 Library for encoding .opus files - development files
[*] opus-devel-1.4_1         Totally open, royalty-free, highly versatile audio codec - development files
[*] opusfile-devel-0.12_3    Library for opening, seeking, and decoding .opus files - development files
[-] tagparser-devel-12.1.0_1 C++ library for handling AAC, ID3, Vorbis, Opus, FLAC and Matroska tags - development files
[anto@/portstree/masterdir kew]$  

I do not understand why it isn't found, I used the pacman command you provided, I just added -devel to the end of the names of all packages and used xbps, and it installed all of the libraries correctly.

xplshn commented 8 months ago

Using clang resulted in the same error but way slower:

[anto@/portstree/masterdir kew]$ make                                                            
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
clang -I/usr/include -I/usr/include/ogg/ -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 -O2 -g  -fstack-protector-strong -Wformat -Werror=format-security -fPIE -fstack-protector -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wall -Wpointer-arith -c -o src/obj/write_ascii.o include/imgtotxt/write_ascii.c -static -pie -Wl,-z,relro
clang-15: warning: -Wl,-z,relro: 'linker' input unused [-Wunused-command-line-argument]
clang-15: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
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
clang -I/usr/include -I/usr/include/ogg/ -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 -O2 -g  -fstack-protector-strong -Wformat -Werror=format-security -fPIE -fstack-protector -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wall -Wpointer-arith -c -o src/obj/soundcommon.o src/soundcommon.c
In file included from src/soundcommon.c:1:
In file included from src/soundcommon.h:6:
include/miniaudio/miniaudio_libopus.h:19:10: fatal error: 'opusfile.h' file not found
#include <opusfile.h>
         ^~~~~~~~~~~~
1 error generated.
make: *** [Makefile:20: src/obj/soundcommon.o] Error 1
[anto@/portstree/masterdir kew]$ 

Using TCC:

[anto@/portstree/masterdir kew]$ make -j4            
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
tcc -I/usr/include -I/usr/include/ogg/ -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 -O2 -g  -fstack-protector-strong -Wformat -Werror=format-security -fPIE -fstack-protector -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wall -Wpointer-arith -c -o src/obj/write_ascii.o include/imgtotxt/write_ascii.c -static -pie -Wl,-z,relro
tcc: error: invalid option -- '-pie'
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
make: *** [Makefile:23: src/obj/write_ascii.o] Error 1
[anto@/portstree/masterdir kew]$ 

Using GCC as a last resort:

[anto@/portstree/masterdir kew]$ make -j4                        
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
gcc -I/usr/include -I/usr/include/ogg/ -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 -O2 -g  -fstack-protector-strong -Wformat -Werror=format-security -fPIE -fstack-protector -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wall -Wpointer-arith -c -o src/obj/soundcommon.o src/soundcommon.c
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
gcc -I/usr/include -I/usr/include/ogg/ -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 -O2 -g  -fstack-protector-strong -Wformat -Werror=format-security -fPIE -fstack-protector -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wall -Wpointer-arith -c -o src/obj/player.o src/player.c
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
gcc -I/usr/include -I/usr/include/ogg/ -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 -O2 -g  -fstack-protector-strong -Wformat -Werror=format-security -fPIE -fstack-protector -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wall -Wpointer-arith -c -o src/obj/soundopus.o src/soundopus.c
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
gcc -I/usr/include -I/usr/include/ogg/ -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 -O2 -g  -fstack-protector-strong -Wformat -Werror=format-security -fPIE -fstack-protector -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wall -Wpointer-arith -c -o src/obj/soundvorbis.o src/soundvorbis.c
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
In file included from src/songloader.h:6,
                 from src/albumart.h:8,
                 from src/player.h:8,
                 from src/player.c:2:
src/metadata.h:3:10: fatal error: libavformat/avformat.h: No such file or directory
    3 | #include <libavformat/avformat.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from src/songloader.h:6,
                 from src/soundopus.h:6,
                 from src/soundopus.c:1:
src/metadata.h:3:10: fatal error: libavformat/avformat.h: No such file or directory
    3 | #include <libavformat/avformat.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:20: src/obj/soundopus.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [Makefile:20: src/obj/player.o] Error 1
In file included from src/soundcommon.h:6,
                 from src/soundcommon.c:1:
include/miniaudio/miniaudio_libopus.h:19:10: fatal error: opusfile.h: No such file or directory
   19 | #include <opusfile.h>
      |          ^~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:20: src/obj/soundcommon.o] Error 1
In file included from src/songloader.h:6,
                 from src/soundvorbis.h:6,
                 from src/soundvorbis.c:1:
src/metadata.h:3:10: fatal error: libavformat/avformat.h: No such file or directory
    3 | #include <libavformat/avformat.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:20: src/obj/soundvorbis.o] Error 1
[anto@/portstree/masterdir kew]$ 
ravachol commented 8 months ago

sudo find /usr -name "libavformat" sudo find /usr -name "opus"

what do these say?

try grabbing the latest commit. I updated the makefile.

xplshn commented 8 months ago
[anto@/portstree/masterdir homebrew]$ find /usr -name "opus"     
/usr/include/opus
/usr/share/licenses/opus
[anto@/portstree/masterdir homebrew]$ sudo find /usr -name "libavformat"
sudo: /etc/sudo.conf is owned by uid 1000, should be 0
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
[anto@/portstree/masterdir homebrew]$ find /usr -name "libavformat"     
[anto@/portstree/masterdir homebrew]$ xbps-query -Rs libavf
[*] libavfilter-4.4.4_5     FFmpeg audio/video filter library
[*] libavformat-4.4.4_5     FFmpeg file format library
[-] libavfs-1.1.5_1         Virtual filesystem that allows browsing compressed files - library
[-] libavfilter-dbg-4.4.4_5 FFmpeg audio/video filter library (debug files)
[-] libavformat-dbg-4.4.4_5 FFmpeg file format library (debug files)
[-] libavfs-dbg-1.1.5_1     Virtual filesystem that allows browsing compressed files - library (debug files)
[anto@/portstree/masterdir homebrew]$ xbps-query -Rs avfor 
[*] libavformat-4.4.4_5     FFmpeg file format library
[-] libavformat-dbg-4.4.4_5 FFmpeg file format library (debug files)
[anto@/portstree/masterdir homebrew]$ 

Is there another package for libavformat? In Void you usually have normal releases and -Devel releases, the name of packages tends to be the same as FemdomLinux(Arch)'s

Ignore the sudo error, I installed it because some programs have a dependency on it, which is weird, I do not have sudo or doas.

xplshn commented 8 months ago

I am sorry to keep bothering, I tried with the latest commit but yet it didn't work:

[anto@/portstree/masterdir homebrew]$ chroot-git clone https://github.com/ravachol/kew
Cloning into 'kew'...
remote: Enumerating objects: 1462, done.
remote: Counting objects: 100% (823/823), done.
remote: Compressing objects: 100% (249/249), done.
remote: Total 1462 (delta 628), reused 719 (delta 567), pack-reused 639
Receiving objects: 100% (1462/1462), 3.58 MiB | 5.93 MiB/s, done.
Resolving deltas: 100% (1023/1023), done.
[anto@/portstree/masterdir homebrew]$ cd kew/
[anto@/portstree/masterdir kew]$ ed ./Makefile 
1903
,n
1   CC = gcc
2   PKG_CONFIG  ?= pkg-config
3   CFLAGS = -I/usr/include -I/usr/include/ogg/  -I/usr/include/opus -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 -O2 -g $(shell $(PKG_CONFIG) --cflags gio-2.0 chafa libavformat fftw3f opus opusfile vorbis)
4   CFLAGS += -fstack-protector-strong -Wformat -Werror=format-security -fPIE -fstack-protector -fstack-protector-strong -D_FORTIFY_SOURCE=2
5   CFLAGS += -Wall -Wpointer-arith
6   LIBS = -L/usr/lib -lfreeimage -latomic -lpthread -lrt -pthread -lm -lglib-2.0  $(shell $(PKG_CONFIG) --libs gio-2.0 chafa libavformat fftw3f opus opusfile vorbis vorbisfile)
7   LDFLAGS = -pie -Wl,-z,relro
8   
9   OBJDIR = src/obj
10  PREFIX = /usr
11  SRCS = src/soundcommon.c src/player.c src/soundopus.c src/soundvorbis.c src/soundbuiltin.c src/soundpcm.c src/mpris.c src/playerops.c src/volume.c src/cutils.c src/soundgapless.c src/songloader.c src/file.c src/chafafunc.c src/cache.c src/metadata.c src/playlist.c src/stringfunc.c src/term.c  src/settings.c src/albumart.c src/visuals.c src/kew.c
12  OBJS = $(SRCS:src/%.c=$(OBJDIR)/%.o)
13  
14  MAN_PAGE = kew.1
15  MAN_DIR ?= $(PREFIX)/share/man
16  
17  all: kew
18  
19  $(OBJDIR)/%.o: src/%.c Makefile | $(OBJDIR)
20      $(CC) $(CFLAGS) -c -o $@ $<
21  
22  $(OBJDIR)/write_ascii.o: include/imgtotxt/write_ascii.c Makefile | $(OBJDIR)
23      $(CC) $(CFLAGS) -c -o $@ $< $(LDFLAGS)
24  
25  $(OBJDIR):
26      mkdir -p $(OBJDIR)
27  
28  kew: $(OBJDIR)/write_ascii.o $(OBJS) Makefile
29      $(CC) -o kew $(OBJDIR)/write_ascii.o $(OBJS) $(LIBS)
30  
31  .PHONY: install
32  install: all
33      mkdir -p $(DESTDIR)$(MAN_DIR)/man1
34      mkdir -p $(DESTDIR)$(PREFIX)/bin
35      install -m 0755 kew $(DESTDIR)$(PREFIX)/bin/kew
36      install -m 0644 docs/kew.1 $(DESTDIR)$(MAN_DIR)/man1/kew.1
37  
38  .PHONY: uninstall
39  uninstall:
40      rm -f $(DESTDIR)$(PREFIX)/bin/kew
41      rm -f $(DESTDIR)$(MAN_DIR)/man1/kew.1
42  
43  .PHONY: clean
44  clean:
45      rm -rf $(OBJDIR) kew
1c
CC = clang
.
w
1905
5c
CFLAGS += -Wall -Wpointer-arith -static  
.
w
1913
q
[anto@/portstree/masterdir kew]$ export LD="mold" && make   
mkdir -p src/obj
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
Package 'libavformat', required by 'virtual:world', not found
clang -I/usr/include -I/usr/include/ogg/  -I/usr/include/opus -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 -O2 -g  -fstack-protector-strong -Wformat -Werror=format-security -fPIE -fstack-protector -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wall -Wpointer-arith -static -c -o src/obj/write_ascii.o include/imgtotxt/write_ascii.c -pie -Wl,-z,relro
clang-15: warning: -Wl,-z,relro: 'linker' input unused [-Wunused-command-line-argument]
clang-15: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]
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
Package 'libavformat', required by 'virtual:world', not found
clang -I/usr/include -I/usr/include/ogg/  -I/usr/include/opus -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 -O2 -g  -fstack-protector-strong -Wformat -Werror=format-security -fPIE -fstack-protector -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wall -Wpointer-arith -static -c -o src/obj/soundcommon.o src/soundcommon.c
In file included from src/soundcommon.c:1:
In file included from src/soundcommon.h:14:
In file included from src/player.h:8:
In file included from src/albumart.h:8:
In file included from src/songloader.h:6:
src/metadata.h:3:10: fatal error: 'libavformat/avformat.h' file not found
#include <libavformat/avformat.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [Makefile:20: src/obj/soundcommon.o] Error 1
[anto@/portstree/masterdir kew]$ 
ravachol commented 8 months ago

Ok, but at least it finds opus now.

I commited a new makefile with a path to /usr/include/libavformat/ and a new metadata.h file. With a bit of luck, that should fix it.

If not, do a search on your pc for the file avformat.h.

You're not bothering you're helping out. :)

Edit: the build on github failed, so I had to revert.

xplshn commented 8 months ago

It seems I'll have to compile libavformat, the headers are not provided in Void it seems.

ravachol commented 8 months ago

I just realized that a reference to libavformat isn't needed the way I do things now. You still need to install it, but you don't need the headers. Try the latest.

xplshn commented 8 months ago

Will do - ...Once I figure out how to use xbps-src(chroot)... I used to have it work, but since I replaced all the GNU coreutils by those in ubase+sbase and those in toybox I've been debugging every part of my system. So yeah, you can close this issue, I will make another one if it does not work in the end, thx!