libopenshot icon indicating copy to clipboard operation
libopenshot copied to clipboard

Rewrite doc/INSTALL-MAC.md with a working recipe for Apple Silicon and Intel Macs

Open geekrebel opened this issue 7 months ago • 1 comments

Summary

doc/INSTALL-MAC.md has drifted badly from reality. It still tells contributors to run commands like:

  • brew install gcc48 --enable-all-languages (the gcc48 formula was removed from Homebrew years ago; GCC 4.8 is from 2013),
  • brew install unittest-cpp --cc=gcc-4.8,
  • brew install qt5 (the current formula is qt@5),
  • point CMake at /usr/local/Cellar/qt5/5.4.2/ and /usr/local/Cellar/python3/3.3.2/... (Intel-only paths, Python 3.3 has been EOL since 2017),
  • pass cmake -d -G ... (there is no -d flag; that is what the reporter of #1030 was doing, straight from this file).

As a result, anyone following the existing doc on a current Mac, and especially any contributor on Apple Silicon, lands on opaque CMake errors. The most common one, and the subject of #1030, is the follow-on "Could not find a package configuration file provided by OpenShotAudio", which hides the actual problem that libopenshot-audio itself no longer builds with the commands the doc suggests.

What this PR changes

A full rewrite of doc/INSTALL-MAC.md with a recipe that was verified end-to-end on:

  • macOS 15
  • Apple Silicon (arm64)
  • AppleClang 17.0.0 (Command Line Tools)
  • CMake 4.0.3
  • Homebrew at /opt/homebrew

Every prefix is derived via $(brew --prefix ...), so the same commands work on Intel Macs against /usr/local without modification.

The new document covers:

  • Supported platforms.
  • Installing Xcode Command Line Tools and Homebrew.
  • The real list of required Homebrew formulae (cmake, swig, qt@5, ffmpeg@7, libomp, zeromq, cppzmq, pkgconf), plus optional ones.
  • Cloning libopenshot-audio and libopenshot as siblings.
  • Building libopenshot-audio with the default out-of-source CMake workflow.
  • Building libopenshot with the exact flags AppleClang needs, in particular the five -DOpenMP_* hints that work around AppleClang not shipping an OpenMP runtime.
  • Verifying the build with python3 -c "import openshot; ...".
  • Optional cmake --install build step and how to point it at Homebrew's prefix.
  • Optional test build via Catch2 / UnitTest++.
  • A Troubleshooting section documenting the current set of macOS-specific gotchas that a contributor will hit even with this recipe.

What is documented in Troubleshooting

These are genuine current issues, surfaced while walking the build on Apple Silicon. Each has a sensible workaround captured in the doc, and each is worth its own small follow-up PR:

  1. AGL framework removed from the macOS SDK in 10.14. Already being fixed by OpenShot/libopenshot-audio#169 (my own PR). Once that merges, the troubleshooting note can be tightened.
  2. cppzmq is marked optional in CMake but required in source: src/ZmqLogger.h unconditionally #includes <zmq.hpp>, so the "optional" classification in src/CMakeLists.txt is misleading. Worth a follow-up PR to make it actually required (or guarded by a compile flag).
  3. AppleClang OpenMP detection: find_package(OpenMP REQUIRED) fails out of the box on macOS because AppleClang does not ship OpenMP. Worth a follow-up PR to add a small macOS fallback path to the CMake module (or at least to cmake/'s helper set).
  4. Ruby bindings fail on macOS due to register: Apple's /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Headers/ruby/ruby/intern.h declares functions using the register specifier, which C++17 has removed. This blocks the Ruby bindings on every modern macOS SDK. Worth a follow-up PR to default ENABLE_RUBY to OFF on macOS.
  5. FFmpeg 8: Homebrew's default ffmpeg formula is already at FFmpeg 8, which is not yet supported on develop; until #1018 lands, the doc tells users to install ffmpeg@7.

Scope

Docs-only. CMakeLists.txt, source, and every build target are unchanged. The recipe in this file was used to build libopenshot.dylib and _openshot.so from a clean clone on an Apple Silicon Mac; running python3 -c "import openshot; print(openshot.OPENSHOT_VERSION_FULL)" prints 0.7.0.

Fixes

Fixes #1030.

Context

This is my first PR to libopenshot proper. It is the documentation half of a small series of Apple Silicon contributor fixes I have been working on. On the packaging side, the corresponding openshot-qt PRs are #6003, #6004, #6005, and #6006; on the audio-library side, the corresponding fix is OpenShot/libopenshot-audio#169. The follow-up CMake fixes enumerated in Troubleshooting above will land as separate small PRs.

geekrebel avatar Apr 16 '26 11:04 geekrebel

Merge conflicts have been detected on this PR, please resolve.

github-actions[bot] avatar Apr 17 '26 03:04 github-actions[bot]