rust/cargo.mk: add CARGO_GITHUB_CRATES

Thomas Klausner <[email protected]> Sun, 26 Apr 2026 23:05:39 +0200
Newsgroups gmane.os.netbsd.devel.packages
Message-ID <[email protected]>
Hi!

I've just added better support for using crates in rust packages that
are pulled in with git from github.

Previously this need a couple lines in the Makefile and a patch to
Cargo.toml, like this:

Makefile:
LSP_TYPES_REV= e15db0593f0ecbbd80599c3f5880e4bf5da1ca0c
DISTFILES+=    lsp-types-${LSP_TYPES_REV}.tar.gz

SITES.lsp-types-${LSP_TYPES_REV}.tar.gz+=      -${MASTER_SITE_GITHUB:=astral-sh/}lsp-types/archive/${LSP_TYPES_REV}.tar.gz

Cargo.toml:
-lsp-types = { git = "https://github.com/astral-sh/lsp-types.git", rev = "e15db0593f0ecbbd80599c3f5880e4bf5da1ca0c", features = [
+lsp-types = { path = "../lsp-types-e15db0593f0ecbbd80599c3f5880e4bf5da1ca0c", features = [


This is now just:
CARGO_GITHUB_CRATES+=  astral-sh lsp-types e15db0593f0ecbbd80599c3f5880e4bf5da1ca0c

in the Makefile.

Cheers,
 Thomas