Development Setup
This guide covers setting up a development environment for podkit on macOS, Linux, and Windows.
Overview
podkit requires the following dependencies for development:
| Dependency | Purpose | Required |
|---|---|---|
| Bun | JavaScript runtime and package manager | Yes |
| libgpod | C library for iPod database access | Yes (dev only — prebuilt binaries ship with releases) |
| FFmpeg | Audio transcoding (FLAC to AAC) | Yes |
| GLib 2.0 | C utility library (libgpod dependency) | Yes (dev only) |
| libplist | Apple property list library (libgpod dependency) | Yes (dev only) |
| gdk-pixbuf | Image handling for album artwork | Yes (dev only) |
Version Requirements
| Dependency | Minimum Version | Notes |
|---|---|---|
| Bun | 1.0+ | For development; distributes as Node.js |
| libgpod | 0.8.3 | Last release (2013), still functional |
| FFmpeg | 4.0+ | Needs AAC encoder support |
| GLib | 2.16+ | Required by libgpod |
| libplist | 2.3+ | Required for newer iPod support |
macOS
Prerequisites
Install Homebrew if not already installed:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Step 1: Install Bun
brew install oven-sh/bun/bunOr via the official installer:
curl -fsSL https://bun.sh/install | bashStep 2: Install FFmpeg
brew install ffmpegVerify AAC encoder support:
ffmpeg -encoders 2>/dev/null | grep aac# Should show: aac (native) and aac_at (AudioToolbox)Step 3: Build and Install libgpod
libgpod is not available in Homebrew, so we build from source. The podkit repo includes a build script:
cd tools/libgpod-macos./build.shThis will:
- Install Homebrew dependencies (libplist, gdk-pixbuf, autoconf, etc.)
- Download libgpod 0.8.3 source and required patches
- Build and install to
~/.local
Step 4: Configure Environment
Add to your shell profile (~/.zshrc or ~/.bashrc):
# libgpod (built from source)export PKG_CONFIG_PATH="$HOME/.local/lib/pkgconfig:$PKG_CONFIG_PATH"export DYLD_LIBRARY_PATH="$HOME/.local/lib:$DYLD_LIBRARY_PATH"Reload your shell:
source ~/.zshrc # or ~/.bashrcStep 5: Verify Installation
# Check Bunbun --version
# Check FFmpegffmpeg -version | head -1
# Check libgpodpkg-config --modversion libgpod-1.0# Expected: 0.8.3Linux
Debian / Ubuntu
# Install system dependenciessudo apt updatesudo apt install -y \ libgpod-dev \ ffmpeg \ libglib2.0-dev \ libplist-dev \ libgdk-pixbuf2.0-dev \ pkg-config
# Install Buncurl -fsSL https://bun.sh/install | bash
# Verifybun --versionffmpeg -encoders 2>/dev/null | grep aacpkg-config --modversion libgpod-1.0Fedora / RHEL
# Install system dependenciessudo dnf install -y \ libgpod-devel \ ffmpeg \ glib2-devel \ libplist-devel \ gdk-pixbuf2-devel \ pkg-config
# FFmpeg may require RPM Fusionsudo dnf install -y \ https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpmsudo dnf install -y ffmpeg
# Install Buncurl -fsSL https://bun.sh/install | bashArch Linux
sudo pacman -S libgpod ffmpeg glib2 libplist gdk-pixbuf2 pkg-configcurl -fsSL https://bun.sh/install | bashGetting the Code
git clone https://github.com/jvgomg/podkit.gitcd podkitbun installBuilding
# Build all packagesbun run build
# Build native bindingscd packages/libgpod-nodebun run build
# Build gpod-tool (C helper)mise run tools:buildmise trust # First time onlyBuilding a Standalone Binary
You can compile podkit into a single standalone executable using Bun. The binary embeds the JavaScript bundle and native libgpod addon — no runtime dependencies are needed (other than FFmpeg).
# Build dependencies and compile the CLI binarybun run compileThis builds all required packages (including native bindings) and produces packages/podkit-cli/bin/podkit, a self-contained binary for your current platform and architecture. You can copy it anywhere:
cp packages/podkit-cli/bin/podkit /usr/local/bin/podkitpodkit --versionRunning Tests
# Run all testsbun run test
# Run unit tests onlybun run test:unit
# Run integration testsbun run test:integration
# Run E2E tests (dummy iPod)bun run test:e2e
# Run tests for specific packagebun test packages/podkit-coreSee Testing for the full testing guide.
Development Commands
# Run CLI in development modebun run dev
# Lint (uses oxlint)bun run lintbun run lint:fix # Auto-fix lint issues
# Format (uses Prettier)bun run format # Format all filesbun run format:check # Check formatting without writing
# Type check all packagesbun run typecheck
# Clean all build artifacts and node_modulesbun run cleanNote: builds and tests are orchestrated with Turborepo for caching and parallelism.
Project Structure
podkit/+-- packages/| +-- e2e-tests/ # End-to-end CLI tests| +-- gpod-testing/ # Test utilities for iPod environments| +-- libgpod-node/ # Native Node.js bindings for libgpod| +-- podkit-core/ # Core sync logic, adapters, transcoding| +-- podkit-cli/ # Command-line interface|+-- tools/| +-- gpod-tool/ # C CLI for iPod database operations| +-- libgpod-macos/ # macOS build scripts for libgpod|+-- docs/ # Documentation+-- test/ # Shared test fixturesNext Steps
- Testing - Testing strategy and conventions
- Architecture - Component design
- ADRs - Architecture decision records
Troubleshooting
libgpod build fails (macOS)
Ensure Homebrew packages are properly linked:
brew link --force libplist gdk-pixbuf gettextpkg-config can’t find libgpod
Verify your PKG_CONFIG_PATH includes ~/.local/lib/pkgconfig:
echo $PKG_CONFIG_PATHpkg-config --variable=pc_path pkg-configRuntime: library not found
Ensure DYLD_LIBRARY_PATH is set:
echo $DYLD_LIBRARY_PATH