Skip to content

Fix library detection on Apple Silicon - #1303

Merged
flyingmutant merged 4 commits into
cmus:masterfrom
cubicvoid:faad-package-fix
Mar 24, 2024
Merged

flyingmutant merged 4 commits into
cmus:masterfrom
cubicvoid:faad-package-fix

Conversation

@cubicvoid

Copy link
Copy Markdown
Contributor

On Apple Silicon, Homebrew doesn't install ARM packages to the global header/library paths. This means that the common package dependencies faad2 and mp4v2 can no longer be detected by checking /usr/local, so configure fails to find them and disables AAC and MP4.

This is fixed by using pkg-config to check for those dependencies, since Homebrew's pkg-config search path accounts for the CPU architecture, and gives the correct results on both Intel and ARM.

I left the previous behavior in place as a fallback, for systems that have the libs installed globally without a working pkg-config.

Minor housekeeping: I also changed the temp file cleanup at the end to use -r with rm, since on macOS the configure script generates .dSYM directories from its temp file builds, and the script was printing errors every time it failed to delete them.

@gavtroy gavtroy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks fine to me, and still works fine on my (Linux) system

@flyingmutant
flyingmutant merged commit 3bbb756 into cmus:master Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants