build(mac): Add -system-libs flag for Homebrew compatibility

Add a new `-system-libs` flag to mac/build.command that uses
system-installed libraries via pkg-config instead of bundled ones.
This enables Homebrew formula compatibility while preserving the
default standalone build behavior.

When `-system-libs` is passed:
- Uses pkg-config for: freetype2, gpac, libpng, libprotobuf-c,
  libutf8proc, zlib
- Does not compile bundled thirdparty sources
- Links against system libraries

Default behavior (no flag):
- Compiles bundled libraries as before
- No change to existing builds

Also adds a CI job `build_shell_system_libs` to test the new flag.

Refs #1580, #1534

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Carlos Fernandez
2025-12-20 17:58:46 +01:00
parent 2ce3e0c0de
commit 6838666b79
2 changed files with 99 additions and 48 deletions

View File

@@ -42,6 +42,19 @@ jobs:
with:
name: CCExtractor mac build
path: ./mac/artifacts
build_shell_system_libs:
# Test building with system libraries via pkg-config (for Homebrew formula compatibility)
runs-on: macos-latest
steps:
- name: Install dependencies
run: brew install pkg-config autoconf automake libtool tesseract leptonica gpac freetype libpng protobuf-c utf8proc zlib
- uses: actions/checkout@v6
- name: build with system libs
run: ./build.command -system-libs
working-directory: ./mac
- name: Display version information
run: ./ccextractor --version
working-directory: ./mac
build_autoconf:
runs-on: macos-latest
steps: