Sunday, January 31, 2021

Re: Packaging rust code

On Sun, Jan 31, 2021 at 08:36:59PM +0000, Sven Assmann wrote:
> Hi Dear OpenBSD ports folks,
>
> My name is Sven and I'm very new to openBSD (have some FreeBSD experience from >10years ago).
>
> I'm an author and maintainer of some rust cli tools and I'm totally new to preparing ports packages, have done deb, rpm and homebrew so far.
>
> My question is about the build system to be used to prepare binary packages. Since those tools are build with cargo, the rust default build tool and rustc and cargo are both available on openBSD is there anything special to keep in mind?
>
> Maybe somebody has already packaged some rust tools, then I would appreciate to Point me to an example.

There are several rust tools which are already packaged.

A near to complete list is:

audio/ncspot
benchmarks/hyperfine
devel/cbindgen
devel/snare
devel/spidermonkey78
mail/mozilla-thunderbird
net/dog
net/routinator
security/sn0int
security/suricata
sysutils/exa
textproc/mdbook
textproc/ripgrep
www/castor
www/firefox-esr
www/geckodriver
www/mozilla-firefox
www/newsboat
www/seamonkey
www/seamonkey,-lightning
www/tor-browser/browser
www/zola
x11/gnome/librsvg
x11/gnome/tour
x11/xcolor

Some of them have installation based on cargo (nccspot, ripgrep, exa,
...) and some others have complex installation and a part of it is
using cargo (mozilla-firefox, suricata, ...)

If you want to package simple rust tools, the simpler is too look at
these ports for having a template. But preparing a port isn't a
trivial operation for a new comer.

You should also take a look at devel/cargo module, which handle the
cargo/rust part of the port infrastructure. Documentation is at
port-modules(5) man page (see https://man.openbsd.org/port-modules),
and search for "devel/cargo".

Thanks.
--
Sebastien Marie

No comments:

Post a Comment