tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

wip/halloy: Update to 2024.14; packaging Rust crates that aren't on crates.io (i.e. Git snapshots)



I updated wip/halloy to 2024.14.

I managed to figure out a workflow for Rust packages that depend on
crates that aren't on crates.io (i.e. Git snapshots).

> Information for halloy-2024.14:
>
> Comment:
> IRC application written in Rust
>
> Description:
> Halloy is an open-source IRC client written in Rust, with the Iced GUI
> library. It aims to provide a simple and fast client for Mac, Windows,
> and Linux platforms.
>
> Features:
> * IRCv3.2 capabilities
> * SASL support
> * DCC Send
> * Keyboard shortcuts
> * Auto-completion for nicknames, commands, and channels
> * Notifications support
> * Multiple channels at the same time across servers
> * Commandbar for for quick actions
> * Custom themes
> * Portable mode
>
> Homepage:
> https://halloy.squidowl.org/

Briefly, the workflow looks something like:

1. Fetch and extract snapshots (I treated them as GITHUB_SUBMODULES for
now)

For each snapshot:

2a. Run 'cargo vendor' or
'CARGO_HOME=${WRKDIR} cargo vendor ${WRKDIR}/vendor' to fetch their
dependencies

2b. Generate a 'cargo-depends.mk' for these dependencies (I ended up
running the awk script under 'print-cargo-depends' by hand)

3a. Run 'cargo package --no-verify' to generate a crate file

3b. Extract the crate file to ${WRKDIR}/vendor

3c. Generate a dummy .cargo-checksum.json for the extracted crate

Afterwards:

4. Patch Cargo.toml to look for versioned crate instead of a snapshot
(in reality this would be in the patch phase)



There might be a problem automating this, because the snapshots
themselves may depend on other snapshots (so those will need to go
first, then the Cargo.toml will also need to be patched).  There might
also be special cases, like <https://github.com/iced-rs/iced/> being
the source of multiple crates (and so, needing to chdir and generate
each of them).

Also, the snapshots may occasionally be forks, but they still share the
same name and version as an actual packaged crate (e.g. iced depends on
forks of glyphon-0.5.0 and winit-0.30.1), so they might be missed at a
glance.



I'm not sure if it's appropriate for use outside pkgsrc-wip, but I was
able to try this on (for example, not committed) wip/mergigraf, and it
didn't take very long at all.

--
Iris


Home | Main Index | Thread Index | Old Index