From 159cdca109498d0e157a4130adf834fe0dd5b85d Mon Sep 17 00:00:00 2001 From: Victor Kustov Date: Tue, 9 Jan 2024 18:48:09 +0300 Subject: [PATCH] sci-physics/reactphysics3d --- sci-physics/reactphysics3d/Manifest | 1 + .../reactphysics3d-0.9.0-cstdint-fix.patch | 21 ++++++++++ .../reactphysics3d-0.9.0-gitmodules-fix.patch | 34 ++++++++++++++++ sci-physics/reactphysics3d/metadata.xml | 15 +++++++ .../reactphysics3d-0.9.0.ebuild | 40 +++++++++++++++++++ 5 files changed, 111 insertions(+) create mode 100644 sci-physics/reactphysics3d/Manifest create mode 100644 sci-physics/reactphysics3d/files/reactphysics3d-0.9.0-cstdint-fix.patch create mode 100644 sci-physics/reactphysics3d/files/reactphysics3d-0.9.0-gitmodules-fix.patch create mode 100644 sci-physics/reactphysics3d/metadata.xml create mode 100644 sci-physics/reactphysics3d/reactphysics3d-0.9.0.ebuild diff --git a/sci-physics/reactphysics3d/Manifest b/sci-physics/reactphysics3d/Manifest new file mode 100644 index 0000000..29128c8 --- /dev/null +++ b/sci-physics/reactphysics3d/Manifest @@ -0,0 +1 @@ +DIST reactphysics3d-0.9.0.tar.gz 14164896 BLAKE2B b181f4a4a79d471e04316f84eef3aeefb685c5d1f7ba9eaa8428b04e9da04423848fac9fc668b2a0bc8e931674dd42758817fe929b282a3a9052919f44c81e35 SHA512 9e01e99a0cacfbaba2c121d7b715fe8363c9dd4650d02d7ce9b042b9c2fe1dfc938d5e5d8b0a323b0ed8e04ba3d1e0ec607592fd99ae2518d75ee4f521faa996 diff --git a/sci-physics/reactphysics3d/files/reactphysics3d-0.9.0-cstdint-fix.patch b/sci-physics/reactphysics3d/files/reactphysics3d-0.9.0-cstdint-fix.patch new file mode 100644 index 0000000..21e14b4 --- /dev/null +++ b/sci-physics/reactphysics3d/files/reactphysics3d-0.9.0-cstdint-fix.patch @@ -0,0 +1,21 @@ +From 4975564a1bab501d7ac406648f0df375e5b60279 Mon Sep 17 00:00:00 2001 +From: Jan Schultke +Date: Sat, 5 Aug 2023 14:20:55 +0200 +Subject: [PATCH] add missing include + +--- + include/reactphysics3d/configuration.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/include/reactphysics3d/configuration.h b/include/reactphysics3d/configuration.h +index 6f2de958..6281c93c 100644 +--- a/include/reactphysics3d/configuration.h ++++ b/include/reactphysics3d/configuration.h +@@ -27,6 +27,7 @@ + #define REACTPHYSICS3D_CONFIGURATION_H + + // Libraries ++#include + #include + #include + #include diff --git a/sci-physics/reactphysics3d/files/reactphysics3d-0.9.0-gitmodules-fix.patch b/sci-physics/reactphysics3d/files/reactphysics3d-0.9.0-gitmodules-fix.patch new file mode 100644 index 0000000..3f2039b --- /dev/null +++ b/sci-physics/reactphysics3d/files/reactphysics3d-0.9.0-gitmodules-fix.patch @@ -0,0 +1,34 @@ +--- a/testbed/CMakeLists.txt ++++ b/testbed/CMakeLists.txt +@@ -10,32 +10,6 @@ + set(NANOGUI_INSTALL OFF CACHE BOOL " " FORCE) + set(NANOGUI_BACKEND OpenGL CACHE BOOL " " FORCE) + +-# ---- Make sure to recursively clone all the git submodules for external libraries (nanogui) --- # +-find_package(Git QUIET) +-if(GIT_FOUND) +- if (EXISTS "${CMAKE_SOURCE_DIR}/.git") +- # Update submodules as needed +- option(CLONE_GIT_SUBMODULES "Check submodules during build" ON) +- if(CLONE_GIT_SUBMODULES) +- message(STATUS "Git Submodules update") +- message(STATUS "Working directory ${CMAKE_CURRENT_SOURCE_DIR}") +- execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive +- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +- RESULT_VARIABLE GIT_SUBMOD_RESULT) +- if(NOT GIT_SUBMOD_RESULT EQUAL "0") +- message(FATAL_ERROR "git submodule update --init --recursive failed with ${GIT_SUBMOD_RESULT}, please checkout submodules") +- endif() +- endif() +- else() +- message(FATAL_ERROR "This is not a Git repository. In order to build the testbed application, you need to clone the ReactPhysics3D repository.") +- endif() +-else() +- message(FATAL_ERROR "Git has not been found on your system. This is necessary to build the testbed application because git submodules command is used to get the testbed dependencies (nanogui library). You need to fill in the GIT_EXECUTABLE CMake variable with the path to the Git executable on your system to continue.") +-endif() +- +-# Ask Nanogui not to build shared libraries +-SET(NANOGUI_BUILD_SHARED OFF CACHE BOOL "Build Nanogui with static libraries" FORCE) +- + # Add the configurations from nanogui + add_subdirectory(extern/nanogui) diff --git a/sci-physics/reactphysics3d/metadata.xml b/sci-physics/reactphysics3d/metadata.xml new file mode 100644 index 0000000..515eee6 --- /dev/null +++ b/sci-physics/reactphysics3d/metadata.xml @@ -0,0 +1,15 @@ + + + + + ktrace@yandex.ru + Victor Kustov + + + proxy-maint@gentoo.org + Proxy Maintainers + + + DanielChappuis/reactphysics3d + + diff --git a/sci-physics/reactphysics3d/reactphysics3d-0.9.0.ebuild b/sci-physics/reactphysics3d/reactphysics3d-0.9.0.ebuild new file mode 100644 index 0000000..fbe6cf1 --- /dev/null +++ b/sci-physics/reactphysics3d/reactphysics3d-0.9.0.ebuild @@ -0,0 +1,40 @@ +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +CMAKE_MAKEFILE_GENERATOR="ninja" + +inherit cmake flag-o-matic + +DESCRIPTION="C++ physics engine library in 3D" +HOMEPAGE="https://www.reactphysics3d.com/" +SRC_URI="https://github.com/DanielChappuis/reactphysics3d/releases/download/v${PV}/${P}.tar.gz" + +LICENSE="ZLIB" +SLOT="0" +KEYWORDS="~amd64" + +IUSE="demo" + +PATCHES=( + "${FILESDIR}/${P}"-cstdint-fix.patch + "${FILESDIR}/${P}"-gitmodules-fix.patch + ) + +S="${WORKDIR}/${PN}" + +src_configure() { + append-cxxflags -std=c++11 + mycmakeargs+=( + -DCLONE_GIT_SUBMODULES=OFF + -DRP3D_COMPILE_TESTS=ON + -DRP3D_COMPILE_TESTBED=$(usex demo ON OFF) + ) + cmake_src_configure +} + +src_test() { + cd "${BUILD_DIR}"/test || die + ./tests +}