How to package rust bindings properly?

Dear packagers, how does one package "rust bindings" properly? In my case I seem to require the magnum-opus "Safe Rust bindings for libopus" as a dependency for another package, so I gave it a try. It compiles, but due to missing rust knowledge I have no clue how to install/package the resulting files.
https://build.opensuse.org/package/show/home:ojkastl_buildservice:Branch_X11...
This is what is in the "release" directory created by the build:
Any ideas or RTFM? Kind Regards, Johannes

Hi, In general we don't package rust libraries as standalone packages, so I think your solution is to vendor it together with the other rust dependencies. Looks like it doesn't build correctly in the vendored version ( https://build.opensuse.org/package/live_build_log/home:ojkastl_buildservice:...). Often it helps to just regenerate the vendor tarball, or you might find some tricks how to fix it here: https://en.opensuse.org/openSUSE:Packaging_Rust_Software#Patching_vendored_c... Best regards, Nico On Sat, Mar 22, 2025 at 9:38 AM Johannes Kastl <mail@johannes-kastl.de> wrote:
-- Nico Krapp Linux Engineer Packaging SUSE Software Solutions Germany GmbH Frankenstraße 146, 90461 Nürnberg, Germany Geschäftsführer: Ivo Totev, Andrew McDonald, Werner Knoblich (HRB 36809, AG Nürnberg)

Hi Nico, On 24.03.25 10:27 Nico Krapp wrote:
Hi,
In general we don't package rust libraries as standalone packages, so I
Yes, this has worked well using the cargo_vendor service on other packages.
think your solution is to vendor it together with the other rust dependencies. Looks like it doesn't build correctly in the vendored version
I think I'll abandon the separate package idea and try to get the version in the original package to build. Let's see how it goes. Kind Regards, Johannes

Hi, In general we don't package rust libraries as standalone packages, so I think your solution is to vendor it together with the other rust dependencies. Looks like it doesn't build correctly in the vendored version ( https://build.opensuse.org/package/live_build_log/home:ojkastl_buildservice:...). Often it helps to just regenerate the vendor tarball, or you might find some tricks how to fix it here: https://en.opensuse.org/openSUSE:Packaging_Rust_Software#Patching_vendored_c... Best regards, Nico On Sat, Mar 22, 2025 at 9:38 AM Johannes Kastl <mail@johannes-kastl.de> wrote:
-- Nico Krapp Linux Engineer Packaging SUSE Software Solutions Germany GmbH Frankenstraße 146, 90461 Nürnberg, Germany Geschäftsführer: Ivo Totev, Andrew McDonald, Werner Knoblich (HRB 36809, AG Nürnberg)

Hi Nico, On 24.03.25 10:27 Nico Krapp wrote:
Hi,
In general we don't package rust libraries as standalone packages, so I
Yes, this has worked well using the cargo_vendor service on other packages.
think your solution is to vendor it together with the other rust dependencies. Looks like it doesn't build correctly in the vendored version
I think I'll abandon the separate package idea and try to get the version in the original package to build. Let's see how it goes. Kind Regards, Johannes
participants (2)
-
Johannes Kastl
-
Nico Krapp