shinchiro/mpv-winbuild-cmake

[ffmpeg-configure] - xxxx not found using pkg-config

Closed this issue · 6 comments

Another issue with FFmpeg. It's not able to find its dependencies. In this case, it mentions libbluray, but when deleting --enable-libbluray in the ffmpeg.cmake the next package is not found by the ffmpeg configure step. In my case freetype2. So its not a libbluray issue. This is really strange as all package.pc files are in the correct spot (/mpv-winbuild-cmake/build64/install/mingw/lib/pkgconfig). To make matters even worse I was able to build it correctly a day ago and thought it was fixed... (#207) Now after some reboots of the Linux Arch VM, I get all these errors back. I also have those on my Ubuntu 22.04 machine I used to use for compiling mpv builds.

I thought that some ENVs aren't working so I tried copying the pkg-config folder from the mingw/lib to the system pkg-config folder, but that didn´t help either.

Could this be a ffmpeg issue? Or is pkg-config somehow mangled?

FAILED: packages/ffmpeg-prefix/src/ffmpeg-stamp/ffmpeg-configure /root/compile/mpv-winbuild-cmake/build64/packages/ffmpeg-prefix/src/ffmpeg-stamp/ffmpeg-configure
cd /root/compile/mpv-winbuild-cmake/build64/packages/ffmpeg-prefix/src/ffmpeg-build && /usr/bin/cmake -P /root/compile/mpv-winbuild-cmake/build64/packages/ffmpeg-prefix/src/ffmpeg-stamp/ffmpeg-configure-.cmake && /usr/bin/cmake -E touch /root/compile/mpv-winbuild-cmake/build64/packages/ffmpeg-prefix/src/ffmpeg-stamp/ffmpeg-configure
CMake Error at /root/compile/mpv-winbuild-cmake/build64/packages/ffmpeg-prefix/src/ffmpeg-stamp/ffmpeg-configure-.cmake:49 (message):
  Command failed: 1

   '/root/compile/mpv-winbuild-cmake/build64/exec' '/root/compile/mpv-winbuild-cmake/build64/packages/ffmpeg-prefix/src/ffmpeg/configure' '--cross-prefix=x86_64-w64-mingw32-' '--prefix=/root/compile/mpv-winbuild-cmake/build64/install/mingw' '--arch=x86_64' '--target-os=mingw32' '--target-exec=wine' '--pkg-config-flags=--static' '--enable-cross-compile' '--enable-runtime-cpudetect' '--enable-gpl' '--enable-version3' '--enable-nonfree' '--enable-postproc' '--enable-avisynth' '--enable-vapoursynth' '--enable-gmp' '--enable-libass' '--enable-libbluray' '--enable-libfreetype' '--enable-libfribidi' '--enable-libmodplug' '--enable-libopenmpt' '--enable-libmp3lame' '--enable-libopus' '--enable-libsoxr' '--enable-libspeex' '--enable-libvorbis' '--enable-libbs2b' '--enable-libvpx' '--enable-libwebp' '--enable-libx264' '--enable-libx265' '--enable-libaom' '--enable-libdav1d' '--enable-libxvid' '--enable-libzimg' '--enable-mbedtls' '--enable-libxml2' '--enable-libmysofa' '--enable-libssh' '--enable-libsrt' '--enable-libmfx' '--enable-libjxl' '--enable-cuda' '--enable-cuvid' '--enable-nvdec' '--enable-nvenc' '--enable-amf' '--disable-doc' '--disable-decoder=libaom_av1'

  See also

    /root/compile/mpv-winbuild-cmake/build64/packages/ffmpeg-prefix/src/ffmpeg-stamp/ffmpeg-configure-*.log


ninja: build stopped: subcommand failed.

ffmpeg-configure-out.log =>

ERROR: libbluray 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.libera.chat.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.

Thanks! :)

Dont need to to edit ffmpeg.cmake directly. Just do ninja libbluray-fullclean to force cmake rebuild the package. Or do ninja clean to force all packages to be rebuilt. ninja libbluray-force-update to update package

Thanks for your fast response! Unfortunately, it does not help. I always run ninja clean before rebuilding. I now tried ninja libbluray-fullclean but this did not help either. Maybe I have written it a bit diffuse. I meant to say ffmpeg is not finding any package via pkg-config. libbluray was just the package it complained about in this scenario, I edited libbluray out of the ffmpeg.cmake file to put it out of the equation and see what its complaining about next. Well, then it was freetype2.

EDIT: I somehow managed to get it working again. All I have done was to remove /mpv-winbuild-cmake/build64/install/mingw/lib/pkgconfig and let it rebuild with the next ninja ffmpeg

Thanks! :)

If you do ninja clean you may as well also delete the MINGW_INSTALL_PREFIX at the same time to get a completely clean/fresh environment there. It doesn't add any extra work since everything it getting re-built/installed to it anyway.

Thanks!
May I ask how to delete the MINGW_INSTALL_PREFIX? Is there a ninja command for it or do I need to delete a folder?

My bad, it's the contents of CMAKE_INSTALL_PREFIX, which includes MINGW_INSTALL_PREFIX. As far as I know there isn't a ninja command for it, I just delete the directory since I rarely do a full clean.

By default, assuming you're in the build directory you should have a directory called install, delete everything inside that rm -rf install/* and when you run ninja again everything will be installed to it again.

Just want to post an update on this one as I´m experiencing it again... It seems solely related to FreeType and libbluray (relies on FreeType). Deleting them will fix "FFmpeg configure failing" issue. As it seems the issue is known. msys2/MSYS2-packages#2873