Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build from master & 1.3.1 due to opus not found using pkg-config #2690

Closed
doronbehar opened this issue Mar 14, 2020 · 9 comments
Closed
Assignees
Milestone

Comments

@doronbehar
Copy link

Problem description:

I get this error when I run make in ./build/:

 --extra-cflags="-mfpmath=sse -msse2 -I/var/src/HandBrake/build/contrib/include -DNDEBUG" --enable-nvenc --enable-encoder=h264_nvenc --enable-encoder=hevc_nvenc
ERROR: opus not found using pkg-config

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
make: *** [../contrib/ffmpeg/module.rules:2: contrib/ffmpeg/.stamp.ffmpeg.configure] Error 1

HandBrake version:

1.3.1, (master as well).

Operating system and version (e.g., Ubuntu 19.10, macOS 10.15 Catalina, Windows 10 1909):

NixOS.

Error message text and/or screenshot:

Provided at top.

HandBrake Activity Log:

Irrelevant.

More info

I have libopus installed and I can see it in the following command:

$ pkg-config --list-all | grep opus
opus                   Opus - Opus IETF audio codec (floating-point, custom modes build)

And:

$ pkg-config --libs opus
-L/nix/store/ibv46470wpx4pdb78gdfs8rlq1v98ysk-libopus-1.3.1/lib -lopus
@sr55
Copy link
Contributor

sr55 commented Mar 14, 2020

make sure you also have libopus-dev or whatever it's called on your distro

@bradleysepos
Copy link
Contributor

I did a quick package search and it seems NixOS does not have separate devel packages. Weird pkg-config is finding opus but ffmpeg is not. Where is the .pc file? I don't think we've yet seen this on other distros.

@doronbehar
Copy link
Author

doronbehar commented Mar 15, 2020

Thanks for replying so quickly. NixOS is definitely a strange beast in that sense. I'm very familiar with Nix's building ecosystem and I'm experienced in creating packages and building from source. Nix uses environmental variables such as $PKG_CONFIG_PATH to populate dependencies' build files and handle common build systems.

I've found the file ffbuild/config.log that the ./configure command reported the log is there. Here's it's tail:

BEGIN /tmp/ffconf.qrpFMdv9/test.c
    1	#include <lame/lame.h>
    2	#include <stdint.h>
    3	long check_lame_set_VBR_quality(void) { return (long) lame_set_VBR_quality; }
    4	int main(void) { int ret = 0;
    5	 ret |= ((intptr_t)check_lame_set_VBR_quality) & 0xFFFF;
    6	return ret; }
END /tmp/ffconf.qrpFMdv9/test.c
/nix/store/35hd6lq59a4926n6c0rfra8dffkrp2pg-gcc-wrapper-9.2.0/bin/gcc -I/var/src/HandBrake/build/contrib/include -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -I/var/src/HandBrake/build/contrib/include -std=gnu99 -mfpmath=sse -msse2 -mfpmath=sse -msse2 -I/var/src/HandBrake/build/contrib/include -DNDEBUG -std=c11 -fomit-frame-pointer -fPIC -I/var/src/HandBrake/build/contrib//include -pthread -pthread -I/var/src/HandBrake/build/contrib/include -c -o /tmp/ffconf.qrpFMdv9/test.o /tmp/ffconf.qrpFMdv9/test.c
/nix/store/35hd6lq59a4926n6c0rfra8dffkrp2pg-gcc-wrapper-9.2.0/bin/gcc -L/var/src/HandBrake/build/contrib/lib -mfpmath=sse -msse2 -L/var/src/HandBrake/build/contrib/lib -Wl,--as-needed -Wl,-z,noexecstack -o /tmp/ffconf.qrpFMdv9/test /tmp/ffconf.qrpFMdv9/test.o -lmp3lame -lm
require_pkg_config libopus opus opus_multistream.h opus_multistream_decoder_create
check_pkg_config libopus opus opus_multistream.h opus_multistream_decoder_create
test_pkg_config libopus opus opus_multistream.h opus_multistream_decoder_create
pkg-config --exists --print-errors opus
Package opus was not found in the pkg-config search path.
Perhaps you should add the directory containing `opus.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opus' found
ERROR: opus not found using pkg-config

Running pkg-config --exists --print-errors opus prints no errors and exits with $? = 0. Here's 1 more pkg-config command and it's output:

$ pkg-config --libs --cflags-only-I opus
-I/nix/store/ihdbk3rhrik6i11h76psxq8rx34hsh4c-libopus-1.3.1-dev/include/opus -L/nix/store/ibv46470wpx4pdb78gdfs8rlq1v98ysk-libopus-1.3.1/lib -lopus

While these are the files I have in /nix/store/ihdbk3rhrik6i11h76psxq8rx34hsh4c-libopus-1.3.1-dev/:

/nix/store/ihdbk3rhrik6i11h76psxq8rx34hsh4c-libopus-1.3.1-dev/
├── include
│   └── opus
│       ├── opus_custom.h
│       ├── opus_defines.h
│       ├── opus.h
│       ├── opus_multistream.h
│       ├── opus_projection.h
│       └── opus_types.h
├── lib
│   └── pkgconfig
│       └── opus.pc
├── nix-support
│   └── propagated-build-inputs
└── share
    └── aclocal
        └── opus.m4

7 directories, 9 files

And in /nix/store/57xj2cwdcy8ly5m1nap6cymbr293ka6q-libopus-1.3.1/:

/nix/store/57xj2cwdcy8ly5m1nap6cymbr293ka6q-libopus-1.3.1/
└── lib
    ├── libopus.la
    ├── libopus.so -> libopus.so.0.8.0
    ├── libopus.so.0 -> libopus.so.0.8.0
    └── libopus.so.0.8.0

1 directory, 4 files

@bradleysepos
Copy link
Contributor

I'm guessing opus isn't going to be the only failure, just the first that halts compilation.

See contrib/ffmpeg/module.defs for how we're building FFmpeg.

I'll try to spin up a NixOS VM to investigate soon.

@doronbehar
Copy link
Author

doronbehar commented Mar 15, 2020

I'll try to spin up a NixOS VM to investigate soon.

My dear thanks for your prompt support, but it's not that important, I was just wondering if this program was capable of converting DSD ISOs (UDF file systems) to separated music files. I've had the impression it can't do it after using it via flatpak. Please correct me if I'm wrong,

@bradleysepos
Copy link
Contributor

Correct, HandBrake is likely the wrong tool for this purpose. Nevertheless, I will investigate the other issue when I get a chance.

@bradleysepos
Copy link
Contributor

#2712 makes building possible on NixOS by improving HandBrake's build system to be a bit more flexible and intelligent.

@bradleysepos bradleysepos added this to the 1.4.0 milestone Mar 25, 2020
@bradleysepos
Copy link
Contributor

#2712 is merged to master branch (nightly builds) and will be in HandBrake 1.4.0. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants