-
Notifications
You must be signed in to change notification settings - Fork 1
Building from Source
This guide covers building the foo_mac_scrobble component from source code. Whether you want to contribute, customize the plugin, or understand the build process, this page has you covered.
- macOS 12 (Monterey) or later
- Xcode 15 or later
- Command Line Tools (installed via Xcode)
- foobar2000 for macOS (for testing)
The repository includes all necessary dependencies:
- foobar2000 SDK
- libPPUI (foobar2000 UI library)
- pfc (core support library)
- Third-party libraries (in
thirdparty/)
No additional package managers or dependencies are required.
git clone https://github.com/avelytchko/foo_mac_scrobble.git
cd foo_mac_scrobbleopen foobar2000/foo_mac_scrobble/foo_mac_scrobble.xcodeprojThe project is pre-configured with all necessary settings:
- SDK: foobar2000 SDK paths are relative to the project
-
Build Configuration: Use
Releasefor production builds - Architecture: Universal binary (arm64 + x86_64)
- Deployment Target: macOS 12.0
In Xcode, ensure the foo_mac_scrobble scheme is selected in the toolbar.
Press ⌘B or choose Product → Build from the menu.
After a successful build, the component is located at:
~/Library/Developer/Xcode/DerivedData/foo_mac_scrobble-<HASH>/Build/Products/Release/foo_mac_scrobble.component/
You can reveal it in Finder via Product → Show Build Folder in Finder.
The CLI build process mirrors the GitHub Actions workflow.
cd foobar2000/foo_mac_scrobble
xcodebuild -project foo_mac_scrobble.xcodeproj \
-scheme foo_mac_scrobble \
-configuration Release \
-derivedDataPath buildxcodebuild -project foo_mac_scrobble.xcodeproj \
-scheme foo_mac_scrobble \
-configuration Release \
-derivedDataPath build \
OTHER_CPLUSPLUSFLAGS="-DFOO_LASTFM_DEBUG_DEFAULT=1"xcodebuild -project foo_mac_scrobble.xcodeproj \
-scheme foo_mac_scrobble \
-configuration Release \
-derivedDataPath build \
OTHER_CPLUSPLUSFLAGS="-DFOO_LASTFM_DEBUG_DEFAULT=1 \
-DFOO_LASTFM_CI_API_KEY='\"YOUR_API_KEY\"' \
-DFOO_LASTFM_CI_API_SECRET='\"YOUR_API_SECRET\"'"Note: Pre-configured credentials are only needed for automated testing. Normal builds don't require this — users enter their own credentials in the preferences UI.
After building, copy the component to your foobar2000 directory:
cp -r build/Build/Products/Release/foo_mac_scrobble.component \
~/Library/foobar2000-v2/user-components/foo_mac_scrobble/Restart foobar2000 to load the component.
- Optimized for performance
- Debug symbols stripped
- Suitable for distribution
- No optimizations
- Full debug symbols included
- Verbose logging enabled
To build Debug configuration:
xcodebuild -project foo_mac_scrobble.xcodeproj \
-scheme foo_mac_scrobble \
-configuration Debug \
-derivedDataPath buildThe project supports several compile-time flags:
| Flag | Purpose | Default |
|---|---|---|
FOO_LASTFM_DEBUG_DEFAULT |
Enable debug logging by default |
0 (off) |
FOO_LASTFM_CI_API_KEY |
Embed API key (CI only) | Not set |
FOO_LASTFM_CI_API_SECRET |
Embed API secret (CI only) | Not set |
These can be passed via OTHER_CPLUSPLUSFLAGS as shown in the CLI examples above.
The project includes a GitHub Actions workflow that:
- Checks out the repository
- Builds the component with Xcode
- Downloads and installs foobar2000
- Installs the built component
- Runs automated tests (API initialization, queue processing)
- Uploads build artifacts
See .github/workflows/build_foobar.yml for the complete workflow configuration.
The CI workflow includes self-tests that verify:
- Plugin loads successfully
- Last.fm API initializes correctly
- Session management works
- Queue system processes tracks
- Network requests are handled properly
Ensure Xcode Command Line Tools are installed:
xcode-select --installClean the build folder and try again:
# In Xcode: Product → Clean Build Folder (⌘⇧K)
# Or via CLI:
rm -rf build/
xcodebuild clean -project foo_mac_scrobble.xcodeproj -scheme foo_mac_scrobbleThe foobar2000 SDK paths are relative to the project. Ensure you've cloned the complete repository including all subfolders:
git clone https://github.com/avelytchko/foo_mac_scrobble.git
cd foo_mac_scrobble
ls -la foobar2000/ # Should show the SDK structureEnsure you're opening the .xcodeproj file, not individual source files:
open foobar2000/foo_mac_scrobble/foo_mac_scrobble.xcodeproj- Contributing — Guidelines for submitting code
- Technical Overview — Understand the codebase structure
Questions? Open an issue on GitHub.