This guide explains how to create portable distribution packages for TundraDB on macOS.
# Create a portable bundle with all dependencies
./scripts/create_macos_bundle.sh
# This creates:
# - dist/TundraDB-1.0.0-macOS.tar.gz (compressed archive)
# - dist/TundraDB-1.0.0-macOS/ (directory with all files)# Create a native macOS .app bundle
./scripts/create_macos_app.sh
# This creates:
# - dist/TundraDB.app (native macOS application)
# - dist/tundra_shell (terminal launcher script)
# - dist/TundraDB-1.0.0.dmg (if create-dmg is installed)Best for: Developers, command-line users, CI/CD
Advantages:
- Self-contained (no external dependencies)
- Works on any macOS system
- Easy to distribute via download
- Can be extracted anywhere
Usage:
# Extract and run
tar -xzf TundraDB-1.0.0-macOS.tar.gz
cd TundraDB-1.0.0-macOS
./tundra_shell --helpBest for: End users, GUI integration
Advantages:
- Native macOS experience
- Can be installed in Applications folder
- Proper macOS metadata and versioning
- Can be signed and notarized
Usage:
# Copy to Applications and run
cp -r TundraDB.app /Applications/
/Applications/TundraDB.app/Contents/MacOS/tundra_shell --helpBest for: Professional distribution
Prerequisites:
brew install create-dmgAdvantages:
- Professional installer experience
- Can include license agreements
- Drag-and-drop installation
- Compressed and signed
Best for: Developer community
Setup:
- Create a GitHub repository for your Homebrew tap
- Copy
Formula/tundradb.rbto your tap repository - Update the URL and SHA256 in the formula
Usage:
# Users can install with:
brew tap yourusername/tundradb
brew install tundradbEdit the version in the scripts:
# In scripts/create_macos_bundle.sh and scripts/create_macos_app.sh
VERSION="1.0.0" # Change this# Add files to the bundle
mkdir -p "${BUNDLE_DIR}/share/examples"
cp examples/* "${BUNDLE_DIR}/share/examples/"For distribution outside the App Store:
# Sign the executable
codesign --force --sign "Developer ID Application: Your Name" \
"${APP_BUNDLE}/Contents/MacOS/tundra_shell"
# Sign the app bundle
codesign --force --sign "Developer ID Application: Your Name" \
"${APP_BUNDLE}"For Gatekeeper compatibility:
# Create a zip for notarization
ditto -c -k --keepParent "${APP_BUNDLE}" "${APP_NAME}.zip"
# Submit for notarization
xcrun notarytool submit "${APP_NAME}.zip" \
--keychain-profile "AC_PASSWORD" \
--wait
# Staple the notarization
xcrun stapler staple "${APP_BUNDLE}"# Extract to a temporary location
cd /tmp
tar -xzf /path/to/TundraDB-1.0.0-macOS.tar.gz
cd TundraDB-1.0.0-macOS
# Test basic functionality
./tundra_shell --help
./tundra_shell --db-path ./test-db
# Check dependencies are bundled
otool -L bin/tundra_shell# Test the app bundle
open dist/TundraDB.app
# Test from command line
dist/TundraDB.app/Contents/MacOS/tundra_shell --help
# Check bundle structure
ls -la dist/TundraDB.app/Contents/-
Missing Dependencies
# Check what libraries are missing otool -L build/tundra_shell # The script should bundle all non-system libraries
-
Permission Denied
# Make sure scripts are executable chmod +x scripts/*.sh
-
Library Path Issues
# Check library paths are correctly updated otool -L dist/TundraDB-1.0.0-macOS/bin/tundra_shell # Should show @loader_path/../lib/... for bundled libraries
-
Gatekeeper Issues
# Remove quarantine attribute xattr -rd com.apple.quarantine TundraDB.app
# Enable verbose output in scripts
set -x # Add this to the top of scripts
# Check library loading
DYLD_PRINT_LIBRARIES=1 ./tundra_shell --help- Always test on a clean system without development dependencies
- Use Release builds for distribution (
-DCMAKE_BUILD_TYPE=Release) - Strip debug symbols to reduce size:
strip "${BUNDLE_DIR}/bin/tundra_shell" - Include comprehensive documentation and examples
- Version your releases consistently
- Test on multiple macOS versions if possible
You can automate distribution building with GitHub Actions:
# .github/workflows/release.yml
name: Build macOS Distribution
on:
release:
types: [created]
jobs:
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
brew install antlr4-cpp-runtime apache-arrow boost tbb libcds
- name: Build distribution
run: ./scripts/create_macos_bundle.sh
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: tundradb-macos
path: dist/This comprehensive approach gives you multiple distribution options depending on your target audience and use case.