Commit graph

3 commits

Author SHA1 Message Date
Tobias Kortkamp
6b1b157425
cargo.mk: Strip vV from GitHub tags only when followed by a digit
Fixes the following in games/veloren-weekly when iced crates have a tag
similar to veloren-winit-0.28

$ cd games/veloren-weekly
$ make cargo-crates-merge
$ make
[...]
===>  Configuring for veloren-weekly-s20230830
===>   Cargo config:
find: /usr/ports/games/veloren-weekly/work/egui_winit_platform-eloren-winit-0.28: No such file or directory
find: /usr/ports/games/veloren-weekly/work/iced-eloren-winit-0.28: No such file or directory
find: /usr/ports/games/veloren-weekly/work/iced-eloren-winit-0.28: No such file or directory
find: /usr/ports/games/veloren-weekly/work/iced-eloren-winit-0.28: No such file or directory
find: /usr/ports/games/veloren-weekly/work/iced-eloren-winit-0.28: No such file or directory
find: /usr/ports/games/veloren-weekly/work/iced-eloren-winit-0.28: No such file or directory
find: /usr/ports/games/veloren-weekly/work/iced-eloren-winit-0.28: No such file or directory
[...]
[patch.'https://gitlab.com/Imbris/keyboard-keynames.git']
keyboard-keynames = { path = '/usr/ports/games/veloren-weekly/work/keyboard-keynames-veloren-winit-0.28-fca4bbdfa51bf054b155a455935b3792975c989d' }
[...]
[patch.'https://github.com/Imberflur/egui_winit_platform.git']
egui_winit_platform = { path = '/usr/ports/games/veloren-weekly/work/egui_winit_platform-eloren-winit-0.28' }
[...]
[patch.'https://github.com/Imberflur/iced']
iced_core = { path = '/usr/ports/games/veloren-weekly/work/iced-eloren-winit-0.28' }
iced_futures = { path = '/usr/ports/games/veloren-weekly/work/iced-eloren-winit-0.28' }
iced_graphics = { path = '/usr/ports/games/veloren-weekly/work/iced-eloren-winit-0.28' }
iced_native = { path = '/usr/ports/games/veloren-weekly/work/iced-eloren-winit-0.28' }
iced_style = { path = '/usr/ports/games/veloren-weekly/work/iced-eloren-winit-0.28' }
iced_winit = { path = '/usr/ports/games/veloren-weekly/work/iced-eloren-winit-0.28' }
[...]
===>   Updating Cargo.lock
error: failed to load source for dependency `iced_core`

Caused by:
  Unable to update /usr/ports/games/veloren-weekly/work/iced-eloren-winit-0.28

Caused by:
  failed to read `/usr/ports/games/veloren-weekly/work/iced-eloren-winit-0.28/Cargo.toml`

Caused by:
  No such file or directory (os error 2)
*** Error code 101

Stop.
make[1]: stopped in /usr/ports/games/veloren-weekly

PR:		273468
Reported by:	jbeich
2023-10-02 13:33:25 +02:00
Tobias Kortkamp
18052912af
Uses/cargo: Fix invalid WRKSRC for crates fetched from GitLab with tag
When using tags the archive fetched from GitLab has the
corresponding commit hash appended to the directory root too.

snui@git+https://gitlab.com/snakedye/snui.git?tag=v0.1.4\#83873f1e148a9c84471c10f166c9a945a44d3e64

would result in

WRKSRC_crate_snui=	${WRKDIR}/snui-v0.1.4

but it must be

WRKSRC_crate_snui=	${WRKDIR}/snui-v0.1.4-83873f1e148a9c84471c10f166c9a945a44d3e64

PR:		266724
Reported by:	jbeich
2022-10-08 14:21:19 +02:00
Tobias Kortkamp
2bad8d171a
Uses/cargo: Rework git source support based on patch-in-config sections
Git sources from `Cargo.lock` are added to `CARGO_CRATES` through
the normal mechanism of `make cargo-crates` by the porter.  They
are used to populate `MASTER_SITES`, `DISTFILES` with static
git-archive(1) tarballs a la `USE_GITHUB`, `USE_GITLAB`.  In the
configure phase we generate `[patch]` sections in the config file
which will cause `cargo update` to auto-update `Cargo.lock` to point
to the appropriate extraction directories.

Normally `cargo update` would connect to the network to update all
Git sources but since rust-1.55.0 our cargo has been patched to
skip this when `CARGO_FREEBSD_PORTS_SKIP_GIT_UPDATE` is set in the
environment.

This replaces the old `CARGO_USE_GITHUB`, `CARGO_USE_GITLAB` hacks
where this was done by editing all `Cargo.toml` with sed(1) calls.

Additionally, we try to automatically infer the individiual crate
sub-directories inside the Git sources based on `package.name` in
`Cargo.toml` to remove the need for `CARGO_GIT_SUBDIR`.

USES=cargo also now sets `WRKSRC_crate_$name` for each crate to
point to the crate extraction directories.

PR:		256581
Reviewed by:	jbeich
2021-10-25 10:49:06 +02:00