dev-libs/open62541: fix encryption backend selection behavior

- The build system supports at most one backend (with preference for
mbedtls over openssl if both are selected). Let's model that with
REQUIRED_USE="?? ( mbedtls openssl )"
- Removal of redundant "encryption" USE flag fixes incorrect
  dependencies when backend USE flags are enabled but the encryption USE
  flag is disabled.

Signed-off-by: Lucio Sauer <watermanpaint@posteo.net>
This commit is contained in:
Lucio Sauer
2024-07-19 19:27:04 +02:00
parent 345267ba33
commit a638457dfd
2 changed files with 8 additions and 13 deletions

View File

@@ -17,18 +17,15 @@
systems.
</longdescription>
<use>
<flag name="encryption">
Enable encryption support
</flag>
<flag name="mbedtls">
Use mbedtls for encryption
Enable encryption support using <pkg>net-libs/mbedtls</pkg>
</flag>
<flag name="openssl">
Enable encryption support using <pkg>dev-libs/openssl</pkg>
</flag>
<flag name="pubsub">
Enable OPC/UA Pub/Sub extensions
</flag>
<flag name="openssl">
Use openssl for encryption
</flag>
<flag name="tools">
Build additional shell tools
</flag>

View File

@@ -14,13 +14,13 @@ SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="MPL-2.0"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~x86"
IUSE="doc encryption examples mbedtls pubsub openssl tools"
IUSE="doc examples mbedtls pubsub openssl tools"
# Requires network access
RESTRICT="test"
REQUIRED_USE="
${PYTHON_REQUIRED_USE}
encryption? ( || ( mbedtls openssl ) )
?? ( mbedtls openssl )
"
BDEPEND="
@@ -55,10 +55,8 @@ src_configure() {
-DUA_FORCE_WERROR=OFF
)
if use encryption; then
use mbedtls && mycmakeargs+=(-DUA_ENABLE_ENCRYPTION=MBEDTLS)
use openssl && mycmakeargs+=(-DUA_ENABLE_ENCRYPTION=OPENSSL)
fi
use mbedtls && mycmakeargs+=(-DUA_ENABLE_ENCRYPTION=MBEDTLS)
use openssl && mycmakeargs+=(-DUA_ENABLE_ENCRYPTION=OPENSSL)
cmake_src_configure
}