git: 1ca7c87009aa - main - graphics/py-f3d: New port: Fast and minimalist 3D viewer

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Tue, 18 Oct 2022 07:40:19 UTC
The branch main has been updated by yuri:

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

commit 1ca7c87009aa947e76936ece632870064b76aa4a
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2022-10-18 07:39:35 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2022-10-18 07:40:15 +0000

    graphics/py-f3d: New port: Fast and minimalist 3D viewer
---
 graphics/Makefile                          |  1 +
 graphics/py-f3d/Makefile                   | 26 ++++++++++++++++++++++++++
 graphics/py-f3d/distinfo                   |  3 +++
 graphics/py-f3d/files/patch-CMakeLists.txt | 28 ++++++++++++++++++++++++++++
 graphics/py-f3d/pkg-descr                  |  5 +++++
 graphics/py-f3d/pkg-plist                  |  1 +
 6 files changed, 64 insertions(+)

diff --git a/graphics/Makefile b/graphics/Makefile
index f5a7fff6c58f..914365b62d2e 100644
--- a/graphics/Makefile
+++ b/graphics/Makefile
@@ -846,6 +846,7 @@
     SUBDIR += py-django-easy-thumbnails
     SUBDIR += py-djvulibre
     SUBDIR += py-exifread
+    SUBDIR += py-f3d
     SUBDIR += py-face_recognition
     SUBDIR += py-face_recognition_models
     SUBDIR += py-fiona
diff --git a/graphics/py-f3d/Makefile b/graphics/py-f3d/Makefile
new file mode 100644
index 000000000000..3bbc5ea8518b
--- /dev/null
+++ b/graphics/py-f3d/Makefile
@@ -0,0 +1,26 @@
+PORTNAME=	f3d
+DISTVERSIONPREFIX=	v
+DISTVERSION=	1.3.1
+CATEGORIES=	graphics
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	yuri@FreeBSD.org
+COMMENT=	Fast and minimalist 3D viewer
+WWW=		https://f3d-app.github.io/f3d/
+
+LICENSE=	BSD3CLAUSE
+LICENSE_FILE=	${WRKSRC}/../LICENSE
+
+BUILD_DEPENDS=	pybind11>0:devel/pybind11
+LIB_DEPENDS=	libf3d.so:graphics/f3d
+
+USES=		cmake:testing compiler:c++17-lang localbase:ldflags python
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	f3d-app
+
+WRKSRC_SUBDIR=	python
+
+CXXFLAGS+=	-I${LOCALBASE}/include/f3d
+
+.include <bsd.port.mk>
diff --git a/graphics/py-f3d/distinfo b/graphics/py-f3d/distinfo
new file mode 100644
index 000000000000..07fcead13c5e
--- /dev/null
+++ b/graphics/py-f3d/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1662604096
+SHA256 (f3d-app-f3d-v1.3.1_GH0.tar.gz) = 653dc4044e14d0618c1d947a8ee85d2513e100b3fc24bd6e51830131a13e795d
+SIZE (f3d-app-f3d-v1.3.1_GH0.tar.gz) = 35586414
diff --git a/graphics/py-f3d/files/patch-CMakeLists.txt b/graphics/py-f3d/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..434d9bd56e1a
--- /dev/null
+++ b/graphics/py-f3d/files/patch-CMakeLists.txt
@@ -0,0 +1,28 @@
+--- CMakeLists.txt.orig	2022-09-07 10:17:51 UTC
++++ CMakeLists.txt
+@@ -1,10 +1,13 @@
++cmake_minimum_required(VERSION 3.12)
++find_package(Python COMPONENTS Interpreter Development)
+ find_package(pybind11 2.2 REQUIRED)
++set(CMAKE_INSTALL_LIBDIR lib)
+ 
+ pybind11_add_module(pyf3d F3DPythonBindings.cxx)
+ 
+ target_compile_features(pyf3d PRIVATE cxx_std_14)
+ 
+-target_link_libraries(pyf3d PRIVATE libf3d)
++target_link_libraries(pyf3d PRIVATE f3d)
+ 
+ set_target_properties(pyf3d PROPERTIES
+   LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
+@@ -23,6 +26,10 @@ endif()
+ if (APPLE OR UNIX)
+   set_target_properties(pyf3d PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
+ endif ()
++
++set(PYTHON_INSTALL_PATH "${CMAKE_INSTALL_LIBDIR}/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages")
++install(TARGETS pyf3d
++  LIBRARY DESTINATION ${PYTHON_INSTALL_PATH} COMPONENT pythonmodule)
+ 
+ # testing
+ if(BUILD_TESTING)
diff --git a/graphics/py-f3d/pkg-descr b/graphics/py-f3d/pkg-descr
new file mode 100644
index 000000000000..24a732007338
--- /dev/null
+++ b/graphics/py-f3d/pkg-descr
@@ -0,0 +1,5 @@
+F3D is a VTK-based 3D viewer following the KISS principle, so it is minimalist,
+efficient, has no GUI, has simple interaction mechanisms and is fully
+controllable using arguments in the command line.
+
+It supports a range of file formats, rendering and texturing options.
diff --git a/graphics/py-f3d/pkg-plist b/graphics/py-f3d/pkg-plist
new file mode 100644
index 000000000000..e570bcd7d382
--- /dev/null
+++ b/graphics/py-f3d/pkg-plist
@@ -0,0 +1 @@
+%%PYTHON_SITELIBDIR%%/f3d%%PYTHON_EXT_SUFFIX%%.so