git: 687ab26524e5 - main - security/vaultwarden: Optionsize database backends

From: Bernard Spil <brnrd_at_FreeBSD.org>
Date: Wed, 08 Nov 2023 13:26:59 UTC
The branch main has been updated by brnrd:

URL: https://cgit.FreeBSD.org/ports/commit/?id=687ab26524e52c866295a9ff5c7956fd5f71397f

commit 687ab26524e52c866295a9ff5c7956fd5f71397f
Author:     Bernard Spil <brnrd@FreeBSD.org>
AuthorDate: 2023-11-08 13:25:53 +0000
Commit:     Bernard Spil <brnrd@FreeBSD.org>
CommitDate: 2023-11-08 13:25:53 +0000

    security/vaultwarden: Optionsize database backends
    
    PR:             274049
    Approved by:    maintainer timeout
---
 security/vaultwarden/Makefile | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/security/vaultwarden/Makefile b/security/vaultwarden/Makefile
index 5bfd4a965a44..4b5ff8f8e64a 100644
--- a/security/vaultwarden/Makefile
+++ b/security/vaultwarden/Makefile
@@ -14,7 +14,7 @@ LIB_DEPENDS+=	libcapnp.so:devel/capnproto \
 		libgmp.so:math/gmp \
 		libnettle.so:security/nettle
 
-USES=		cargo mysql:client pgsql ssl
+USES=		cargo ssl
 
 # make makeplist > pkg-plist #One has to edit/review the generated plist
 # make generate-plist && make check-plist
@@ -27,15 +27,23 @@ GROUPS=		${WWWGRP}
 PLIST_SUB=	WWWOWN=${WWWOWN} WWWGRP=${WWWGRP}
 
 OPTIONS_DEFINE=	WEBVAULT
-OPTIONS_DEFAULT=WEBVAULT
+OPTIONS_DEFAULT=${OPTIONS_DEFINE} ${OPTIONS_MULTI_DATABASE}
+OPTIONS_MULTI=	DATABASE
+OPTIONS_MULTI_DATABASE=	MYSQL PGSQL SQLITE
 
+DATABASE_DESC=	Database support
 WEBVAULT_DESC=	Vaultwarden web (bw_web_builds)
 
+MYSQL_USES=	mysql:client
+MYSQL_VARS=	cargo_features+=mysql
+PGSQL_USES=	pgsql
+PGSQL_VARS=	cargo_features+=postgresql
+SQLITE_VARS=	cargo_features+=sqlite
 WEBVAULT_RUN_DEPENDS=	${WWWDIR}/web-vault/index.html:www/vaultwarden-web_vault
 
 # make cargo-crates > Makefile.crates
 
-CARGO_FEATURES=	mysql postgresql sqlite #vendored_openssl
+CARGO_FEATURES=	--no-default-features
 #CARGO_ENV+=	RUSTC_BOOTSTRAP=1
 
 INSTALL_TARGET=	install-strip