On Fri, Dec 25, 2020 at 01:10:04PM -0500, Aisha Tammy wrote:
> Is there any tool like portgen but for cargo files?
> I haven't found any quick way to do this and add the dependencies.

the devel/cargo module has few target helpers to generate the
dependencies (but it might be not 100% correct depending the program).

it is (slightly) documented in port-modules man page (search for "cargo").

1. write your port without MODCARGO_CRATES lines

2. generate the MODCARGO_CRATES list from Cargo.lock

   $ make modcargo-gen-crates
   MODCARGO_CRATES +=   foocrate        1.0.0

(usually I am redirecting the output in a file, and next insert the file in the 
Makefile)

3. regenerate distinfo with new distfiles

   $ make makesum

4. generate the MODCARGO_CRATES list from extracted files (with license 
information)

   $ make modcargo-gen-crates-licenses
   MODCARGO_CRATES +=   foocrate        1.0.0   # ISC

(with redirection, and replacing the previous MODCARGO_CRATES list)


Having a proper tool integrated with portgen would be interesting.

Regards.
-- 
Sebastien Marie

Reply via email to