pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/graphics Add fna3d version 21.01



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e61194e831ea
branches:  trunk
changeset: 445507:e61194e831ea
user:      maya <maya%pkgsrc.org@localhost>
date:      Sun Jan 24 19:03:46 2021 +0000

description:
Add fna3d version 21.01

This is FNA3D, the 3D graphics library for FNA.

FNA3D was written to be used for FNA's Graphics namespace. It carries the same
API design as XNA 4.0, with various implementations available at runtime
(including Vulkan, OpenGL, Metal, and Direct3D). For shaders, we support
Direct3D 9 Effect Framework binaries via MojoShader.

Note that while FNA is the main consumer of FNA3D, we do NOT provide separate C#
bindings. If you want to use FNA3D in C#, simply use FNA instead; it's the same
API and can be used entirely by itself without dragging in other dependencies.

diffstat:

 graphics/Makefile                                        |   3 +-
 graphics/fna3d/DESCR                                     |  10 ++
 graphics/fna3d/Makefile                                  |  28 ++++++
 graphics/fna3d/PLIST                                     |   6 +
 graphics/fna3d/buildlink3.mk                             |  15 +++
 graphics/fna3d/distinfo                                  |   8 +
 graphics/fna3d/patches/patch-CMakeLists.txt              |  65 ++++++++++++++++
 graphics/fna3d/patches/patch-src_FNA3D__Driver__Vulkan.c |  15 +++
 8 files changed, 149 insertions(+), 1 deletions(-)

diffs (192 lines):

diff -r 2c0ec47e2119 -r e61194e831ea graphics/Makefile
--- a/graphics/Makefile Sun Jan 24 19:00:01 2021 +0000
+++ b/graphics/Makefile Sun Jan 24 19:03:46 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.918 2021/01/24 18:59:47 maya Exp $
+# $NetBSD: Makefile,v 1.919 2021/01/24 19:03:46 maya Exp $
 #
 
 COMMENT=       Graphics tools and libraries
@@ -130,6 +130,7 @@
 SUBDIR+=       fbm
 SUBDIR+=       feh
 SUBDIR+=       fly
+SUBDIR+=       fna3d
 SUBDIR+=       fnlib
 SUBDIR+=       fotoxx
 SUBDIR+=       frameworks
diff -r 2c0ec47e2119 -r e61194e831ea graphics/fna3d/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fna3d/DESCR      Sun Jan 24 19:03:46 2021 +0000
@@ -0,0 +1,10 @@
+This is FNA3D, the 3D graphics library for FNA.
+
+FNA3D was written to be used for FNA's Graphics namespace. It carries the same
+API design as XNA 4.0, with various implementations available at runtime
+(including Vulkan, OpenGL, Metal, and Direct3D). For shaders, we support
+Direct3D 9 Effect Framework binaries via MojoShader.
+
+Note that while FNA is the main consumer of FNA3D, we do NOT provide separate C#
+bindings. If you want to use FNA3D in C#, simply use FNA instead; it's the same
+API and can be used entirely by itself without dragging in other dependencies.
diff -r 2c0ec47e2119 -r e61194e831ea graphics/fna3d/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fna3d/Makefile   Sun Jan 24 19:03:46 2021 +0000
@@ -0,0 +1,28 @@
+# $NetBSD: Makefile,v 1.1 2021/01/24 19:03:46 maya Exp $
+
+GITHUB_PROJECT=        FNA3D
+GITHUB_TAG=    21.01
+DISTNAME=      21.01
+PKGNAME=       ${GITHUB_PROJECT:tl}-${DISTNAME}
+CATEGORIES=    graphics
+MASTER_SITES=  ${MASTER_SITE_GITHUB:=FNA-XNA/}
+DIST_SUBDIR=   ${GITHUB_PROJECT}
+
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=      https://fna-xna.github.io/
+COMMENT=       3D graphics library for FNA
+LICENSE=       zlib
+
+WRKSRC=                ${WRKDIR}/FNA3D-21.01
+USE_CMAKE=     yes
+
+# No upstream install target
+INSTALLATION_DIRS=      lib include
+do-install:
+       ${INSTALL_DATA} ${WRKSRC}/include/*.h ${DESTDIR}${PREFIX}/include/
+       ${INSTALL_DATA} ${WRKSRC}/libFNA3D.so* ${DESTDIR}${PREFIX}/lib/
+
+.include "../../devel/SDL2/buildlink3.mk"
+.include "../../graphics/vulkan-headers/buildlink3.mk"
+.include "../../graphics/mojoshader/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff -r 2c0ec47e2119 -r e61194e831ea graphics/fna3d/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fna3d/PLIST      Sun Jan 24 19:03:46 2021 +0000
@@ -0,0 +1,6 @@
+@comment $NetBSD: PLIST,v 1.1 2021/01/24 19:03:46 maya Exp $
+include/FNA3D.h
+include/FNA3D_Image.h
+lib/libFNA3D.so
+lib/libFNA3D.so.0
+lib/libFNA3D.so.0.${PKGVERSION}
diff -r 2c0ec47e2119 -r e61194e831ea graphics/fna3d/buildlink3.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fna3d/buildlink3.mk      Sun Jan 24 19:03:46 2021 +0000
@@ -0,0 +1,15 @@
+# $NetBSD: buildlink3.mk,v 1.1 2021/01/24 19:03:47 maya Exp $
+
+BUILDLINK_TREE+=       FNA3D
+
+.if !defined(FNA3D_BUILDLINK3_MK)
+FNA3D_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.FNA3D+=  FNA3D>=21.01
+BUILDLINK_PKGSRCDIR.FNA3D?=    ../../graphics/fna3d
+
+.include "../../devel/SDL2/buildlink3.mk"
+.include "../../graphics/mojoshader/buildlink3.mk"
+.endif # FNA3D_BUILDLINK3_MK
+
+BUILDLINK_TREE+=       -FNA3D
diff -r 2c0ec47e2119 -r e61194e831ea graphics/fna3d/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fna3d/distinfo   Sun Jan 24 19:03:46 2021 +0000
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.1 2021/01/24 19:03:47 maya Exp $
+
+SHA1 (FNA3D/21.01.tar.gz) = 0553df59ef236835c62aa0642f9ca1abfb6f618d
+RMD160 (FNA3D/21.01.tar.gz) = 783541a575568906c9ecb23c4563f11f0900eab1
+SHA512 (FNA3D/21.01.tar.gz) = ae99280d2b160cbadf19df60aa2e81eb3ae4da4267613f97aa8e132b0b743068091460d8f3097d47adbd6a7b7292a7640088ae7104e2a3a783e0050b72ca497a
+Size (FNA3D/21.01.tar.gz) = 315856 bytes
+SHA1 (patch-CMakeLists.txt) = 27ebc2e42a5819b6298b6faa8488234e8f3ecbb1
+SHA1 (patch-src_FNA3D__Driver__Vulkan.c) = b9eb107f3d0430ab9536f709871c5d1af1d1e06a
diff -r 2c0ec47e2119 -r e61194e831ea graphics/fna3d/patches/patch-CMakeLists.txt
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fna3d/patches/patch-CMakeLists.txt       Sun Jan 24 19:03:46 2021 +0000
@@ -0,0 +1,65 @@
+$NetBSD: patch-CMakeLists.txt,v 1.1 2021/01/24 19:03:47 maya Exp $
+
+set correct library version
+disable bundled mojoshader in favor of the one from pkgsrc
+
+--- CMakeLists.txt.orig        2021-01-01 16:22:56.000000000 +0000
++++ CMakeLists.txt
+@@ -3,6 +3,9 @@
+ cmake_minimum_required(VERSION 2.8.12)
+ project(FNA3D C)
+ 
++include_directories("${PREFIX}/include"
++                      "${X11BASE}/include")
++
+ # Options
+ option(BUILD_SHARED_LIBS "Build shared library" ON)
+ option(DISABLE_D3D11 "Disable D3D11 backend")
+@@ -105,28 +108,11 @@ add_library(FNA3D
+       src/FNA3D_Image.c
+       src/FNA3D_PipelineCache.c
+ )
+-add_library(mojoshader STATIC
+-      MojoShader/mojoshader.c
+-      MojoShader/mojoshader_effects.c
+-      MojoShader/mojoshader_common.c
+-      MojoShader/mojoshader_d3d11.c
+-      MojoShader/mojoshader_opengl.c
+-      MojoShader/mojoshader_metal.c
+-      MojoShader/mojoshader_vulkan.c
+-      MojoShader/profiles/mojoshader_profile_common.c
+-      MojoShader/profiles/mojoshader_profile_glsl.c
+-      MojoShader/profiles/mojoshader_profile_hlsl.c
+-      MojoShader/profiles/mojoshader_profile_metal.c
+-      MojoShader/profiles/mojoshader_profile_spirv.c
+-)
+ 
+ # Build flags
+ if(NOT MSVC)
+       set_property(TARGET FNA3D PROPERTY COMPILE_FLAGS "-std=gnu99 -Wall -Wno-strict-aliasing -pedantic")
+ endif()
+-if(BUILD_SHARED_LIBS)
+-      set_property(TARGET mojoshader PROPERTY POSITION_INDEPENDENT_CODE ON)
+-endif()
+ 
+ # FNA3D folders as includes, for other targets to consume
+ target_include_directories(FNA3D PUBLIC
+@@ -134,10 +120,6 @@ target_include_directories(FNA3D PUBLIC
+       $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+       $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Vulkan-Headers/include>
+ )
+-target_include_directories(mojoshader PUBLIC
+-      $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/MojoShader>
+-      $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Vulkan-Headers/include>
+-)
+ 
+ # MinGW builds should statically link libgcc
+ if(MINGW)
+@@ -165,7 +147,6 @@ else()
+       if (TARGET SDL2::SDL2)
+               message(STATUS "using TARGET SDL2::SDL2")
+               target_link_libraries(FNA3D PUBLIC SDL2::SDL2)
+-              target_link_libraries(mojoshader PUBLIC SDL2::SDL2)
+       elseif (TARGET SDL2)
+               message(STATUS "using TARGET SDL2")
+               target_link_libraries(FNA3D PUBLIC SDL2)
diff -r 2c0ec47e2119 -r e61194e831ea graphics/fna3d/patches/patch-src_FNA3D__Driver__Vulkan.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/fna3d/patches/patch-src_FNA3D__Driver__Vulkan.c  Sun Jan 24 19:03:46 2021 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_FNA3D__Driver__Vulkan.c,v 1.1 2021/01/24 19:03:47 maya Exp $
+
+Match the headers in vulkan-headers
+
+--- src/FNA3D_Driver_Vulkan.c.orig     2021-01-01 16:22:56.000000000 +0000
++++ src/FNA3D_Driver_Vulkan.c
+@@ -4444,7 +4444,7 @@ static void VULKAN_INTERNAL_SubmitComman
+       /* Present, if applicable */
+       if (present && acquireSuccess)
+       {
+-              if (renderer->physicalDeviceDriverProperties.driverID == VK_DRIVER_ID_GGP_PROPRIETARY)
++              if (renderer->physicalDeviceDriverProperties.driverID == VK_DRIVER_ID_GGP_PROPRIETARY_KHR)
+               {
+                       const void* token = SDL_GetWindowData(
+                               (SDL_Window*) renderer->presentOverrideWindowHandle,



Home | Main Index | Thread Index | Old Index