Index | Thread | Search

From:
Manuel Kuklinski <mk@asdfghasdfgh.de>
Subject:
net/matrirc: create port, "--offline mode" error (download crates from github.com)
To:
ports@openbsd.org
Date:
Thu, 15 Feb 2024 07:51:15 +0100

Download raw body.

Thread
Hi!

Please excuse my e-mail - I already searched google.com and asked on
#openbsd at libera.chat but haven't got a satisfying answer. The problem
is as follows:

I want to create a new port, namely net/matrirc
(https://github.com/martinetd/matrirc). It's an irc to matrix bridge,
written in rust, that supports e2e ecnryption. I created a skeleton
Makefile (excuse the formatting):

- - - - - - - - - - %< - - - - - - - - - -

COMMENT =       		Simple IRCD bridging to matrix

CATEGORIES =    		net

C =             		1.0/049db4d8f0f102a571bbf948bb6777909d7debed
VERSION =       		1.0
DIST_TUPLE =    		github martinetd matrirc ${C} .
WRKDIST =       		${WRKDIR}/matrirc-1.0
DISTNAME =      		matrirc-1.0

PERMIT_PACKAGE =        Yes

MODULES =       		devel/cargo

CONFIGURE_STYLE =		cargo

SEPARATE_BUILD =        Yes

PREFIX =        		${VARBASE}
INSTDIR =       		${PREFIX}/matrirc

.include "crates.inc"

.include <bsd.port.mk>

- - - - - - - - - - %< - - - - - - - - - -

I then created crates.inc with the help of abieber@'s script
(https://deftly.net/posts/2023-09-05-cargo-updates.html):

- - - - - - - - - - %< - - - - - - - - - -

#!/bin/sh

set -eu

PORT="$(make show=PKGNAME)"

mv -v crates.inc crates.old
touch crates.inc
make makesum
make modcargo-gen-crates > /tmp/${PORT}.crates.inc
grep ^MODCARGO /tmp/${PORT}.crates.inc > crates.inc
make clean
make makesum
make modcargo-gen-crates-licenses > /tmp/${PORT}.license.inc
grep ^MODCARGO /tmp/${PORT}.license.inc > crates.inc
rm crates.old
make clean
make && make package

- - - - - - - - - - %< - - - - - - - - - -

But make fails with the following error:

- - - - - - - - - - %< - - - - - - - - - -

===>  Building for matrirc-1.0
error: failed to get `irc` as a dependency of package `matrirc v0.1.0 (/usr/obj/ports/matrirc-1.0/matrirc-1.0)`

Caused by:
  failed to load source for dependency `irc`

Caused by:
  Unable to update https://github.com/aatxe/irc?rev=709151b94d9f92a79758e706e6bea219b449e56f#709151b9

Caused by:
  can't checkout from 'https://github.com/aatxe/irc': you are in the offline mode (--offline)

- - - - - - - - - - %< - - - - - - - - - -

My question is as follows: how do I get cargo to download the necessary
crates from github.com, without modifying:
	
	/usr/ports/devel/cargo/cargo.port.mk

Thank you for reading.

Best wishes.