pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Add fna3d 21.01
Module Name: pkgsrc-wip
Committed By: Maya Rashish <maya%NetBSD.org@localhost>
Pushed By: coypu
Date: Sat Jan 23 11:41:28 2021 +0200
Changeset: ec50983422f9d575de2ae01c158c629a1c1c8b28
Modified Files:
Makefile
Added Files:
fna3d/DESCR
fna3d/Makefile
fna3d/PLIST
fna3d/buildlink3.mk
fna3d/distinfo
fna3d/patches/patch-CMakeLists.txt
fna3d/patches/patch-src_FNA3D__Driver__Vulkan.c
Log Message:
Add fna3d 21.01
Based on work by thfr for OpenBSD ports.
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.
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=ec50983422f9d575de2ae01c158c629a1c1c8b28
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
Makefile | 1 +
fna3d/DESCR | 10 ++++
fna3d/Makefile | 28 +++++++++++
fna3d/PLIST | 6 +++
fna3d/buildlink3.mk | 14 ++++++
fna3d/distinfo | 8 +++
fna3d/patches/patch-CMakeLists.txt | 65 +++++++++++++++++++++++++
fna3d/patches/patch-src_FNA3D__Driver__Vulkan.c | 13 +++++
8 files changed, 145 insertions(+)
diffs:
diff --git a/Makefile b/Makefile
index abab457c89..6717792dcc 100644
--- a/Makefile
+++ b/Makefile
@@ -857,6 +857,7 @@ SUBDIR+= fluxbox
SUBDIR+= fluxspace
SUBDIR+= flvmeta
SUBDIR+= flyback
+SUBDIR+= fna3d
SUBDIR+= fnord
SUBDIR+= fnteditfs
SUBDIR+= fogleman-craft
diff --git a/fna3d/DESCR b/fna3d/DESCR
new file mode 100644
index 0000000000..5a193dbfd8
--- /dev/null
+++ b/fna3d/DESCR
@@ -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 --git a/fna3d/Makefile b/fna3d/Makefile
new file mode 100644
index 0000000000..e1f496a553
--- /dev/null
+++ b/fna3d/Makefile
@@ -0,0 +1,28 @@
+# $NetBSD$
+
+GITHUB_PROJECT= FNA3D
+GITHUB_TAG= 21.01
+DISTNAME= 21.01
+PKGNAME= ${GITHUB_PROJECT}-${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 "../../wip/vulkan-headers/buildlink3.mk"
+.include "../../wip/mojoshader/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/fna3d/PLIST b/fna3d/PLIST
new file mode 100644
index 0000000000..8f8326c9a1
--- /dev/null
+++ b/fna3d/PLIST
@@ -0,0 +1,6 @@
+@comment $NetBSD$
+include/FNA3D.h
+include/FNA3D_Image.h
+lib/libFNA3D.so
+lib/libFNA3D.so.0
+lib/libFNA3D.so.0.${PKGVERSION}
diff --git a/fna3d/buildlink3.mk b/fna3d/buildlink3.mk
new file mode 100644
index 0000000000..644653fb71
--- /dev/null
+++ b/fna3d/buildlink3.mk
@@ -0,0 +1,14 @@
+# $NetBSD$
+BUILDLINK_TREE+= FNA3D
+
+.if !defined(FNA3D_BUILDLINK3_MK)
+FNA3D_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.FNA3D+= FNA3D>=21.01
+BUILDLINK_PKGSRCDIR.FNA3D?= ../../wip/fna3d
+
+.include "../../devel/SDL2/buildlink3.mk"
+.include "../../wip/mojoshader/buildlink3.mk"
+.endif # FNA3D_BUILDLINK3_MK
+
+BUILDLINK_TREE+= -FNA3D
diff --git a/fna3d/distinfo b/fna3d/distinfo
new file mode 100644
index 0000000000..365a416cc8
--- /dev/null
+++ b/fna3d/distinfo
@@ -0,0 +1,8 @@
+$NetBSD$
+
+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) = 6b487eb7272f6e90fab14ce6386537edb57ce449
+SHA1 (patch-src_FNA3D__Driver__Vulkan.c) = 32250005bbab21d6dd84662629b08a02c3d0a829
diff --git a/fna3d/patches/patch-CMakeLists.txt b/fna3d/patches/patch-CMakeLists.txt
new file mode 100644
index 0000000000..63a1b9f049
--- /dev/null
+++ b/fna3d/patches/patch-CMakeLists.txt
@@ -0,0 +1,65 @@
+$OpenBSD: patch-CMakeLists_txt,v 1.3 2021/01/23 05:13:06 thfr 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 --git a/fna3d/patches/patch-src_FNA3D__Driver__Vulkan.c b/fna3d/patches/patch-src_FNA3D__Driver__Vulkan.c
new file mode 100644
index 0000000000..d75150d618
--- /dev/null
+++ b/fna3d/patches/patch-src_FNA3D__Driver__Vulkan.c
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- 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