git: e358c4062804 - main - graphics/nvidia-texture-tools: update 2.0.8.1 → 2.1.1

From: Dmitry Marakasov <amdmi3_at_FreeBSD.org>
Date: Thu, 31 Mar 2022 18:37:03 UTC
The branch main has been updated by amdmi3:

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

commit e358c406280404bad2b77aaf4f6347422e6136e1
Author:     Dmitry Marakasov <amdmi3@FreeBSD.org>
AuthorDate: 2022-03-17 15:59:59 +0000
Commit:     Dmitry Marakasov <amdmi3@FreeBSD.org>
CommitDate: 2022-03-31 18:36:13 +0000

    graphics/nvidia-texture-tools: update 2.0.8.1 → 2.1.1
    
    - Mark games/xray_re-tools BROKEN with maintainer's consent
---
 games/xray_re-tools/Makefile                       |  2 +
 graphics/nvidia-texture-tools/Makefile             | 26 +++-----
 graphics/nvidia-texture-tools/distinfo             |  6 +-
 .../files/patch-CMakeLists.txt                     | 26 ++++++++
 graphics/nvidia-texture-tools/files/patch-c++11    | 76 ----------------------
 .../files/patch-src-nvcore-Debug.cpp               | 26 --------
 .../files/patch-src-nvcore-Memory.h                | 20 ------
 .../files/patch-src-nvcore-nvcore.h                | 21 ------
 .../files/patch-src-nvcore-poshlib-posh.h          | 14 ----
 .../files/patch-src-nvimage-ImageIO.cpp            | 11 ----
 .../files/patch-src-nvmath-nvmath.h                | 20 ------
 .../files/patch-src-nvtt-CMakeLists.txt            | 15 -----
 .../files/patch-src_nvtt_squish_simd__ve.h         | 39 -----------
 graphics/nvidia-texture-tools/pkg-plist            |  5 +-
 14 files changed, 44 insertions(+), 263 deletions(-)

diff --git a/games/xray_re-tools/Makefile b/games/xray_re-tools/Makefile
index 0d5ea1d897b5..2ad6e7e00c3e 100644
--- a/games/xray_re-tools/Makefile
+++ b/games/xray_re-tools/Makefile
@@ -11,6 +11,8 @@ LIB_DEPENDS=	liblzo2.so:archivers/lzo2 \
 		libvorbisfile.so:audio/libvorbis \
 		libnvtt.so:graphics/nvidia-texture-tools
 
+BROKEN=		does not link: ld: error: undefined symbol: nv::mem::malloc
+
 USE_GITHUB=	yes
 GH_ACCOUNT=	abramcumner
 GH_TAGNAME=	52721d2
diff --git a/graphics/nvidia-texture-tools/Makefile b/graphics/nvidia-texture-tools/Makefile
index b3e59efbf710..38e87c1e536a 100644
--- a/graphics/nvidia-texture-tools/Makefile
+++ b/graphics/nvidia-texture-tools/Makefile
@@ -1,35 +1,27 @@
 PORTNAME=	nvidia-texture-tools
-PORTVERSION=	2.0.8.1 # needed to not bump PORTEPOCH; remove on next update
-PORTREVISION=	25
+PORTVERSION=	2.1.1
 CATEGORIES=	graphics
 
 MAINTAINER=	amdmi3@FreeBSD.org
 COMMENT=	Texture Tools with support for DirectX 10 texture formats
 
 LICENSE=	MIT
-LICENSE_FILE=	${WRKSRC}/NVIDIA_Texture_Tools_LICENSE.txt
+LICENSE_FILE=	${WRKSRC}/LICENSE
 
-# see src/nvcore/nvcore.h
-ONLY_FOR_ARCHS=		amd64 i386 powerpc powerpc64 powerpc64le
-
-LIB_DEPENDS=	libpng.so:graphics/png \
-		libtiff.so:graphics/tiff \
-		libOpenEXR.so:graphics/openexr
+ONLY_FOR_ARCHS=	i386 amd64 powerpc powerpc64 armv6 aarch64  # see src/nvcore/nvcore.h
 
+USES=		cmake compiler:c++11-lang
+CMAKE_ARGS=	-DNVTT_SHARED=TRUE \
+		-DNVTHREAD_SHARED=TRUE
 USE_GITHUB=	yes
 GH_ACCOUNT=	castano
-GH_TAGNAME=	${PORTVERSION:R}
-
-USES=		alias cmake compiler:c++11-lang jpeg
-CMAKE_ARGS=	-DNVTT_SHARED=TRUE
+USE_LDCONFIG=	yes
 
-CFLAGS+=	-fPIC
-CXXFLAGS+=	-fPIC
+CFLAGS_i386=	-msse -msse2
 
-PORTDOCS=	NVIDIA_Texture_Tools_README.txt ChangeLog
+PORTDOCS=	ChangeLog README.md
 
 OPTIONS_DEFINE=	DOCS
-OPTIONS_SUB=	yes
 
 post-install-DOCS-on:
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}
diff --git a/graphics/nvidia-texture-tools/distinfo b/graphics/nvidia-texture-tools/distinfo
index 54624da5422b..d50ddd21fc0d 100644
--- a/graphics/nvidia-texture-tools/distinfo
+++ b/graphics/nvidia-texture-tools/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1491085339
-SHA256 (castano-nvidia-texture-tools-2.0.8.1-2.0.8_GH0.tar.gz) = d188d0b28d61985c06dbc151278f8daa3edd680e910977d1261ba9fa4a151629
-SIZE (castano-nvidia-texture-tools-2.0.8.1-2.0.8_GH0.tar.gz) = 939218
+TIMESTAMP = 1647528012
+SHA256 (castano-nvidia-texture-tools-2.1.1_GH0.tar.gz) = 4cd23eef0c4af473b6ca644fb3a96d65ffc6bb06c1b207255c2c899f3c15e726
+SIZE (castano-nvidia-texture-tools-2.1.1_GH0.tar.gz) = 45303260
diff --git a/graphics/nvidia-texture-tools/files/patch-CMakeLists.txt b/graphics/nvidia-texture-tools/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..788d874fb0b5
--- /dev/null
+++ b/graphics/nvidia-texture-tools/files/patch-CMakeLists.txt
@@ -0,0 +1,26 @@
+--- CMakeLists.txt.orig	2017-08-23 18:05:30 UTC
++++ CMakeLists.txt
+@@ -25,9 +25,8 @@ IF(WIN32)
+ 	
+ ENDIF(WIN32)
+ 
+-INCLUDE(${NV_CMAKE_DIR}/OptimalOptions.cmake)
++SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") # the only useful line from OptimalOptions.cmake
+ MESSAGE(STATUS "Setting optimal options")
+-MESSAGE(STATUS "  Processor: ${NV_SYSTEM_PROCESSOR}")
+ MESSAGE(STATUS "  Compiler Flags: ${CMAKE_CXX_FLAGS}")
+ 
+ IF(CMAKE_BUILD_TYPE MATCHES "debug")
+@@ -45,12 +44,6 @@ ENDIF(NVTT_SHARED)
+ ADD_SUBDIRECTORY(extern)
+ 
+ ADD_SUBDIRECTORY(src)
+-
+-# These files should only be installed when creating packages.
+-INSTALL(FILES 
+-	LICENSE
+-	README.md
+-	DESTINATION share/doc/nvtt)
+ 
+ # Add packaging support
+ INCLUDE(InstallRequiredSystemLibraries)
diff --git a/graphics/nvidia-texture-tools/files/patch-c++11 b/graphics/nvidia-texture-tools/files/patch-c++11
deleted file mode 100644
index f33c4dd03485..000000000000
--- a/graphics/nvidia-texture-tools/files/patch-c++11
+++ /dev/null
@@ -1,76 +0,0 @@
-https://github.com/castano/nvidia-texture-tools/commit/65b3dfa4a6eb
-
-src/nvimage/ImageIO.cpp:138:10: error: cannot initialize return object of type 'nv::FloatImage *' with an rvalue of type 'bool'
-                return false;
-                       ^~~~~
-src/nvimage/ImageIO.cpp:236:12: error: cannot initialize return object of type 'nv::Image *' with an rvalue of type 'bool'
-                                return false;
-                                       ^~~~~
-src/nvimage/ImageIO.cpp:257:11: error: cannot initialize return object of type 'nv::Image *' with an rvalue of type 'bool'
-                        return false;
-                               ^~~~~
-src/nvimage/ImageIO.cpp:624:10: error: cannot initialize return object of type 'nv::Image *' with an rvalue of type 'bool'
-                return false;
-                       ^~~~~
-src/nvimage/ImageIO.cpp:632:10: error: cannot initialize return object of type 'nv::Image *' with an rvalue of type 'bool'
-                return false;
-                       ^~~~~
-src/nvimage/ImageIO.cpp:639:10: error: cannot initialize return object of type 'nv::Image *' with an rvalue of type 'bool'
-                return false;
-                       ^~~~~
-
---- src/nvimage/ImageIO.cpp.orig	2010-05-15 09:12:05 UTC
-+++ src/nvimage/ImageIO.cpp
-@@ -135,7 +135,7 @@ FloatImage * nv::ImageIO::loadFloat(const char * fileN
- 	StdInputStream stream(fileName);
- 	
- 	if (stream.isError()) {
--		return false;
-+		return NULL;
- 	}
- 	
- 	return loadFloat(fileName, stream);
-@@ -233,7 +233,7 @@ Image * nv::ImageIO::loadTGA(Stream & s)
- 		case TGA_TYPE_INDEXED:
- 			if( tga.colormap_type!=1 || tga.colormap_size!=24 || tga.colormap_length>256 ) {
- 				nvDebug( "*** ImageIO::loadTGA: Error, only 24bit paletted images are supported.\n" );
--				return false;
-+				return NULL;
- 			}
- 			pal = true;
- 			break;
-@@ -254,7 +254,7 @@ Image * nv::ImageIO::loadTGA(Stream & s)
- 
- 		default:
- 			nvDebug( "*** ImageIO::loadTGA: Error, unsupported image type.\n" );
--			return false;
-+			return NULL;
- 	}
- 
- 	const uint pixel_size = (tga.pixel_size/8);
-@@ -621,7 +621,7 @@ Image * nv::ImageIO::loadPNG(Stream & s)
- 	png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
- 	if (png_ptr == NULL) {
- 	//	nvDebug( "*** LoadPNG: Error allocating read buffer in file '%s'.\n", name );
--		return false;
-+		return NULL;
- 	}
- 
- 	// Allocate/initialize a memory block for the image information
-@@ -629,14 +629,14 @@ Image * nv::ImageIO::loadPNG(Stream & s)
- 	if (info_ptr == NULL) {
- 		png_destroy_read_struct(&png_ptr, NULL, NULL);
- 	//	nvDebug( "*** LoadPNG: Error allocating image information for '%s'.\n", name );
--		return false;
-+		return NULL;
- 	}
- 
- 	// Set up the error handling
- 	if (setjmp(png_jmpbuf(png_ptr))) {
- 		png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
- 	//	nvDebug( "*** LoadPNG: Error reading png file '%s'.\n", name );
--		return false;
-+		return NULL;
- 	}
- 
- 	// Set up the I/O functions.
diff --git a/graphics/nvidia-texture-tools/files/patch-src-nvcore-Debug.cpp b/graphics/nvidia-texture-tools/files/patch-src-nvcore-Debug.cpp
deleted file mode 100644
index 71f75cc9b6f6..000000000000
--- a/graphics/nvidia-texture-tools/files/patch-src-nvcore-Debug.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
---- src/nvcore/Debug.cpp.orig	2010-05-15 09:12:05 UTC
-+++ src/nvcore/Debug.cpp
-@@ -34,7 +34,7 @@
- #	endif
- #endif
- 
--#if NV_OS_DARWIN
-+#if NV_OS_DARWIN || NV_OS_FREEBSD
- #	include <unistd.h>	// getpid
- #	include <sys/types.h>
- #	include <sys/sysctl.h>	// sysctl
-@@ -199,6 +199,14 @@ namespace 
- 				return (void *) ucp->uc_mcontext->ss.eip;
- #			endif
- #		endif
-+#	elif NV_OS_FREEBSD
-+#		if NV_CPU_X86_64
-+			ucontext_t * ucp = (ucontext_t *)secret;
-+			return (void *)ucp->uc_mcontext.mc_rip;
-+#		elif NV_CPU_X86
-+			ucontext_t * ucp = (ucontext_t *)secret;
-+			return (void *)ucp->uc_mcontext.mc_eip;
-+#		endif
- #	else
- #		if NV_CPU_X86_64
- 			// #define REG_RIP REG_INDEX(rip) // seems to be 16
diff --git a/graphics/nvidia-texture-tools/files/patch-src-nvcore-Memory.h b/graphics/nvidia-texture-tools/files/patch-src-nvcore-Memory.h
deleted file mode 100644
index 0e75d65d1391..000000000000
--- a/graphics/nvidia-texture-tools/files/patch-src-nvcore-Memory.h
+++ /dev/null
@@ -1,20 +0,0 @@
---- src/nvcore/Memory.h.orig	2010-05-15 09:12:05 UTC
-+++ src/nvcore/Memory.h
-@@ -28,7 +28,7 @@ namespace nv
- 
- // Override new/delete
- 
--inline void * operator new (size_t size) throw()
-+inline void * operator new (size_t size) throw(std::bad_alloc)
- {
- 	return nv::mem::malloc(size); 
- }
-@@ -38,7 +38,7 @@ inline void operator delete (void *p) th
- 	nv::mem::free(p); 
- }
- 
--inline void * operator new [] (size_t size) throw()
-+inline void * operator new [] (size_t size) throw(std::bad_alloc)
- {
- 	return nv::mem::malloc(size);
- }
diff --git a/graphics/nvidia-texture-tools/files/patch-src-nvcore-nvcore.h b/graphics/nvidia-texture-tools/files/patch-src-nvcore-nvcore.h
deleted file mode 100644
index 7722a0894d52..000000000000
--- a/graphics/nvidia-texture-tools/files/patch-src-nvcore-nvcore.h
+++ /dev/null
@@ -1,21 +0,0 @@
---- src/nvcore/nvcore.h.orig	2010-05-15 09:12:05 UTC
-+++ src/nvcore/nvcore.h
-@@ -38,6 +38,9 @@
- #if defined POSH_OS_LINUX
- #	define NV_OS_LINUX 1
- #	define NV_OS_UNIX 1
-+#elif defined POSH_OS_FREEBSD
-+#	define NV_OS_FREEBSD 1
-+#	define NV_OS_UNIX 1
- #elif defined POSH_OS_CYGWIN32
- #	define NV_OS_CYGWIN 1
- #elif defined POSH_OS_MINGW
-@@ -158,7 +161,7 @@
- #elif NV_CC_GNUC
- #	if NV_OS_LINUX
- #		include "DefsGnucLinux.h"
--#	elif NV_OS_DARWIN
-+#	elif NV_OS_DARWIN || NV_OS_FREEBSD
- #		include "DefsGnucDarwin.h"
- #	elif NV_OS_MINGW
- #		include "DefsGnucWin32.h"
diff --git a/graphics/nvidia-texture-tools/files/patch-src-nvcore-poshlib-posh.h b/graphics/nvidia-texture-tools/files/patch-src-nvcore-poshlib-posh.h
deleted file mode 100644
index 3346645b1446..000000000000
--- a/graphics/nvidia-texture-tools/files/patch-src-nvcore-poshlib-posh.h
+++ /dev/null
@@ -1,14 +0,0 @@
---- src/nvcore/poshlib/posh.h.orig	2010-05-15 09:12:05 UTC
-+++ src/nvcore/poshlib/posh.h
-@@ -293,6 +293,11 @@ Metrowerks:
- #  define POSH_OS_STRING "Linux"
- #endif
- 
-+#if defined __FreeBSD__
-+#  define POSH_OS_FREEBSD 1
-+#  define POSH_OS_STRING "FreeBSD"
-+#endif
-+
- #if defined __CYGWIN32__
- #  define POSH_OS_CYGWIN32 1
- #  define POSH_OS_STRING "Cygwin"
diff --git a/graphics/nvidia-texture-tools/files/patch-src-nvimage-ImageIO.cpp b/graphics/nvidia-texture-tools/files/patch-src-nvimage-ImageIO.cpp
deleted file mode 100644
index 88eb50da1612..000000000000
--- a/graphics/nvidia-texture-tools/files/patch-src-nvimage-ImageIO.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
---- src/nvimage/ImageIO.cpp.orig	2010-05-15 09:12:05 UTC
-+++ src/nvimage/ImageIO.cpp
-@@ -603,7 +603,7 @@ static void user_read_data(png_structp p
- {
- 	nvDebugCheck(png_ptr != NULL);
- 	
--	Stream * s = (Stream *)png_ptr->io_ptr;
-+	Stream * s = (Stream *)png_get_io_ptr(png_ptr);
- 	s->serialize(data, (int)length);
- 	
- 	if (s->isError()) {
diff --git a/graphics/nvidia-texture-tools/files/patch-src-nvmath-nvmath.h b/graphics/nvidia-texture-tools/files/patch-src-nvmath-nvmath.h
deleted file mode 100644
index 43b5e1b15b1c..000000000000
--- a/graphics/nvidia-texture-tools/files/patch-src-nvmath-nvmath.h
+++ /dev/null
@@ -1,20 +0,0 @@
---- src/nvmath/nvmath.h.orig	2010-05-15 09:12:05 UTC
-+++ src/nvmath/nvmath.h
-@@ -115,7 +115,7 @@ inline bool isFinite(const float f)
- {
- #if NV_OS_WIN32
- 	return _finite(f) != 0;
--#elif NV_OS_DARWIN
-+#elif NV_OS_DARWIN || NV_OS_FREEBSD
- 	return isfinite(f);
- #elif NV_OS_LINUX
- 	return finitef(f);
-@@ -130,7 +130,7 @@ inline bool isNan(const float f)
- {
- #if NV_OS_WIN32
- 	return _isnan(f) != 0;
--#elif NV_OS_DARWIN
-+#elif NV_OS_DARWIN || NV_OS_FREEBSD
- 	return isnan(f);
- #elif NV_OS_LINUX
- 	return isnanf(f);
diff --git a/graphics/nvidia-texture-tools/files/patch-src-nvtt-CMakeLists.txt b/graphics/nvidia-texture-tools/files/patch-src-nvtt-CMakeLists.txt
deleted file mode 100644
index 8066228e5985..000000000000
--- a/graphics/nvidia-texture-tools/files/patch-src-nvtt-CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
---- src/nvtt/CMakeLists.txt.orig	2010-05-15 09:12:05 UTC
-+++ src/nvtt/CMakeLists.txt
-@@ -105,9 +105,11 @@ IF(QT4_FOUND AND NOT MSVC)
- 	QT4_WRAP_CPP(MOCS tools/configdialog.h)
- 	#QT4_ADD_RESOURCES(RCCS tools/configdialog.rc)
- 
--	ADD_EXECUTABLE(nvcompressui MACOSX_BUNDLE ${SRCS} ${UICS} ${MOCS})
-+	ADD_EXECUTABLE(nvcompressui ${SRCS} ${UICS} ${MOCS})
- 	TARGET_LINK_LIBRARIES(nvcompressui ${LIBS})
- 
-+	INSTALL(TARGETS nvcompressui DESTINATION bin)
-+
- ENDIF(QT4_FOUND AND NOT MSVC)
- 
- 
diff --git a/graphics/nvidia-texture-tools/files/patch-src_nvtt_squish_simd__ve.h b/graphics/nvidia-texture-tools/files/patch-src_nvtt_squish_simd__ve.h
deleted file mode 100644
index 436e29163de2..000000000000
--- a/graphics/nvidia-texture-tools/files/patch-src_nvtt_squish_simd__ve.h
+++ /dev/null
@@ -1,39 +0,0 @@
---- src/nvtt/squish/simd_ve.h.orig	2010-05-15 09:12:05 UTC
-+++ src/nvtt/squish/simd_ve.h
-@@ -31,7 +31,8 @@
- 
- namespace squish {
- 
--#define VEC4_CONST( X ) Vec4( ( vector float )( X ) )
-+#define VEC_INIT( X ) ( vector float ){ X, X, X, X }
-+#define VEC4_CONST( X ) Vec4( VEC_INIT( X ) )
- 
- class Vec4
- {
-@@ -96,7 +97,7 @@ public:
- 	
- 	Vec4& operator*=( Arg v )
- 	{
--		m_v = vec_madd( m_v, v.m_v, ( vector float )( -0.0f ) );
-+		m_v = vec_madd( m_v, v.m_v, VEC_INIT( -0.0f ) );
- 		return *this;
- 	}
- 	
-@@ -112,7 +113,7 @@ public:
- 	
- 	friend Vec4 operator*( Vec4::Arg left, Vec4::Arg right  )
- 	{
--		return Vec4( vec_madd( left.m_v, right.m_v, ( vector float )( -0.0f ) ) );
-+		return Vec4( vec_madd( left.m_v, right.m_v, VEC_INIT( -0.0f ) ) );
- 	}
- 	
- 	//! Returns a*b + c
-@@ -133,7 +134,7 @@ public:
- 		vector float estimate = vec_re( v.m_v );
- 		
- 		// one round of Newton-Rhaphson refinement
--		vector float diff = vec_nmsub( estimate, v.m_v, ( vector float )( 1.0f ) );
-+		vector float diff = vec_nmsub( estimate, v.m_v, VEC_INIT( 1.0f ) );
- 		return Vec4( vec_madd( diff, estimate, estimate ) );
- 	}
- 	
diff --git a/graphics/nvidia-texture-tools/pkg-plist b/graphics/nvidia-texture-tools/pkg-plist
index 772e8eccd79c..cc5ce4a5c031 100644
--- a/graphics/nvidia-texture-tools/pkg-plist
+++ b/graphics/nvidia-texture-tools/pkg-plist
@@ -1,11 +1,14 @@
+bin/nv-gnome-thumbnailer
 bin/nvassemble
 bin/nvcompress
 bin/nvddsinfo
 bin/nvdecompress
-bin/nvimgdiff
+bin/nvhdrtest
+bin/nvtestsuite
 bin/nvzoom
 include/nvtt/nvtt.h
 lib/libnvcore.so
 lib/libnvimage.so
 lib/libnvmath.so
+lib/libnvthread.so
 lib/libnvtt.so