commit:     b7d0771754ffd941a38ea10c670b828a4cf6bbb1
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 28 17:35:06 2025 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Thu Aug 28 17:43:33 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b7d07717

games-engines/box2d: add 2.4.2

Closes: https://bugs.gentoo.org/907072
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 games-engines/box2d/Manifest                       |  1 +
 games-engines/box2d/box2d-2.4.2.ebuild             | 42 ++++++++++++++++++++++
 .../box2d/files/box2d-2.4.2-sandbox-error.patch    | 26 ++++++++++++++
 3 files changed, 69 insertions(+)

diff --git a/games-engines/box2d/Manifest b/games-engines/box2d/Manifest
index 0f3e700ba93f..4ab5e21232ac 100644
--- a/games-engines/box2d/Manifest
+++ b/games-engines/box2d/Manifest
@@ -1 +1,2 @@
 DIST box2d-2.4.1.tar.gz 1224516 BLAKE2B 
4f268c082d6c51d574fe6974351a64e98693e7eb71aa36626561fe23cb5fa890c77946e34d91fce92298af7e723c34306dfc6a934251a8566f431821397d1b82
 SHA512 
d900f925b77906777719c91488bdc5e2df1ad1f4a8ca39a574229f5e57070e3a843bdd7530e817112605fde6d82145c872d8afdfc65b84531a73199098c81162
+DIST box2d-2.4.2.tar.gz 1236569 BLAKE2B 
95c7fa45891993526908330bb8c7787c4174e094e46dfa49ddc8906c5c1a72036a289a5e21813a966635b0bd9393f34f906a153f6a29e7260033d22eda52076d
 SHA512 
e769bcfa11028ea2e842bf96da4bef71a58f1b08cd144139adc724acfe3ca5911f84d0be41d9412b302d9e7c17b7741cf56da60df7bd7379c6e11b3eea100153

diff --git a/games-engines/box2d/box2d-2.4.2.ebuild 
b/games-engines/box2d/box2d-2.4.2.ebuild
new file mode 100644
index 000000000000..13a568def285
--- /dev/null
+++ b/games-engines/box2d/box2d-2.4.2.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+DESCRIPTION="C++ engine for simulating rigid bodies in 2D games"
+HOMEPAGE="https://box2d.org/";
+SRC_URI="https://github.com/erincatto/Box2D/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="ZLIB"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86"
+IUSE="doc test"
+RESTRICT="!test? ( test )"
+
+DEPEND="test? ( dev-cpp/doctest )"
+BDEPEND="doc? ( app-text/doxygen )"
+
+PATCHES=( "${FILESDIR}/${P}-sandbox-error.patch" ) # bug 907072, downstream
+
+src_prepare() {
+       cmake_src_prepare
+
+       # unbundle doctest
+       rm unit-test/doctest.h || die
+       ln -s "${ESYSROOT}"/usr/include/doctest/doctest.h unit-test/ || die
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DBOX2D_BUILD_TESTBED=OFF # bundled libs, broken anyway right 
now
+               -DBOX2D_BUILD_UNIT_TESTS=$(usex test)
+               -DBOX2D_BUILD_DOCS=$(usex doc)
+       )
+       cmake_src_configure
+}
+
+src_test() {
+       "${BUILD_DIR}"/bin/unit_test || die
+}

diff --git a/games-engines/box2d/files/box2d-2.4.2-sandbox-error.patch 
b/games-engines/box2d/files/box2d-2.4.2-sandbox-error.patch
new file mode 100644
index 000000000000..7960c12e8ed3
--- /dev/null
+++ b/games-engines/box2d/files/box2d-2.4.2-sandbox-error.patch
@@ -0,0 +1,26 @@
+Fix WARN_LOGFILE path
+
+The BOX2D_BINARY_DIR variable does not appear to be set, resulting in a
+Doxygen file that attempts to write to /docs/, outside the sandbox,
+resulting in a sandbox violation.  Replace with the CMAKE_BINARY_DIR
+variable, which seems to result in putting the warnings in a
+semi-sensible location.
+
+Alternative fix:  Set WARN_LOGFILE to a blank value, which results in
+the warnings being written to the build log instead.
+
+https://bugs.gentoo.org/show_bug.cgi?id=907072
+
+diff --git a/docs/Doxyfile.in b/docs/Doxyfile.in
+index 0123456..0123456 100644
+--- a/docs/Doxyfile.in
++++ b/docs/Doxyfile.in
+@@ -817,7 +817,7 @@ WARN_FORMAT            = "$file:$line: $text"
+ # messages should be written. If left blank the output is written to standard
+ # error (stderr).
+ 
+-WARN_LOGFILE           = "@BOX2D_BINARY_DIR@/docs/warnings.txt"
++WARN_LOGFILE           = "@CMAKE_BINARY_DIR@/docs/warnings.txt"
+ 
+ #---------------------------------------------------------------------------
+ # Configuration options related to the input files

Reply via email to