TagLib packaged for Swift Package Manager.
spfk-taglib is an independent SPM repackaging of taglib/taglib, the C++ audio metadata library. The source tree mirrors upstream TagLib's directory layout — headers live alongside their .cpp files in format-specific subdirectories — making syncs with upstream a straightforward directory-level diff.
The current upstream base is TagLib 2.3 (tracked via SPFK_TAGLIB_UPSTREAM_VERSION in taglib_config.h).
Public headers are colocated with their implementations (matching upstream) and exposed to SPM via symlinks in include/taglib/. A module.modulemap defines the taglib and taglib_c modules. Run scripts/update-symlinks.sh after adding or removing public headers.
The directory layout mirrors upstream TagLib, so syncing is a bulk mirror of upstream's taglib/ directory into Sources/taglib/ via rsync --delete, preserving the SPM-specific paths (include/, utfcpp/, toolkit/taglib_config.h) and stripping build-system files (CMakeLists.txt, *.cmake, etc.).
For new format modules introduced upstream, add the corresponding headerSearchPath entries to Package.swift, add public headers to module.modulemap, and run scripts/update-symlinks.sh.
On tagged upstream releases, bump SPFK_TAGLIB_UPSTREAM_VERSION in Sources/taglib/toolkit/taglib_config.h and the version line in this README.
This package uses its own semantic versioning starting at 1.0.0, independent of upstream TagLib version numbers. The upstream TagLib revision is tracked in taglib_config.h.
Add to your Package.swift:
dependencies: [
.package(url: "https://github.com/ryanfrancesconi/spfk-taglib", from: "1.0.0"),
],
targets: [
.target(
name: "YourTarget",
dependencies: [
.product(name: "taglib", package: "spfk-taglib"),
]
),
]Swift bindings and higher-level metadata functionality are provided by SPFKMetadata, which wraps spfk-taglib's C++ API in a native Swift interface.