git: c7ae8f5fe345 - main - graphics/bgfx: New port: Cross-platform, graphics API agnostic rendering library

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Fri, 06 Jan 2023 22:13:07 UTC
The branch main has been updated by yuri:

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

commit c7ae8f5fe345c635b298b1aebc6ace0834c1a0ae
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2023-01-06 15:31:22 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2023-01-06 15:31:22 +0000

    graphics/bgfx: New port: Cross-platform, graphics API agnostic rendering library
---
 graphics/Makefile                                  |   1 +
 graphics/bgfx/Makefile                             |  31 ++++++
 graphics/bgfx/distinfo                             |   9 ++
 .../bgfx/files/patch-bgfx_tools_shaderc_shaderc.h  |  11 ++
 graphics/bgfx/files/patch-bx_include_bx_bx.h       |  11 ++
 graphics/bgfx/pkg-descr                            |   2 +
 graphics/bgfx/pkg-plist                            | 122 +++++++++++++++++++++
 7 files changed, 187 insertions(+)

diff --git a/graphics/Makefile b/graphics/Makefile
index 95f7d04c4a1b..a61660e7b784 100644
--- a/graphics/Makefile
+++ b/graphics/Makefile
@@ -74,6 +74,7 @@
     SUBDIR += azpainterb
     SUBDIR += barcode
     SUBDIR += batik
+    SUBDIR += bgfx
     SUBDIR += birdfont
     SUBDIR += bitmap
     SUBDIR += blend2d
diff --git a/graphics/bgfx/Makefile b/graphics/bgfx/Makefile
new file mode 100644
index 000000000000..8d9d7232922c
--- /dev/null
+++ b/graphics/bgfx/Makefile
@@ -0,0 +1,31 @@
+PORTNAME=	bgfx
+DISTVERSIONPREFIX=	v
+DISTVERSION=	1.118.8398-366
+CATEGORIES=	graphics
+
+MAINTAINER=	yuri@FreeBSD.org
+COMMENT=	Cross-platform, graphics API agnostic rendering library
+WWW=		https://bkaradzic.github.io/bgfx/overview.html
+
+LICENSE=	BSD2CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+USES=		cmake compiler:c++14-lang gl localbase:ldflags xorg
+USE_GL=		glu opengl
+USE_XORG=	ice x11 xext sm
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	bkaradzic
+GH_PROJECT=	bgfx.cmake
+GH_TUPLE=	bkaradzic:bgfx:5f435ea:bgfx/bgfx \
+		bkaradzic:bimg:1af9054:bimg/bimg \
+		bkaradzic:bx:aed1086:bx/bx
+
+CMAKE_OFF=	BGFX_BUILD_EXAMPLES BGFX_INSTALL_EXAMPLES \
+		BGFX_CUSTOM_TARGETS
+CMAKE_ARGS=	-DBGFX_LIBRARY_TYPE=SHARED
+
+post-install:
+	@${RM} -r ${STAGEDIR}${PREFIX}/share/licences
+
+.include <bsd.port.mk>
diff --git a/graphics/bgfx/distinfo b/graphics/bgfx/distinfo
new file mode 100644
index 000000000000..2e0fd0dbc95c
--- /dev/null
+++ b/graphics/bgfx/distinfo
@@ -0,0 +1,9 @@
+TIMESTAMP = 1673038283
+SHA256 (bkaradzic-bgfx.cmake-v1.118.8398-366_GH0.tar.gz) = d4a4312d6b067ced484dc2e38c3cd51c30a61cd7297ba4ef45144ad718c079d8
+SIZE (bkaradzic-bgfx.cmake-v1.118.8398-366_GH0.tar.gz) = 22292
+SHA256 (bkaradzic-bgfx-5f435ea_GH0.tar.gz) = 8e8d13a2f91414ab02b10b6d76916e93534d2a39cce70cdf54e63ae6f775bde5
+SIZE (bkaradzic-bgfx-5f435ea_GH0.tar.gz) = 102901169
+SHA256 (bkaradzic-bimg-1af9054_GH0.tar.gz) = af59935d28d4ea590453419d4c7a4225ba72effb882c74f59c50a6f8cf98a466
+SIZE (bkaradzic-bimg-1af9054_GH0.tar.gz) = 756042
+SHA256 (bkaradzic-bx-aed1086_GH0.tar.gz) = beea4a3f11b799dd4b1edcbb19e141e8ef6ba0822becd9c55b559ed19fc1362a
+SIZE (bkaradzic-bx-aed1086_GH0.tar.gz) = 1588995
diff --git a/graphics/bgfx/files/patch-bgfx_tools_shaderc_shaderc.h b/graphics/bgfx/files/patch-bgfx_tools_shaderc_shaderc.h
new file mode 100644
index 000000000000..01ab9a7806f7
--- /dev/null
+++ b/graphics/bgfx/files/patch-bgfx_tools_shaderc_shaderc.h
@@ -0,0 +1,11 @@
+--- bgfx/tools/shaderc/shaderc.h.orig	2023-01-06 21:05:59 UTC
++++ bgfx/tools/shaderc/shaderc.h
+@@ -15,7 +15,7 @@ namespace bgfx
+ #	define SHADERC_CONFIG_HLSL BX_PLATFORM_WINDOWS
+ #endif // SHADERC_CONFIG_HLSL
+ 
+-#include <alloca.h>
++//#include <alloca.h>
+ #include <stdint.h>
+ #include <string.h>
+ #include <algorithm>
diff --git a/graphics/bgfx/files/patch-bx_include_bx_bx.h b/graphics/bgfx/files/patch-bx_include_bx_bx.h
new file mode 100644
index 000000000000..dbb636dd5587
--- /dev/null
+++ b/graphics/bgfx/files/patch-bx_include_bx_bx.h
@@ -0,0 +1,11 @@
+--- bx/include/bx/bx.h.orig	2023-01-06 20:55:11 UTC
++++ bx/include/bx/bx.h
+@@ -6,7 +6,7 @@
+ #ifndef BX_H_HEADER_GUARD
+ #define BX_H_HEADER_GUARD
+ 
+-#include <alloca.h> // alloca
++//#include <alloca.h> // alloca
+ #include <stdarg.h> // va_list
+ #include <stdint.h> // uint32_t
+ #include <stdlib.h> // size_t
diff --git a/graphics/bgfx/pkg-descr b/graphics/bgfx/pkg-descr
new file mode 100644
index 000000000000..2e23d5dcb9e4
--- /dev/null
+++ b/graphics/bgfx/pkg-descr
@@ -0,0 +1,2 @@
+Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style
+rendering library.
diff --git a/graphics/bgfx/pkg-plist b/graphics/bgfx/pkg-plist
new file mode 100644
index 000000000000..7b5f312f72bf
--- /dev/null
+++ b/graphics/bgfx/pkg-plist
@@ -0,0 +1,122 @@
+bin/geometryc
+bin/geometryv
+bin/shaderc
+bin/texturec
+bin/texturev
+include/bgfx/bgfx.h
+include/bgfx/bgfx_compute.sh
+include/bgfx/bgfx_shader.sh
+include/bgfx/c99/bgfx.h
+include/bgfx/defines.h
+include/bgfx/embedded_shader.h
+include/bgfx/platform.h
+include/bimg/bimg.h
+include/bimg/decode.h
+include/bimg/encode.h
+include/bx/allocator.h
+include/bx/bounds.h
+include/bx/bx.h
+include/bx/bx.h.orig
+include/bx/commandline.h
+include/bx/config.h
+include/bx/constants.h
+include/bx/cpu.h
+include/bx/debug.h
+include/bx/easing.h
+include/bx/endian.h
+include/bx/error.h
+include/bx/file.h
+include/bx/filepath.h
+include/bx/float4x4_t.h
+include/bx/handlealloc.h
+include/bx/hash.h
+include/bx/inline/allocator.inl
+include/bx/inline/bounds.inl
+include/bx/inline/bx.inl
+include/bx/inline/cpu.inl
+include/bx/inline/easing.inl
+include/bx/inline/endian.inl
+include/bx/inline/error.inl
+include/bx/inline/float4x4_t.inl
+include/bx/inline/handlealloc.inl
+include/bx/inline/hash.inl
+include/bx/inline/math.inl
+include/bx/inline/mpscqueue.inl
+include/bx/inline/mutex.inl
+include/bx/inline/os.inl
+include/bx/inline/pixelformat.inl
+include/bx/inline/readerwriter.inl
+include/bx/inline/ringbuffer.inl
+include/bx/inline/rng.inl
+include/bx/inline/simd128_langext.inl
+include/bx/inline/simd128_neon.inl
+include/bx/inline/simd128_ref.inl
+include/bx/inline/simd128_sse.inl
+include/bx/inline/simd128_swizzle.inl
+include/bx/inline/simd256_avx.inl
+include/bx/inline/simd256_ref.inl
+include/bx/inline/simd_ni.inl
+include/bx/inline/sort.inl
+include/bx/inline/spscqueue.inl
+include/bx/inline/string.inl
+include/bx/inline/typetraits.inl
+include/bx/inline/uint32_t.inl
+include/bx/macros.h
+include/bx/maputil.h
+include/bx/math.h
+include/bx/mpscqueue.h
+include/bx/mutex.h
+include/bx/os.h
+include/bx/pixelformat.h
+include/bx/platform.h
+include/bx/process.h
+include/bx/readerwriter.h
+include/bx/ringbuffer.h
+include/bx/rng.h
+include/bx/semaphore.h
+include/bx/settings.h
+include/bx/simd_t.h
+include/bx/sort.h
+include/bx/spscqueue.h
+include/bx/string.h
+include/bx/thread.h
+include/bx/timer.h
+include/bx/typetraits.h
+include/bx/uint32_t.h
+include/bx/url.h
+include/compat/freebsd/alloca.h
+include/compat/freebsd/dirent.h
+include/compat/freebsd/malloc.h
+include/compat/freebsd/signal.h
+include/compat/ios/malloc.h
+include/compat/linux/sal.h
+include/compat/mingw/alloca.h
+include/compat/mingw/dirent.h
+include/compat/mingw/sal.h
+include/compat/mingw/salieri.h
+include/compat/mingw/specstrings_strict.h
+include/compat/mingw/specstrings_undef.h
+include/compat/msvc/alloca.h
+include/compat/msvc/dirent.h
+include/compat/msvc/inttypes.h
+include/compat/msvc/pre1600/stdint.h
+include/compat/msvc/stdbool.h
+include/compat/osx/malloc.h
+include/tinystl/LICENSE
+include/tinystl/allocator.h
+include/tinystl/buffer.h
+include/tinystl/hash.h
+include/tinystl/hash_base.h
+include/tinystl/new.h
+include/tinystl/stddef.h
+include/tinystl/string.h
+include/tinystl/traits.h
+include/tinystl/unordered_map.h
+include/tinystl/unordered_set.h
+include/tinystl/vector.h
+lib/cmake/bgfx/bgfxConfig.cmake
+lib/cmake/bgfx/bgfxConfigVersion.cmake
+lib/cmake/bgfx/bgfxTargets-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/bgfx/bgfxTargets.cmake
+lib/cmake/bgfx/bgfxToolUtils.cmake
+lib/libbgfx.so