LadybirdBrowser / ladybird

Truly independent web browser
https://ladybird.org
BSD 2-Clause "Simplified" License
21.71k stars 960 forks source link

Unable to build on MacOS 14.5 Sonoma - libavcodec can't be found #1329

Open fitsum opened 1 month ago

fitsum commented 1 month ago

I saw the previous closed issue -- https://github.com/LadybirdBrowser/ladybird/issues/1254 -- however I've installed all required packages and attempted to build using all three recommended ways for MacOS: simple shell script invocation, using homebrew's clang, and using gdb. FFMPEG is installed already and used regularly on my machine. I've also followed brew's recommendation to install libav. I am still getting the following error

-- Checking for module 'libavcodec'
--   Package 'libavcodec' not found
CMake Error at /usr/local/Cellar/cmake/3.30.3/share/cmake/Modules/FindPkgConfig.cmake:645 (message):
  The following required packages were not found:

   - libavcodec

Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.30.3/share/cmake/Modules/FindPkgConfig.cmake:873 (_pkg_check_modules_internal)
  Userland/Libraries/LibMedia/CMakeLists.txt:23 (pkg_check_modules)

-- Configuring incomplete, errors occurred!
dlarocque commented 1 month ago

I had this issue earlier and was able to fix it by installing it using brew: brew install ffmpeg

Can you see libavcodec in the homebrew cellar if you run pkg-config --libs libavcodec?

fitsum commented 1 month ago

I had this issue earlier and was able to fix it by installing it using brew: brew install ffmpeg

Can you see libavcodec in the homebrew cellar if you run pkg-config --libs libavcodec?

Thanks

I get Package libavcodec was not found in the pkg-config search path..

However I have ffmpeg 7.0.2 listed in my formulas so I did install it with homebrew.

fitsum commented 1 month ago

After doing brew install ffmpeg I still get the same error as above. My machine is a bit old but the OS is up to date so I'm curious what's clobbering what in my case.

sideshowbarker commented 1 month ago

Please trying deleting the build and rebuilding from scratch:

./Meta/ladybird.sh delete && ./Meta/ladybird.sh rebuild

(I think running ./Meta/ladybird.sh rebuild on its own should work, but not 100% certain.)

At least that’s what worked for me in my macOS Sequoia 15.0 environment, with ffmpeg installed from homebrew.

Without doing that delete-and-rebuild, the exact build failure message I had been getting was this:

ninja: error: '/opt/homebrew/Cellar/ffmpeg/7.0.2/lib/libavcodec.dylib', needed by 'lib/liblagom-media.0.0.0.dylib', missing and no known rule to make it

sideshowbarker commented 1 month ago

@fitsum Did you try what’s suggested in https://github.com/LadybirdBrowser/ladybird/issues/1329#issuecomment-2357928312?

fitsum commented 1 month ago

@fitsum Did you try what’s suggested in #1329 (comment)?

thanks for your reply, I just attempted your suggestion a few times but the result is the same as the first error I got I first did the delete and rebuild, then just the rebuild, then the delete and rebuild once more to be sure