git: cce1085962d6 - main - misc/box2d: update to 3.1.1 release (+)

From: Dima Panov <fluffy_at_FreeBSD.org>
Date: Fri, 04 Sep 2026 15:23:02 UTC
The branch main has been updated by fluffy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=cce1085962d632e14e3d7cdfa21a124d98fa42b5

commit cce1085962d632e14e3d7cdfa21a124d98fa42b5
Author:     Dima Panov <fluffy@FreeBSD.org>
AuthorDate: 2026-09-04 15:04:27 +0000
Commit:     Dima Panov <fluffy@FreeBSD.org>
CommitDate: 2026-09-04 15:22:50 +0000

    misc/box2d: update to 3.1.1 release (+)
    
    Also provide pkgconfig file required by LibreOffice
    
    With hat:       office
---
 misc/box2d/Makefile                   |  4 +--
 misc/box2d/distinfo                   |  6 ++---
 misc/box2d/files/patch-CMakeLists.txt | 19 ++++++++++++++
 misc/box2d/files/patch-box2d.pc.in    | 13 ++++++++++
 misc/box2d/pkg-plist                  | 49 ++++++-----------------------------
 5 files changed, 45 insertions(+), 46 deletions(-)

diff --git a/misc/box2d/Makefile b/misc/box2d/Makefile
index 1ce69c00f529..48fecd2c2fea 100644
--- a/misc/box2d/Makefile
+++ b/misc/box2d/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	Box2D
 DISTVERSIONPREFIX=	v
-DISTVERSION=	2.4.1
+DISTVERSION=	3.1.1
 CATEGORIES=	misc
 
 MAINTAINER=	yuri@FreeBSD.org
@@ -18,7 +18,7 @@ GH_ACCOUNT=	erincatto
 GH_PROJECT=	box2d
 
 CMAKE_ON=	BOX2D_INSTALL BUILD_SHARED_LIBS
-CMAKE_OFF=	BOX2D_BUILD_STATIC BOX2D_BUILD_UNIT_TESTS BOX2D_BUILD_TESTBED BOX2D_BUILD_EXAMPLES
+CMAKE_OFF=	BOX2D_BUILD_STATIC BOX2D_BUILD_UNIT_TESTS BOX2D_BUILD_TESTBED BOX2D_BUILD_EXAMPLES BOX2D_SAMPLES
 
 do-test:
 	@cd ${BUILD_WRKSRC} && \
diff --git a/misc/box2d/distinfo b/misc/box2d/distinfo
index 811852a01fd8..5191bba9f9f1 100644
--- a/misc/box2d/distinfo
+++ b/misc/box2d/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1615160100
-SHA256 (erincatto-box2d-v2.4.1_GH0.tar.gz) = d6b4650ff897ee1ead27cf77a5933ea197cbeef6705638dd181adc2e816b23c2
-SIZE (erincatto-box2d-v2.4.1_GH0.tar.gz) = 1224516
+TIMESTAMP = 1783938265
+SHA256 (erincatto-box2d-v3.1.1_GH0.tar.gz) = fb6ef914b50f4312d7d921a600eabc12318bb3c55a0b8c0b90608fa4488ef2e4
+SIZE (erincatto-box2d-v3.1.1_GH0.tar.gz) = 780115
diff --git a/misc/box2d/files/patch-CMakeLists.txt b/misc/box2d/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..6f9e9f73fa04
--- /dev/null
+++ b/misc/box2d/files/patch-CMakeLists.txt
@@ -0,0 +1,19 @@
+--- CMakeLists.txt.orig	2025-06-04 00:50:24 UTC
++++ CMakeLists.txt
+@@ -132,6 +132,16 @@ endif()
+ 	endif()
+ endif()
+ 
++# Check if the system is UNIX-based and not Apple
++if(UNIX)
++  # Configure the pkg-config file from the template
++  configure_file("${PROJECT_SOURCE_DIR}/box2d.pc.in"
++                 "${PROJECT_BINARY_DIR}/box2d.pc" @ONLY)
++
++  # Install the generated pkg-config file to the appropriate directory
++  install(FILES "${PROJECT_BINARY_DIR}/box2d.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/libdata/pkgconfig")
++endif()
++
+ # # Building on clang in windows
+ # cmake -S .. -B . -G "Visual Studio 17 2022" -A x64 -T ClangCL
+ # https://clang.llvm.org/docs/UsersManual.html#clang-cl
diff --git a/misc/box2d/files/patch-box2d.pc.in b/misc/box2d/files/patch-box2d.pc.in
new file mode 100644
index 000000000000..caa67a5e2a70
--- /dev/null
+++ b/misc/box2d/files/patch-box2d.pc.in
@@ -0,0 +1,13 @@
+--- box2d.pc.in.orig	2026-07-13 15:27:01 UTC
++++ box2d.pc.in
+@@ -0,0 +1,10 @@
++prefix=@CMAKE_INSTALL_PREFIX@
++exec_prefix=${prefix}
++libdir=${exec_prefix}/lib
++includedir=${prefix}/include
++
++Name: box2d
++Description: 2D physics engine
++Version: @PROJECT_VERSION@
++Libs: -L${libdir} -lbox2d
++Cflags: -I${includedir}
diff --git a/misc/box2d/pkg-plist b/misc/box2d/pkg-plist
index e11e139698c9..43473b544ce6 100644
--- a/misc/box2d/pkg-plist
+++ b/misc/box2d/pkg-plist
@@ -1,46 +1,13 @@
-include/box2d/b2_api.h
-include/box2d/b2_block_allocator.h
-include/box2d/b2_body.h
-include/box2d/b2_broad_phase.h
-include/box2d/b2_chain_shape.h
-include/box2d/b2_circle_shape.h
-include/box2d/b2_collision.h
-include/box2d/b2_common.h
-include/box2d/b2_contact.h
-include/box2d/b2_contact_manager.h
-include/box2d/b2_distance.h
-include/box2d/b2_distance_joint.h
-include/box2d/b2_draw.h
-include/box2d/b2_dynamic_tree.h
-include/box2d/b2_edge_shape.h
-include/box2d/b2_fixture.h
-include/box2d/b2_friction_joint.h
-include/box2d/b2_gear_joint.h
-include/box2d/b2_growable_stack.h
-include/box2d/b2_joint.h
-include/box2d/b2_math.h
-include/box2d/b2_motor_joint.h
-include/box2d/b2_mouse_joint.h
-include/box2d/b2_polygon_shape.h
-include/box2d/b2_prismatic_joint.h
-include/box2d/b2_pulley_joint.h
-include/box2d/b2_revolute_joint.h
-include/box2d/b2_rope.h
-include/box2d/b2_settings.h
-include/box2d/b2_shape.h
-include/box2d/b2_stack_allocator.h
-include/box2d/b2_time_of_impact.h
-include/box2d/b2_time_step.h
-include/box2d/b2_timer.h
-include/box2d/b2_types.h
-include/box2d/b2_weld_joint.h
-include/box2d/b2_wheel_joint.h
-include/box2d/b2_world.h
-include/box2d/b2_world_callbacks.h
+include/box2d/base.h
 include/box2d/box2d.h
+include/box2d/collision.h
+include/box2d/id.h
+include/box2d/math_functions.h
+include/box2d/types.h
 lib/cmake/box2d/box2dConfig-%%CMAKE_BUILD_TYPE%%.cmake
 lib/cmake/box2d/box2dConfig.cmake
 lib/cmake/box2d/box2dConfigVersion.cmake
 lib/libbox2d.so
-lib/libbox2d.so.2
-lib/libbox2d.so.2.4.1
+lib/libbox2d.so.3
+lib/libbox2d.so.3.1.1
+libdata/pkgconfig/box2d.pc