feat: phase 0 — cargo workspace, vendored libgpod, bindgen smoke test #1

Merged
wokoman merged 0 commits from refs/pull/1/head into main 2026-05-12 12:32:01 +02:00
wokoman commented 2026-05-12 12:02:34 +02:00 (Migrated from code.nolog.cz)

Sets up the Cargo workspace, the internal libgpod-sys crate, and the bindgen + cc pipeline that compiles libgpod's vendored C sources and exposes them to Rust. See SPEC.md "Phase 0" for the full scope.

What's in the diff

  • Cargo workspace (Cargo.toml, rust-toolchain.toml, .gitignore, MIT LICENSE, build-prereq README.md).
  • crates/libgpod-sys/ with links = "gpod", publish = false, default vendored feature.
  • Vendored libgpod from gtkpod/libgpod at 7982c55 (gtkpod/main) under crates/libgpod-sys/vendor/: 25 .c + 17 .h + LGPL-2.1+ COPYING. Two stub files (db-artwork-debug.c, itdb_iphone.c) are skipped at build time — they're empty without DEBUG_ARTWORKDB / HAVE_LIBIMOBILEDEVICE.
  • Hand-rolled vendor/config.h with HAVE_GDKPIXBUF, HAVE_LIBXML, HAVE_ZLIB, plus glib 2.22+ feature defines (HAVE_G_INT64_HASH, HAVE_G_INT64_EQUAL, HAVE_G_CHECKSUM_RESET). Replaces the autotools-generated config.h.
  • build.rs probes glib-2.0, gobject-2.0, gmodule-2.0, gdk-pixbuf-2.0, sqlite3, libxml-2.0, zlib, and libplist-2.0 (with 1.0 fallback) via pkg-config, then forwards the include paths to both cc and bindgen. Bindgen allowlists itdb_.* / Itdb_.* / GList / GError; GdkPixbuf stays opaque.
  • src/lib.rs in libgpod-sys with include!(bindings.rs) and an itdb_new / itdb_free smoke test.
  • src/main.rs + src/ipod/mod.rs stubs for the binary.

Verification

  • cargo build clean, no warnings (legacy C warnings suppressed at the build level).
  • cargo test -p libgpod-sysitdb_new_free_roundtrip ... ok.
  • cargo runironpod (phase 0 skeleton).
  • cargo fmt --all -- --check and cargo clippy --all-targets -- -D warnings both clean.

Tested on macOS aarch64 with Homebrew-provided glib 2.88, gdk-pixbuf 2.44, libplist 2.7. Linux build prerequisites documented in README.md.

Out of scope

Phase 1 (safe wrapper in src/ipod/), tag reading, copy engine, TUI — all per SPEC.md.

Sets up the Cargo workspace, the internal `libgpod-sys` crate, and the bindgen + cc pipeline that compiles libgpod's vendored C sources and exposes them to Rust. See `SPEC.md` "Phase 0" for the full scope. ## What's in the diff - Cargo workspace (`Cargo.toml`, `rust-toolchain.toml`, `.gitignore`, MIT `LICENSE`, build-prereq `README.md`). - `crates/libgpod-sys/` with `links = "gpod"`, `publish = false`, default `vendored` feature. - Vendored libgpod from `gtkpod/libgpod` at `7982c55` (gtkpod/main) under `crates/libgpod-sys/vendor/`: 25 `.c` + 17 `.h` + LGPL-2.1+ `COPYING`. Two stub files (`db-artwork-debug.c`, `itdb_iphone.c`) are skipped at build time — they're empty without `DEBUG_ARTWORKDB` / `HAVE_LIBIMOBILEDEVICE`. - Hand-rolled `vendor/config.h` with `HAVE_GDKPIXBUF`, `HAVE_LIBXML`, `HAVE_ZLIB`, plus glib 2.22+ feature defines (`HAVE_G_INT64_HASH`, `HAVE_G_INT64_EQUAL`, `HAVE_G_CHECKSUM_RESET`). Replaces the autotools-generated `config.h`. - `build.rs` probes `glib-2.0`, `gobject-2.0`, `gmodule-2.0`, `gdk-pixbuf-2.0`, `sqlite3`, `libxml-2.0`, `zlib`, and `libplist-2.0` (with `1.0` fallback) via `pkg-config`, then forwards the include paths to both `cc` and `bindgen`. Bindgen allowlists `itdb_.*` / `Itdb_.*` / `GList` / `GError`; `GdkPixbuf` stays opaque. - `src/lib.rs` in libgpod-sys with `include!(bindings.rs)` and an `itdb_new` / `itdb_free` smoke test. - `src/main.rs` + `src/ipod/mod.rs` stubs for the binary. ## Verification - `cargo build` clean, no warnings (legacy C warnings suppressed at the build level). - `cargo test -p libgpod-sys` → `itdb_new_free_roundtrip ... ok`. - `cargo run` → `ironpod (phase 0 skeleton)`. - `cargo fmt --all -- --check` and `cargo clippy --all-targets -- -D warnings` both clean. Tested on macOS aarch64 with Homebrew-provided glib 2.88, gdk-pixbuf 2.44, libplist 2.7. Linux build prerequisites documented in `README.md`. ## Out of scope Phase 1 (safe wrapper in `src/ipod/`), tag reading, copy engine, TUI — all per `SPEC.md`.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
wokoman/ironpod!1
No description provided.