Skip to content

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:

DependencyPurposeRequired
BunJavaScript runtime and package managerYes
libgpodC library for iPod database accessYes (dev only — prebuilt binaries ship with releases)
FFmpegAudio transcoding (FLAC to AAC)Yes
GLib 2.0C utility library (libgpod dependency)Yes (dev only)
libplistApple property list library (libgpod dependency)Yes (dev only)
gdk-pixbufImage handling for album artworkYes (dev only)

Version Requirements

DependencyMinimum VersionNotes
Bun1.0+For development; distributes as Node.js
libgpod0.8.3Last release (2013), still functional
FFmpeg4.0+Needs AAC encoder support
GLib2.16+Required by libgpod
libplist2.3+Required for newer iPod support

macOS

Prerequisites

Install Homebrew if not already installed:

Terminal window
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Step 1: Install Bun

Terminal window
brew install oven-sh/bun/bun

Or via the official installer:

Terminal window
curl -fsSL https://bun.sh/install | bash

Step 2: Install FFmpeg

Terminal window
brew install ffmpeg

Verify AAC encoder support:

Terminal window
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:

Terminal window
cd tools/libgpod-macos
./build.sh

This will:

  1. Install Homebrew dependencies (libplist, gdk-pixbuf, autoconf, etc.)
  2. Download libgpod 0.8.3 source and required patches
  3. Build and install to ~/.local

Step 4: Configure Environment

Add to your shell profile (~/.zshrc or ~/.bashrc):

Terminal window
# 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:

Terminal window
source ~/.zshrc # or ~/.bashrc

Step 5: Verify Installation

Terminal window
# Check Bun
bun --version
# Check FFmpeg
ffmpeg -version | head -1
# Check libgpod
pkg-config --modversion libgpod-1.0
# Expected: 0.8.3

Linux

Debian / Ubuntu

Terminal window
# Install system dependencies
sudo apt update
sudo apt install -y \
libgpod-dev \
ffmpeg \
libglib2.0-dev \
libplist-dev \
libgdk-pixbuf2.0-dev \
pkg-config
# Install Bun
curl -fsSL https://bun.sh/install | bash
# Verify
bun --version
ffmpeg -encoders 2>/dev/null | grep aac
pkg-config --modversion libgpod-1.0

Fedora / RHEL

Terminal window
# Install system dependencies
sudo dnf install -y \
libgpod-devel \
ffmpeg \
glib2-devel \
libplist-devel \
gdk-pixbuf2-devel \
pkg-config
# FFmpeg may require RPM Fusion
sudo dnf install -y \
https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install -y ffmpeg
# Install Bun
curl -fsSL https://bun.sh/install | bash

Arch Linux

Terminal window
sudo pacman -S libgpod ffmpeg glib2 libplist gdk-pixbuf2 pkg-config
curl -fsSL https://bun.sh/install | bash

Getting the Code

Terminal window
git clone https://github.com/jvgomg/podkit.git
cd podkit
bun install

Building

Terminal window
# Build all packages
bun run build
# Build native bindings
cd packages/libgpod-node
bun run build
# Build gpod-tool (C helper)
mise run tools:build
mise trust # First time only

Building 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).

Terminal window
# Build dependencies and compile the CLI binary
bun run compile

This 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:

Terminal window
cp packages/podkit-cli/bin/podkit /usr/local/bin/podkit
podkit --version

Running Tests

Terminal window
# Run all tests
bun run test
# Run unit tests only
bun run test:unit
# Run integration tests
bun run test:integration
# Run E2E tests (dummy iPod)
bun run test:e2e
# Run tests for specific package
bun test packages/podkit-core

See Testing for the full testing guide.

Development Commands

Terminal window
# Run CLI in development mode
bun run dev
# Lint (uses oxlint)
bun run lint
bun run lint:fix # Auto-fix lint issues
# Format (uses Prettier)
bun run format # Format all files
bun run format:check # Check formatting without writing
# Type check all packages
bun run typecheck
# Clean all build artifacts and node_modules
bun run clean

Note: 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 fixtures

Next Steps

Troubleshooting

libgpod build fails (macOS)

Ensure Homebrew packages are properly linked:

Terminal window
brew link --force libplist gdk-pixbuf gettext

pkg-config can’t find libgpod

Verify your PKG_CONFIG_PATH includes ~/.local/lib/pkgconfig:

Terminal window
echo $PKG_CONFIG_PATH
pkg-config --variable=pc_path pkg-config

Runtime: library not found

Ensure DYLD_LIBRARY_PATH is set:

/Users/yourname/.local/lib
echo $DYLD_LIBRARY_PATH