From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E5A0E15811D for ; Thu, 6 Jul 2023 02:11:44 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1DDBEE086E; Thu, 6 Jul 2023 02:11:44 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0656AE086E for ; Thu, 6 Jul 2023 02:11:44 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0813E340FBB for ; Thu, 6 Jul 2023 02:11:43 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 59363ACC for ; Thu, 6 Jul 2023 02:11:41 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1688609440.3eb7e3258d4fd7584fae543d779d9fdea666e721.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/botan/, dev-libs/botan/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-libs/botan/botan-3.0.0-r2.ebuild dev-libs/botan/files/botan-3.0.0-getentropy-includes.patch X-VCS-Directories: dev-libs/botan/files/ dev-libs/botan/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 3eb7e3258d4fd7584fae543d779d9fdea666e721 X-VCS-Branch: master Date: Thu, 6 Jul 2023 02:11:41 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: e3ee886c-1f5a-43b6-a8c6-ff811ae53e97 X-Archives-Hash: 2a5f874eced1ef45996d46db23b38f2d commit: 3eb7e3258d4fd7584fae543d779d9fdea666e721 Author: Sam James gentoo org> AuthorDate: Thu Jul 6 02:07:48 2023 +0000 Commit: Sam James gentoo org> CommitDate: Thu Jul 6 02:10:40 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3eb7e325 dev-libs/botan: fix musl build Couldn't reproduce it but seems straightforward wrt the issue. Closes: https://bugs.gentoo.org/909422 Signed-off-by: Sam James gentoo.org> dev-libs/botan/botan-3.0.0-r2.ebuild | 3 + .../files/botan-3.0.0-getentropy-includes.patch | 68 ++++++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/dev-libs/botan/botan-3.0.0-r2.ebuild b/dev-libs/botan/botan-3.0.0-r2.ebuild index 866ca3ab1f23..fb1e9384a2cc 100644 --- a/dev-libs/botan/botan-3.0.0-r2.ebuild +++ b/dev-libs/botan/botan-3.0.0-r2.ebuild @@ -55,6 +55,9 @@ BDEPEND=" # NOTE: Considering patching Botan? # Please see upstream's guidance: # https://botan.randombit.net/handbook/packaging.html#minimize-distribution-patches +PATCHES=( + "${FILESDIR}"/${P}-getentropy-includes.patch +) python_check_deps() { use doc || return 0 diff --git a/dev-libs/botan/files/botan-3.0.0-getentropy-includes.patch b/dev-libs/botan/files/botan-3.0.0-getentropy-includes.patch new file mode 100644 index 000000000000..d8b99ba0f4c5 --- /dev/null +++ b/dev-libs/botan/files/botan-3.0.0-getentropy-includes.patch @@ -0,0 +1,68 @@ +https://bugs.gentoo.org/909422 +https://github.com/randombit/botan/commit/3f87e1eef7dbfe231d833ffbf06f7a85b070b600 (cherry-picked getentropy.cpp bit) +https://github.com/randombit/botan/commit/562ea8da8ab34985b4b3dfefc1bea57829213ace + +--- a/src/lib/entropy/getentropy/getentropy.cpp ++++ b/src/lib/entropy/getentropy/getentropy.cpp +@@ -10,8 +10,8 @@ + #if defined(BOTAN_TARGET_OS_IS_OPENBSD) || defined(BOTAN_TARGET_OS_IS_FREEBSD) || defined(BOTAN_TARGET_OS_IS_SOLARIS) + #include + #else +- #include // older macOS needs this before sys/random.h + #include ++ #include // older macOS needs this before sys/random.h + #endif + + namespace Botan { +@@ -21,16 +21,14 @@ namespace Botan { + * buffer size is limited to 256 bytes. On OpenBSD this does neither + * block nor fail. + */ +-size_t Getentropy::poll(RandomNumberGenerator& rng) +- { ++size_t Getentropy::poll(RandomNumberGenerator& rng) { + secure_vector buf(256); + +- if(::getentropy(buf.data(), buf.size()) == 0) +- { ++ if(::getentropy(buf.data(), buf.size()) == 0) { + rng.add_entropy(buf.data(), buf.size()); + return buf.size() * 8; +- } ++ } + + return 0; +- } + } ++} // namespace Botan + +From 562ea8da8ab34985b4b3dfefc1bea57829213ace Mon Sep 17 00:00:00 2001 +From: Jack Lloyd +Date: Mon, 29 May 2023 10:10:54 -0400 +Subject: [PATCH] Clean up getentropy includes + +--- a/src/lib/entropy/getentropy/getentropy.cpp ++++ b/src/lib/entropy/getentropy/getentropy.cpp +@@ -6,12 +6,11 @@ + */ + + #include ++#include + +-#if defined(BOTAN_TARGET_OS_IS_OPENBSD) || defined(BOTAN_TARGET_OS_IS_FREEBSD) || defined(BOTAN_TARGET_OS_IS_SOLARIS) +- #include +-#else ++// macOS and Android include it in sys/random.h instead ++#if __has_include() + #include +- #include // older macOS needs this before sys/random.h + #endif + + namespace Botan { +@@ -31,4 +30,5 @@ size_t Getentropy::poll(RandomNumberGenerator& rng) { + + return 0; + } ++ + } // namespace Botan +