git: 64443910f21e - main - graphics/dust3d: new port had been added (+)

From: Alexey Dokuchaev <danfe_at_FreeBSD.org>
Date: Wed, 03 Nov 2021 14:51:35 UTC
The branch main has been updated by danfe:

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

commit 64443910f21e35beb0371ef2bc3f92307a71d5c8
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2021-11-03 14:50:36 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2021-11-03 14:50:39 +0000

    graphics/dust3d: new port had been added (+)
    
    Dust3D is a cross-platform open-source 3D modeling software, offering
    auto-UV unwrapping, auto-rigging with PBR material support, pose, and
    motion authoring all in one.
    
    PR:     239446 (without actual submission)
---
 graphics/Makefile                                  |  1 +
 graphics/dust3d/Makefile                           | 47 ++++++++++++++++++++++
 graphics/dust3d/distinfo                           |  7 ++++
 .../files/patch-src_contourtopartconverter.cpp     |  9 +++++
 ...rty_quickjs_quickjs-2019-07-09-dust3d_quickjs.c | 11 +++++
 graphics/dust3d/pkg-descr                          |  8 ++++
 6 files changed, 83 insertions(+)

diff --git a/graphics/Makefile b/graphics/Makefile
index ce8ce0bacac2..5966bfd83aa7 100644
--- a/graphics/Makefile
+++ b/graphics/Makefile
@@ -152,6 +152,7 @@
     SUBDIR += dspdfviewer
     SUBDIR += dssim
     SUBDIR += duhdraw
+    SUBDIR += dust3d
     SUBDIR += dynamechs
     SUBDIR += ebsynth
     SUBDIR += edje_viewer
diff --git a/graphics/dust3d/Makefile b/graphics/dust3d/Makefile
new file mode 100644
index 000000000000..33544500a1bb
--- /dev/null
+++ b/graphics/dust3d/Makefile
@@ -0,0 +1,47 @@
+# Created by: Alexey Dokuchaev <danfe@FreeBSD.org>
+
+PORTNAME=	dust3d
+DISTVERSION=	1.0.0-rc.6
+CATEGORIES=	graphics
+
+PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${PORTNAME}/commit/
+PATCHFILES=	f8339d25ddb79f893413.diff:-p1 821285de824baf01ae99.diff:-p1
+
+MAINTAINER=	danfe@FreeBSD.org
+COMMENT=	Open-source 3D modeling software
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=	${LOCALBASE}/include/boost/config.hpp:devel/boost-libs \
+		${LOCALBASE}/include/CGAL/Polygon_mesh_processing/corefinement.h:math/cgal \
+		cmake:devel/cmake
+LIB_DEPENDS=	libgmp.so:math/gmp libmpfr.so:math/mpfr
+
+USES=		compiler:c++14-lang gmake qt:5
+USE_GITHUB=	yes
+GH_ACCOUNT=	huxingyi
+USE_QT=		buildtools_build linguisttools_build qmake_build \
+		core gui network opengl widgets
+ALL_TARGET=	all
+
+DESKTOP_ENTRIES="Dust3D" "${COMMENT}" "${PORTNAME}" "${PORTNAME}" \
+		"Application;" false
+
+PLIST_FILES=	bin/${PORTNAME}
+
+post-patch:
+	@${REINPLACE_CMD} -e '/PLATFORM =/s,Linux,${OPSYS},' \
+		${WRKSRC}/${PORTNAME}.pro
+do-configure:
+	cd ${CONFIGURE_WRKSRC} && ${QMAKE_ENV} ${QMAKE} ${QMAKE_ARGS}
+
+pre-build:
+	cd ${BUILD_WRKSRC}/thirdparty/instant-meshes && cmake -B build
+	${MAKE_CMD} -C ${BUILD_WRKSRC}/thirdparty/instant-meshes/build
+
+do-install:
+	${INSTALL_PROGRAM} ${INSTALL_WRKSRC}/${PORTNAME} \
+		${STAGEDIR}${PREFIX}/bin
+
+.include <bsd.port.mk>
diff --git a/graphics/dust3d/distinfo b/graphics/dust3d/distinfo
new file mode 100644
index 000000000000..a86dfc179d2b
--- /dev/null
+++ b/graphics/dust3d/distinfo
@@ -0,0 +1,7 @@
+TIMESTAMP = 1586688260
+SHA256 (huxingyi-dust3d-1.0.0-rc.6_GH0.tar.gz) = 171a12dad39ffd40551126e304a05f036958145fab2a45631929831e2c6bbee9
+SIZE (huxingyi-dust3d-1.0.0-rc.6_GH0.tar.gz) = 98477614
+SHA256 (f8339d25ddb79f893413.diff) = af493121277cb795720c063bf65abc6437657a368fb6338c385c5cbd5454b7e8
+SIZE (f8339d25ddb79f893413.diff) = 926
+SHA256 (821285de824baf01ae99.diff) = 3340ac2a9d9d9bacc8778e763797c421281baf608f5b17e6fbf39207b877b8ab
+SIZE (821285de824baf01ae99.diff) = 7847
diff --git a/graphics/dust3d/files/patch-src_contourtopartconverter.cpp b/graphics/dust3d/files/patch-src_contourtopartconverter.cpp
new file mode 100644
index 000000000000..d4da6c95ff50
--- /dev/null
+++ b/graphics/dust3d/files/patch-src_contourtopartconverter.cpp
@@ -0,0 +1,9 @@
+--- src/contourtopartconverter.cpp.orig	2020-04-12 10:44:20 UTC
++++ src/contourtopartconverter.cpp
+@@ -1,5 +1,6 @@
+ #include <QImage>
+ #include <QPainter>
++#include <QPainterPath>
+ #include <cmath>
+ #include <QUuid>
+ #include <cmath>
diff --git a/graphics/dust3d/files/patch-thirdparty_quickjs_quickjs-2019-07-09-dust3d_quickjs.c b/graphics/dust3d/files/patch-thirdparty_quickjs_quickjs-2019-07-09-dust3d_quickjs.c
new file mode 100644
index 000000000000..1eab0e6455f1
--- /dev/null
+++ b/graphics/dust3d/files/patch-thirdparty_quickjs_quickjs-2019-07-09-dust3d_quickjs.c
@@ -0,0 +1,11 @@
+--- thirdparty/quickjs/quickjs-2019-07-09-dust3d/quickjs.c.orig	2020-04-12 10:44:20 UTC
++++ thirdparty/quickjs/quickjs-2019-07-09-dust3d/quickjs.c
+@@ -36,6 +36,8 @@
+ #include <malloc/malloc.h>
+ #elif defined(__linux__)
+ #include <malloc.h>
++#elif defined(__FreeBSD__)
++#include <malloc_np.h>
+ #endif
+ 
+ #include "cutils.h"
diff --git a/graphics/dust3d/pkg-descr b/graphics/dust3d/pkg-descr
new file mode 100644
index 000000000000..92afc4277b44
--- /dev/null
+++ b/graphics/dust3d/pkg-descr
@@ -0,0 +1,8 @@
+Dust3D is a cross-platform open-source 3D modeling software, offering
+auto-UV unwrapping, auto-rigging with PBR material support, pose, and
+motion authoring all in one.
+
+It allows to create watertight 3D models in seconds.  Use it to speed
+up character modeling for games, 3D printing, and so on.
+
+WWW: https://dust3d.org/