Package: dh-rust
Version: 0.0.5
Severity: wishlist

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

An upstream project may consist of multiple parts,
each versioned differently,
where binary packages need to include tracking
of the version(s) contained subprojects.

One example is Mediasoup,
where the NodeJS NPM project "mediasoup" version 3.13.12
contains the Rust Cargo subproject "mediasoup" version 0.13.0.

Another example is Oxigraph,
where an unnambed Rust Cargo workspace version 0.4.0-alpha.7
contains crate "oxigraph" versioned same as the workspace
and crate "oxrdf" version 0.2.0-alpha.5
(as well as other crates, irrelevant for this example).

D::D::Buildsystem::rust already resolves the version of each crate
in a Cargo multi-crate workspace.

I think dh_rust should introduce two debhelper scripts:

## dh_rust_substvars

Resolves ${rustPkg_PKG:Version} variable for each subproject,
where PKG is the real of virtual package providing the subproject,
and the value is the Debian version derived from subproject version
and source package version.

For Mediasoup, it should resolve this variable:

rustPkg-librust-mediasoup-dev:Version=0.13.0+3.13.12

For Oxigraph, it should resolve these variables:

rustPkg-oxigraph:Version=0.4.0~alpha7
rustPkg-librust-oxrdf-dev:Version=0.2.0~alpha5+0.4.0~alpha7

## dh_rust_gencontrol

Sets ${rustPkg_PKG:Version} for virtual and real rust-* packages.

Multiple packages would benefit from this,
currently duplicating a pattern of overriding dh_gencontrol
with multiple custom calls to custom make function crate_version(),
which crudely resolves crate versions using a regex.

 - Jonas

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEn+Ppw2aRpp/1PMaELHwxRsGgASEFAmaWTxUACgkQLHwxRsGg
ASGodRAArRUu5/iyyS96NYFdU3zZhlDzaMOuYMrioWD9iqh+G6/9x7dnquWp80p+
hzCf51Muwc6QruLRzdgaRoUhcm4mWdrF5IpNaYItEh7RkDnlVmLTzVhvVyo/D+G8
mGGaLkFhqLrDyApG6cq+HaIF8kkUasbFHbybzOFfCJhozIb53Tm15T9/GGi1MY/D
jFS8587C2iPiQrVwwhYb+PHYOoKcfqtQHnhS8Yf2KVsFQywq0j3DdQ83wWsdZXpz
aW14whp+24wG/e7F1kzxxLX+tttn+eq8twTg4tDOWmm+DyTQZiqaNwTDZAxOcEWT
OYMxLBWUMKQGOpqXrIWrItVGdthE4oLRCWtALft818qwkUMjmN5O1xkCfJPwklvc
8rRhreT+Tt6s1m/j18ftgTiUMxc2HjulOrn9nRrHi8aM9N+lz/T8sIjGga5l3Fc+
R3Vnf24crO/XcYfPA33wJxNnLf191yfcSBjcMkSS3UdB0IEoAR//r+83CTbhvWPX
UFe6KbZO8B+3s/W+MvT38qG+jA37IudZMR7mMctsvepBJsYPQdvKAn1RpXbN1JvD
88MPvF5F0U+6aLhJIMCmHxPF302+90C7LneUwBcVABAESi6njm7Si0cGsbA9Pam0
z+WKakcrPX48Atx6TFkRfJccC2XlsYENN8p+4oPxqM2Bt97qniA=
=TgiU
-----END PGP SIGNATURE-----

Reply via email to