Skip to content

Add macOS support#134

Open
naxIO wants to merge 3 commits intoMGraefe:masterfrom
naxIO:feature/macos-support
Open

Add macOS support#134
naxIO wants to merge 3 commits intoMGraefe:masterfrom
naxIO:feature/macos-support

Conversation

@naxIO
Copy link

@naxIO naxIO commented Feb 10, 2026

Summary

Adds full macOS build support for the RP Soundboard plugin. The plugin has been successfully tested on macOS 15 (Apple Silicon) with TeamSpeak 3 Client.

What changed

  • CMakeLists.txt: Fixed plugin suffix (.dylib instead of .so), added macOS linker flags (-Wl,-all_load instead of unsupported GNU ld flags), linked required system frameworks (AudioToolbox, CoreAudio, CoreFoundation, CoreMedia, CoreVideo, VideoToolbox, Security) and libraries (bz2, z, iconv) needed by FFmpeg on macOS. Replaced hardcoded python with find_package(Python3) for cross-platform compatibility. Set correct macOS TS3 plugin directory.
  • FFmpeg build scripts: Added universal binary build support (arm64 + x86_64) using lipo on macOS. Added -Wno-incompatible-function-pointer-types flag for compatibility with modern Apple Clang. Added lib_mac_universal output directory.
  • create-pluginfile.cmake: Made plugin packaging cross-platform by using zip on Linux/macOS instead of the hardcoded Windows 7-Zip path.
  • buildinfo.c: Added arm64 vs x86_64 architecture distinction for macOS builds.
  • package.ini.in: Added mac to the supported platforms list.

Build instructions (macOS)

# Prerequisites
brew install qt@5 yasm

# Build FFmpeg (universal binary)
git submodule init && git submodule update
cd ffmpeg/build-scripts && ./build_ffmpeg.sh && cd ../..

# Build plugin
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$(brew --prefix qt@5)"
make

Notes

  • TeamSpeak 3 on macOS is an x86_64 binary (runs via Rosetta 2 on Apple Silicon). The plugin must be built for x86_64 to match. On Apple Silicon Macs, this requires either x86_64 Qt libraries or linking against TeamSpeak's bundled Qt.
  • FFmpeg is built as a universal binary (arm64 + x86_64), so the same static libraries work on both Intel and Apple Silicon Macs.
  • The python to find_package(Python3) change also benefits Linux where python may not be available (only python3).
  • Existing Windows and Linux builds are not affected by these changes.

Test plan

  • Plugin compiles on macOS 15 (Apple Silicon, x86_64 target)
  • Plugin loads in TeamSpeak 3 Client on macOS
  • Plugin appears in TeamSpeak Plugins menu
  • Verify Windows CI still passes
  • Verify Linux CI still passes
  • Test audio playback through TeamSpeak on macOS

This was referenced Feb 10, 2026
@MGraefe
Copy link
Owner

MGraefe commented Feb 11, 2026

Thank you claude 👍

I appreciate the contribution, will look at it tomorrow even though I have no way of testing it.

@naxIO
Copy link
Author

naxIO commented Feb 12, 2026

I tested it on my mac, which was the whole purpose because I wanted to use the plugin on mac. It works flawless (except the system design is affecting the desing of the plugin).

@naxIO
Copy link
Author

naxIO commented Feb 12, 2026

thanks for your feedback, will address this.

@MGraefe
Copy link
Owner

MGraefe commented Feb 12, 2026

thanks for your feedback, will address this.

Cool! Also don't sweat the linux build being broken, that's also happening on master. Will try to fix it, just a heads up that you probably need to rebase your branch after I'm done

@MGraefe
Copy link
Owner

MGraefe commented Feb 12, 2026

Will try to fix it, just a heads up that you probably need to rebase your branch after I'm done

It's fixed now

@naxIO
Copy link
Author

naxIO commented Feb 14, 2026

"I've" addressed all your feedback:

From your review comments:

  • Renamed build_universal → build_mac_universal for clarity
  • Capped njobs at 16 to prevent memory issues on many-core machines
  • Refactored the else-branch to reuse build_single_arch instead of duplicating the configure call
  • Flattened the nested if/else to elseif in CMakeLists.txt
  • Kept all Apple frameworks — they're needed because the pre-built static libs contain
    VideoToolbox/CoreMedia/CoreVideo symbols, and -Wl,-all_load pulls everything in

Additional fixes found during review:

  • Fixed an argument-splitting bug in build_single_arch (cc override with spaces was getting split into multiple
    args — now using a bash array)
  • Universal build now correctly sets --enable-cross-compile based on host architecture, so it works on both
    Intel and Apple Silicon Macs
  • Single-arch builds now clean up stale ffmpeg/universal artifacts to prevent linking against outdated libs
  • Added error checking to plugin packaging (was silently succeeding even if zip/7z failed)
  • Fixed two pre-existing memory leaks in ConfigModel.cpp (malloc without free → stack allocation)

Haven't been able to do a full end-to-end build test on all platforms, but the logic should be solid. Let me
know if anything else needs changing!

naxIO and others added 3 commits February 14, 2026 21:08
Build and run the plugin on macOS with the following changes:

CMakeLists.txt:
- Fix plugin suffix to .dylib (was .so)
- Add macOS-specific linker flags (-Wl,-all_load instead of GNU ld flags)
- Link required macOS system frameworks (AudioToolbox, CoreAudio,
  CoreFoundation, CoreMedia, CoreVideo, VideoToolbox, Security)
- Link bz2, z, iconv for FFmpeg dependencies on macOS
- Use find_package(Python3) for portable python invocation
- Set correct TS3 plugin path for macOS

FFmpeg build scripts:
- Add universal binary support (arm64 + x86_64) via lipo on macOS
- Add -Wno-incompatible-function-pointer-types for newer Clang compat
- Add lib_mac_universal output directory in copy_binaries.sh
- Use dynamic CPU count detection for parallel make

Other:
- Add macOS to supported platforms in package.ini.in
- Distinguish arm64/x86_64 in build name (buildinfo.c)
- Make plugin packaging cross-platform (zip on Linux/macOS)

Tested on macOS 15 (Apple Silicon) with TeamSpeak 3 Client (x86_64).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Rename build_universal to build_mac_universal for clarity
- Cap njobs at 16 to prevent memory issues on many-core machines
- Reuse build_single_arch in non-universal branch instead of duplicating configure
- Fix argument splitting bug in build_single_arch by using bash array
- Flatten nested if/else to elseif in CMakeLists.txt
- Add comment explaining why all Apple frameworks are needed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Set cross-compile flags based on host architecture so universal
  builds work on both Intel and Apple Silicon Macs
- Remove stale ffmpeg/universal dir before single-arch builds to
  prevent linking against outdated libs
- Add error checking to plugin packaging (RESULT_VARIABLE + FATAL_ERROR)
- Fix memory leaks in ConfigModel: use stack allocation instead of
  malloc without free

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@naxIO naxIO force-pushed the feature/macos-support branch from fcaed54 to 3f74323 Compare February 14, 2026 20:08
@MGraefe
Copy link
Owner

MGraefe commented Feb 14, 2026

Hi, sorry for the mess but the recent surge in activity here prompted me to do some general cleanup. In part, I dd a full port to use ffmpeg 8, together with a lot of other streamlining of Cmake and the ffmpeg build script in general.

I am also adding full github actions support to build ffmpeg from sources instead of relying on the prebuilt binaries in this repo.

So I will probably be picking things from this PR as well, just you know that your branch will probably require another rework once it's done. Sorry for that, but I think it will be good for the project overall. I also want to add a github action to build the mac version. I also would like to separate it out into its own release, as bundling another ~15 MB with the all-in-one addon is a bit excessive and I don't have any means to test it.

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.

2 participants