Commit Graph

12 Commits (8019cae69a6bb0b770c21757d3663df47f3f1828)

Author SHA1 Message Date
Alaric Senat 90729e2bd4 libvlc-sys: fix cross-platform va_list layout
bindgen spells the log callback's va_list parameter the way the host
that ran it does. The bindings are generated once and compiled
everywhere, so that spelling only happens to be right on the generating
host.
This was alright for most hosts but is fragile on aarch64 where va_list
is a plain 32 bytes struct.

Given we only forward the list to vsnprintf, extracting and simplifying
the cross-platform rust implementation from the unstable std-lib is
cheap and sound. We will just have to re-export the official type once
it's stablilized.
2026-08-25 14:57:31 +02:00
Alaric Senat cd6d404a1b libvlc-sys: re-generate the bindings
The previous bindings were built on an arbitrary host (my machine)
rather than the stable MSRV container we use for the CI.
2026-08-25 14:57:31 +02:00
Alaric Senat ce44dd0030 libvlc-sys: regenerate bindings via `cargo xtask bindgen` 2026-07-24 10:05:32 +02:00
Alaric Senat 0d57a4e242 build: replace the use-bindgen feature with a `cargo xtask bindgen` tool
Generating the FFI bindings at consumer build time is unecessary. The
`use-bindgen` Cargo feature was non-additive, and forced bindgen +
libclang onto every build that opted in, for a decision that is really
about the maintainer's environment, not the public API.

Move binding generation out of the build entirely, following the xtask
pattern[^1]:

- build.rs is reduced to locating and linking libvlc.
- Regeneration lives in a `xtask` crate, run with `cargo xtask bindgen`.

[^1]: <https://github.com/matklad/cargo-xtask>
2026-07-24 10:05:32 +02:00
Alaric Senat 13e5713e30 build: probe pkg-config once and drop the redundant vlc link
pkg-config was probed up to three times per build: once inside
generate_bindings for the header include paths, once for linking, and
then main unconditionally emitted `cargo:rustc-link-lib=vlc` on top of the
directives the successful probe already prints, libvlc ended up on
the link line two or three times.

Probe a single time in main and thread the resulting Library into
generate_bindings for its include paths. Drop the manual rustc-link-lib
line, since a successful pkg_config probe emits it.
2026-07-23 12:01:58 +02:00
Alaric Senat fe83e031af build: require libvlc >= 3.0.0 via pkg-config 2026-07-23 12:01:58 +02:00
Alaric Senat 656aa597fa build: bump bindgen to 0.72 and migrate to the allowlist API
bindgen 0.59, relied on the now-deprecated whitelist_* builder methods
and the bare CargoCallbacks unit struct. Move to 0.72 and its current
API.
2026-07-23 12:01:58 +02:00
Alaric Senat 9be21665c8 build: fix MSRV to 1.82
Found with cargo-msrv. The new requirement is brought by a subsequent
bindgen update
2026-07-23 12:01:58 +02:00
Alaric Senat 14198a352d build: bump rust edition
This is needed for a bindgen update and the crate will benefit from the
new languages features
2026-07-23 12:01:58 +02:00
Romain Roffé 12a22eb8a4 build: Use pkg-config to find vlc 2022-05-09 14:26:33 +02:00
Romain Roffé 55310d8bd3 Move libvlc link to libvlc-sys 2022-02-25 16:16:32 +01:00
Romain Roffé 34bd7b2988 Use bindgen
binding.rs generation with bindgen is optional.

By default, a pre-generated binding.rs is copied in OUT_DIR. This allows
for example to build on Windows and link against a standard VLC
installation.

Feature "use-bindgen" will trigger binding generation.
2022-02-25 16:05:10 +01:00