Index | Thread | Search

From:
"emulti@disroot.org" <emulti@disroot.org>
Subject:
[WIP]/help wanted: browserpass-native messaging host for pass/password-store
To:
ports@openbsd.org
Date:
Mon, 7 Jul 2025 15:30:16 +0800

Download raw body.

Thread
A browser plugin 'browserpass' exists for Firefox/Chromium that
interfaces with the 'pass' password manager (password-store package).
In my testing it is light and fast, and improvement on the likes of
keepassxc-browser.

It requires a 'native messaging' binary written in Go, that supports
pledge() on OpenBSD.

Upstream: https://github.com/browserpass/browserpass-native/

Installing manually was a bit of a pain, requiring patches to the
provided Makefile to get around incompatibilities between sed and GNU
sed, install and GNU install. 

I tried to use the MODULES= lang/go infrastructure in
lang/go/go.port.mk, but no distribution file can be found:

===>  Checking files for browserpass-native-3.1.0
>> Fetch
>> https://proxy.golang.org/github.com/browserpass/browserpass-native/@v/v3.1.0.zip
ftp: Error retrieving
https://proxy.golang.org/github.com/browserpass/browserpass-native/@v/v3.1.0.zip:
404 Not Found ... 

I expected go to then head off and retrieve the distfile from github, as
but it just cycles through the standard ftp.openbsd.org etcetera. So I
fell back to using GH_ACCOUNT and friends.

I then tried building the port using this Makefile:

COMMENT=	Native Messaging host for the Browserpass browser plugin
ONLY_FOR_ARCHS = amd64

DISTNAME=	browserpass-native-3.1.0
CATEGORIES=	security
EXTRACT_SUFX=	.zip
HOMEPAGE=	https://github.com/browserpass/browserpass-native
MAINTAINER=	Chris Billington <emulti@disroot.org>

# ISC License
PERMIT_PACKAGE=	Yes

# uses pledge()
WANTLIB += c pthread

GH_ACCOUNT =            browserpass
GH_PROJECT =            browserpass-native
GH_TAGNAME =            3.1.0

#MODULES=	lang/go
#MODGO_MODNAME = github.com/browserpass/browserpass-native
#MODGO_VERSION = v3.1.0

RUN_DEPENDS=	
                
USE_GMAKE=	Yes

#WRKDIST=        ${WRKDIR}/github.com/browserpass/browserpass-native@$
#{MODGO_VERSION}

.include <bsd.port.mk>

Tarball of the WIP port is also attached.

'make build' gives the following (ports tree is owned by myuser/wsrc):

$ make build
===>  Generating configure for browserpass-native-3.1.0
===>  Configuring for browserpass-native-3.1.0
===>  Building for browserpass-native-3.1.0
env GOOS=openbsd GOARCH=amd64 go build -o browserpass-openbsd64
failed to initialize build cache
at /browserpass-native-3.1.0_writes_to_HOME/.cache/go-build:
mkdir /browserpass-native-3.1.0_writes_to_HOME: permission denied
gmake: *** [Makefile:48: browserpass-openbsd64] Error 1 *** Error 2
in . (/usr/ports/infrastructure/mk/bsd.port.mk:3069
'/usr/ports/pobj/browserpass-native-3.1.0/.build_done':
@cd /usr/ports/pobj/...) *** Error 2
in /usr/ports/security/browserpass-native
(/usr/ports/infrastructure/mk/bsd.port.mk:2712 'build':
@lock=browserpass-native-3.1.0...)

Running 'doas make build' works, but the cache is put in 
/browserpass-native-3.1.0_writes_to_HOME/ which I'm sure can't be right.

Continuing, make install returns silently without doing
anything. But running make install manually on the patched Makefile
in the WRKDIR, it works. But I'm confused about what's going wrong with
the port.

Please can someone with more experience of the Ports framework point me
to where I am going wrong?

-- 
Chris <emulti@disroot.org>