git: 2ffe6f07cf95 - main - graphics/goxel: modernize the port and update to version 0.11.0

From: Alexey Dokuchaev <danfe_at_FreeBSD.org>
Date: Thu, 10 Nov 2022 06:25:35 UTC
The branch main has been updated by danfe:

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

commit 2ffe6f07cf959e5979e410ce3713d83b720a309a
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2022-11-10 06:23:50 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2022-11-10 06:23:50 +0000

    graphics/goxel: modernize the port and update to version 0.11.0
    
    - Lowercase all but the first word of the COMMENT, adjust LICENSE
      to match the source code headers
    - Drop unused dependency and INSTALLS_ICONS knob, massage USES and
      USE_GNOME lists as needed
    - Install more complete set of high-color icons, do not capitalize
      loop iterator variable
    - Provide more elaborate port description, move WWW line where it
      belongs these days (in the Makefile) and chase redirection
    - Assume maintainership since previous maintainer had stepped down
---
 graphics/goxel/Makefile                            | 38 +++++--------
 graphics/goxel/distinfo                            |  6 +-
 graphics/goxel/files/patch-SConstruct              | 64 ++++++++++++----------
 .../patch-ext__src_cycles_src_util_util__path.cpp  | 13 -----
 .../files/patch-ext__src_yocto_ext_filesystem.hpp  | 11 ++++
 graphics/goxel/pkg-descr                           | 16 +++++-
 graphics/goxel/pkg-plist                           |  4 ++
 7 files changed, 82 insertions(+), 70 deletions(-)

diff --git a/graphics/goxel/Makefile b/graphics/goxel/Makefile
index 238c28d0fc4f..bec256c8df03 100644
--- a/graphics/goxel/Makefile
+++ b/graphics/goxel/Makefile
@@ -1,43 +1,35 @@
 PORTNAME=	goxel
+PORTVERSION=	0.11.0
 DISTVERSIONPREFIX=	v
-DISTVERSION=	0.8.2
-PORTREVISION=	1
 CATEGORIES=	graphics
 
-MAINTAINER=	greg@unrelenting.technology
-COMMENT=	Free and Open Source 3D Voxel Editor
+MAINTAINER=	danfe@FreeBSD.org
+COMMENT=	Free and open-source 3D voxel editor
+WWW=		https://goxel.xyz/
 
-LICENSE=	GPLv3
+LICENSE=	GPLv3+
 LICENSE_FILE=	${WRKSRC}/COPYING
 
-LIB_DEPENDS=	libargp.so:devel/argp-standalone \
-		libglfw.so:graphics/glfw \
+LIB_DEPENDS=	libglfw.so:graphics/glfw \
 		libpng.so:graphics/png
 
-USES=		compiler:c++11-lang pkgconfig scons gnome gl
+USES=		compiler:c++17-lang gl gnome pkgconfig scons
 USE_GITHUB=	yes
 GH_ACCOUNT=	guillaumechereau
-USE_GNOME=	cairo gtk30
 USE_GL=		gl
+USE_GNOME=	cairo gdkpixbuf2 gtk30
+
+MAKE_ARGS=	mode=release werror=false
 
-INSTALLS_ICONS=	yes
-MAKE_ARGS=	debug=0 werror=0
 DESKTOP_ENTRIES="Goxel" "${COMMENT}" "${PORTNAME}" \
 	"${PORTNAME}" "Graphics;3DGraphics;" false
 
-.include <bsd.port.pre.mk>
-
-.if ${ARCH} != amd64 && ${ARCH} != i386
-post-patch:
-	${REINPLACE_CMD} -e 's/-msse2 //g' ${WRKSRC}/SConstruct
-.endif
-
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/
-.for SZ in 32 64 256
-	@${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/${SZ}x${SZ}/apps
-	${INSTALL_DATA} ${WRKSRC}/osx/goxel/goxel/Assets.xcassets/AppIcon.appiconset/${SZ}.png \
-		${STAGEDIR}${PREFIX}/share/icons/hicolor/${SZ}x${SZ}/apps/goxel.png
+.for n in 16 32 64 128 512 256 1024
+	@${MKDIR} ${STAGEDIR}${PREFIX}/share/icons/hicolor/${n}x${n}/apps
+	${INSTALL_DATA} ${WRKSRC}/osx/goxel/goxel/Assets.xcassets/AppIcon.appiconset/${n}.png \
+		${STAGEDIR}${PREFIX}/share/icons/hicolor/${n}x${n}/apps/goxel.png
 .endfor
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/graphics/goxel/distinfo b/graphics/goxel/distinfo
index a23644b16088..0bf33d32dba8 100644
--- a/graphics/goxel/distinfo
+++ b/graphics/goxel/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1545486941
-SHA256 (guillaumechereau-goxel-v0.8.2_GH0.tar.gz) = 4f8297560e356cb69469e0a23bcb4e9c4e8549766a0466ffeaa0c9cfb7a04049
-SIZE (guillaumechereau-goxel-v0.8.2_GH0.tar.gz) = 3387515
+TIMESTAMP = 1660638635
+SHA256 (guillaumechereau-goxel-v0.11.0_GH0.tar.gz) = 660030e1b3b33a3e909d8189780a192cba059774af57b042ecb63297f2a6d0fc
+SIZE (guillaumechereau-goxel-v0.11.0_GH0.tar.gz) = 2718621
diff --git a/graphics/goxel/files/patch-SConstruct b/graphics/goxel/files/patch-SConstruct
index a4c6b5177ff8..58485b0130ac 100644
--- a/graphics/goxel/files/patch-SConstruct
+++ b/graphics/goxel/files/patch-SConstruct
@@ -1,35 +1,41 @@
---- SConstruct.orig	2018-12-22 14:00:12 UTC
+--- SConstruct.orig	2022-08-16 08:30:35 UTC
 +++ SConstruct
-@@ -28,15 +28,18 @@ clang = int(ARGUMENTS.get("clang", 0))
- cycles = int(ARGUMENTS.get('cycles', 1))
- sound = False
+@@ -45,10 +45,6 @@ if os.environ.get('CC') == 'clang':
+ if os.environ.get('CC') == 'clang':
+     env.Replace(CC='clang', CXX='clang++')
  
--if os.environ.get('CC') == 'clang': clang = 1
-+import subprocess
-+if b'clang' in subprocess.check_output([os.environ.get('CC', 'cc'), '-v'],
-+                                      stderr=subprocess.STDOUT):
-+    clang = 1
-+print('clang', clang)
- if profile: debug = 0
+-# Hack for gcc <= 5, since pragma diagnostic push doesn't seem to work.
+-if env['CCVERSION'] and int(env['CCVERSION'].split('.')[0]) <= 5:
+-    env.Append(CCFLAGS=['-Wno-unused-function'])
+-
+ # Asan & Ubsan (need to come first).
+ if env['mode'] == 'debug' and target_os == 'posix':
+     env.Append(CCFLAGS=['-fsanitize=address', '-fsanitize=undefined'],
+@@ -70,7 +66,7 @@ if env['mode'] not in ['debug', 'analyze']:
+     env.Append(CCFLAGS='-Werror')
  
--env = Environment(ENV = os.environ)
-+
-+env = Environment(ENV = os.environ, CC = os.environ.get('CC', 'cc'),
-+                  CXX = os.environ.get('CXX', 'c++'))
- conf = env.Configure()
+ if env['mode'] not in ['debug', 'analyze']:
+-    env.Append(CPPDEFINES='NDEBUG', CCFLAGS='-Ofast')
++    env.Append(CPPDEFINES='NDEBUG')
  
--if clang:
--    env.Replace(CC='clang', CXX='clang++')
+ if env['mode'] == 'debug':
+     env.Append(CCFLAGS=['-O0'])
+@@ -88,16 +84,14 @@ for root, dirnames, filenames in os.walk('src'):
+         if filename.endswith('.c') or filename.endswith('.cpp'):
+             sources.append(os.path.join(root, filename))
+ 
+-# Check for libpng.
+-if conf.CheckLibWithHeader('libpng', 'png.h', 'c'):
+-    env.Append(CPPDEFINES='HAVE_LIBPNG=1')
 -
- # Asan & Ubsan (need to come first).
- # Cycles doesn't like libasan with clang, so we only use it on
- # C code with clang.
-@@ -145,7 +148,7 @@ if cycles:
-     sources += glob.glob('ext_src/cycles/src/subd/*.cpp')
+ # Linux compilation support.
+ if target_os == 'posix':
++    env.Append(CPPDEFINES='HAVE_LIBPNG=1')
+     env.Append(LIBS=['GL', 'm'])
+     # Note: add '--static' to link with all the libs needed by glfw3.
+     env.ParseConfig('pkg-config --libs glfw3')
+     env.ParseConfig('pkg-config --cflags --libs gtk+-3.0')
++    env.ParseConfig('pkg-config --libs libpng')
  
-     env.Append(CPPPATH=['ext_src/cycles/src'])
--    env.Append(CPPPATH=['ext_src/cycles/third_party/atomic'])
-+    env.Prepend(CPPPATH=['ext_src/cycles/third_party/atomic'])
-     env.Append(CPPFLAGS=[
-         '-DCYCLES_STD_UNORDERED_MAP',
-         '-DCCL_NAMESPACE_BEGIN=namespace ccl {',
+ # Windows compilation support.
+ if target_os == 'msys':
diff --git a/graphics/goxel/files/patch-ext__src_cycles_src_util_util__path.cpp b/graphics/goxel/files/patch-ext__src_cycles_src_util_util__path.cpp
deleted file mode 100644
index 008ccd5b9909..000000000000
--- a/graphics/goxel/files/patch-ext__src_cycles_src_util_util__path.cpp
+++ /dev/null
@@ -1,13 +0,0 @@
---- ext_src/cycles/src/util/util_path.cpp.orig	2018-12-22 14:23:19 UTC
-+++ ext_src/cycles/src/util/util_path.cpp
-@@ -38,6 +38,10 @@
- #  include <shlwapi.h>
- #endif
- 
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
-+#include <sys/sysctl.h>
-+#endif
-+
- #include "util/util_map.h"
- #include "util/util_windows.h"
- 
diff --git a/graphics/goxel/files/patch-ext__src_yocto_ext_filesystem.hpp b/graphics/goxel/files/patch-ext__src_yocto_ext_filesystem.hpp
new file mode 100644
index 000000000000..36a411cc8cc7
--- /dev/null
+++ b/graphics/goxel/files/patch-ext__src_yocto_ext_filesystem.hpp
@@ -0,0 +1,11 @@
+--- ext_src/yocto/ext/filesystem.hpp.orig	2022-08-16 08:30:35 UTC
++++ ext_src/yocto/ext/filesystem.hpp
+@@ -1525,7 +1525,7 @@ GHC_INLINE std::string systemErrorText(ErrorNumber cod
+     std::string msg = toUtf8(std::wstring((LPWSTR)msgBuf));
+     LocalFree(msgBuf);
+     return msg;
+-#elif defined(GHC_OS_MACOS) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)) || (defined(GHC_OS_ANDROID) && __ANDROID_API__ < 23) || defined(EMSCRIPTEN)
++#elif defined(GHC_OS_MACOS) || ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE)) || (defined(GHC_OS_ANDROID) && __ANDROID_API__ < 23) || defined(EMSCRIPTEN) || defined(__FreeBSD__)
+     char buffer[512];
+     int rc = strerror_r(code ? code : errno, buffer, sizeof(buffer));
+     return rc == 0 ? (const char*)buffer : "Error in strerror_r!";
diff --git a/graphics/goxel/pkg-descr b/graphics/goxel/pkg-descr
index 915c619ae2e6..254f03df8b9f 100644
--- a/graphics/goxel/pkg-descr
+++ b/graphics/goxel/pkg-descr
@@ -1,3 +1,15 @@
-A 3D program that lets you create voxel volumes, a bit similar to minecraft.
+A 3D program for creating voxel volumes, a bit similar to Minecraft.
 
-WWW: https://guillaumechereau.github.io/goxel/
+By restricting the volume along a 3D grid, just like pixels do in two
+dimensions, voxels make 3D editing as intuitive as drawing in 2D.
+Voxel art is used in many video games, and also by artists as a
+standalone style.
+
+Make your scene as large as you want.  Goxel uses sparse matrices
+internally so there is not restrictions on how big a model can be.
+
+Use layers to separate parts of the scene into independently editable
+3D models.
+
+Goxel can export to many formats, including: Magica Voxel, Qubicle,
+glTF2, obj, ply, build engine.
diff --git a/graphics/goxel/pkg-plist b/graphics/goxel/pkg-plist
index 12fd45320092..f99b2abc9dbb 100644
--- a/graphics/goxel/pkg-plist
+++ b/graphics/goxel/pkg-plist
@@ -1,4 +1,8 @@
 bin/goxel
+share/icons/hicolor/16x16/apps/goxel.png
 share/icons/hicolor/32x32/apps/goxel.png
 share/icons/hicolor/64x64/apps/goxel.png
+share/icons/hicolor/128x128/apps/goxel.png
 share/icons/hicolor/256x256/apps/goxel.png
+share/icons/hicolor/512x512/apps/goxel.png
+share/icons/hicolor/1024x1024/apps/goxel.png