summaryrefslogtreecommitdiff
path: root/dev-util/librnp/librnp-0.16.1.ebuild
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util/librnp/librnp-0.16.1.ebuild')
-rw-r--r--dev-util/librnp/librnp-0.16.1.ebuild76
1 files changed, 76 insertions, 0 deletions
diff --git a/dev-util/librnp/librnp-0.16.1.ebuild b/dev-util/librnp/librnp-0.16.1.ebuild
new file mode 100644
index 000000000000..b6ba813ff651
--- /dev/null
+++ b/dev-util/librnp/librnp-0.16.1.ebuild
@@ -0,0 +1,76 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+DESCRIPTION="High performance C++ OpenPGP library"
+HOMEPAGE="https://www.rnpgp.org/ https://github.com/rnpgp/rnp"
+SRC_URI="https://github.com/rnpgp/rnp/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0 BSD BSD-2"
+SLOT="0/0.16.1"
+KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
+IUSE="+botan man test"
+
+RDEPEND="app-arch/bzip2
+ dev-libs/json-c:=
+ sys-libs/zlib
+ botan? ( dev-libs/botan:2= )
+ !botan? ( >=dev-libs/openssl-1.1.1:= )"
+DEPEND="${RDEPEND}
+ test? ( dev-cpp/gtest )"
+BDEPEND="man? ( dev-ruby/asciidoctor )"
+
+RESTRICT="!test? ( test )"
+S="${WORKDIR}/${P/*lib/}"
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_TESTING=$(usex test on off)
+
+ -DCRYPTO_BACKEND=$(usex botan botan openssl)
+
+ -DDOWNLOAD_GTEST=off
+ -DDOWNLOAD_RUBYRNP=off
+
+ -DENABLE_COVERAGE=off
+ -DENABLE_DOC=$(usex man on off)
+ -DENABLE_FUZZERS=off
+ -DENABLE_SANITIZERS=off
+ )
+
+ if use botan; then
+ local mycmakeargs+=(
+ -DENABLE_AEAD=on
+ -DENABLE_BRAINPOOL=on
+ -DENABLE_SM2=on
+ -DENABLE_TWOFISH=on
+ )
+
+ # OpenSSL support is still not as complete as botan.
+ # https://github.com/rnpgp/rnp/issues/1642 AEAD,
+ # https://github.com/rnpgp/rnp/issues/1902 BRAINPOOL,
+ # https://github.com/rnpgp/rnp/issues/1877 SM2,
+ # https://github.com/openssl/openssl/issues/2046 TWOFISH.
+ else
+ local mycmakeargs+=(
+ -DENABLE_AEAD=off
+ -DENABLE_BRAINPOOL=off
+ -DENABLE_SM2=off
+ -DENABLE_TWOFISH=off
+ )
+ fi
+
+ # Broken in 0.16.1.
+ # https://github.com/rnpgp/rnp/issues/1901
+ local mycmakeargs+=( -DENABLE_IDEA=off )
+
+ cmake_src_configure
+}
+
+src_test() {
+ cd "${BUILD_DIR}" || die
+ ctest -j"${MAKEOPTS}" -R .* --output-on-failure || die
+}