Sun Sep 18 17:08:20 2016 UTC ()
Import nvidia-texture-tools-2.0.8 as graphics/nvidia-texture-tools

NVIDIA Texture Tools is a collection of image processing and texture
manipulation tools, designed to be integrated in game tools and asset
conditioning pipelines.  The primary features of the library are mipmap and
normal map generation, format conversion and DXT compression.


(kamil)
diff -r0 -r1.1 pkgsrc/graphics/nvidia-texture-tools/DESCR
diff -r0 -r1.1 pkgsrc/graphics/nvidia-texture-tools/Makefile
diff -r0 -r1.1 pkgsrc/graphics/nvidia-texture-tools/PLIST
diff -r0 -r1.1 pkgsrc/graphics/nvidia-texture-tools/buildlink3.mk
diff -r0 -r1.1 pkgsrc/graphics/nvidia-texture-tools/distinfo
diff -r0 -r1.1 pkgsrc/graphics/nvidia-texture-tools/patches/patch-src_nvcore_Debug.cpp
diff -r0 -r1.1 pkgsrc/graphics/nvidia-texture-tools/patches/patch-src_nvcore_DefsGnucNetBSD.h
diff -r0 -r1.1 pkgsrc/graphics/nvidia-texture-tools/patches/patch-src_nvcore_nvcore.h
diff -r0 -r1.1 pkgsrc/graphics/nvidia-texture-tools/patches/patch-src_nvcore_poshlib_posh.h
diff -r0 -r1.1 pkgsrc/graphics/nvidia-texture-tools/patches/patch-src_nvimage_ImageIO.cpp
diff -r0 -r1.1 pkgsrc/graphics/nvidia-texture-tools/patches/patch-src_nvmath_nvmath.h

File Added: pkgsrc/graphics/nvidia-texture-tools/DESCR
NVIDIA Texture Tools is a collection of image processing and texture
manipulation tools, designed to be integrated in game tools and asset
conditioning pipelines.  The primary features of the library are mipmap and
normal map generation, format conversion and DXT compression.

File Added: pkgsrc/graphics/nvidia-texture-tools/Makefile
# $NetBSD: Makefile,v 1.1 2016/09/18 17:08:20 kamil Exp $

DISTNAME=	nvidia-texture-tools-2.0.8
CATEGORIES=	graphics
MASTER_SITES=	${MASTER_SITE_GITHUB:=castano/}

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	https://github.com/castano/nvidia-texture-tools/wiki
COMMENT=	Texture processing tools with support for Direct3D 10 and 11 formats
LICENSE=	mit

HAS_CONFIGURE=	yes
USE_CMAKE=	yes
USE_LANGUAGES=	c c++

CMAKE_ARGS+=	-DNVTT_SHARED=ON

.include "../../graphics/openexr/buildlink3.mk"
.include "../../graphics/png/buildlink3.mk"
.include "../../graphics/tiff/buildlink3.mk"
.include "../../mk/jpeg.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

File Added: pkgsrc/graphics/nvidia-texture-tools/PLIST
@comment $NetBSD: PLIST,v 1.1 2016/09/18 17:08:20 kamil Exp $
bin/nvassemble
bin/nvcompress
bin/nvddsinfo
bin/nvdecompress
bin/nvimgdiff
bin/nvzoom
include/nvtt/nvtt.h
lib/libnvcore.so
lib/libnvimage.so
lib/libnvmath.so
lib/libnvtt.so

File Added: pkgsrc/graphics/nvidia-texture-tools/buildlink3.mk
# $NetBSD: buildlink3.mk,v 1.1 2016/09/18 17:08:20 kamil Exp $

BUILDLINK_TREE+=	nvidia-texture-tools

.if !defined(NVIDIA_TEXTURE_TOOLS_BUILDLINK3_MK)
NVIDIA_TEXTURE_TOOLS_BUILDLINK3_MK:=

BUILDLINK_API_DEPENDS.nvidia-texture-tools+=	nvidia-texture-tools>=2.0.8
BUILDLINK_PKGSRCDIR.nvidia-texture-tools?=	../../wip/nvidia-texture-tools

.include "../../graphics/openexr/buildlink3.mk"
.include "../../graphics/png/buildlink3.mk"
.include "../../graphics/tiff/buildlink3.mk"
.endif	# NVIDIA_TEXTURE_TOOLS_BUILDLINK3_MK

BUILDLINK_TREE+=	-nvidia-texture-tools

File Added: pkgsrc/graphics/nvidia-texture-tools/distinfo
$NetBSD: distinfo,v 1.1 2016/09/18 17:08:20 kamil Exp $

SHA1 (nvidia-texture-tools-2.0.8.tar.gz) = 5e032be01a17feef3f78fd0aa35aaf1eec81b620
RMD160 (nvidia-texture-tools-2.0.8.tar.gz) = 86fc38c77cf0529bd0b1746322a7923cc3deecaf
SHA512 (nvidia-texture-tools-2.0.8.tar.gz) = 342b9e14a1bdeeee8fae4a3b0446b25b01e13915cc5bd29396e6ca01bb1262c64e759008a7d7debf8a811c7cf16c54d44c22f31557e626cd0bafea07724bab01
Size (nvidia-texture-tools-2.0.8.tar.gz) = 939218 bytes
SHA1 (patch-src_nvcore_Debug.cpp) = 17499d48fca6d19a0adc4118e4e64a22913ca64f
SHA1 (patch-src_nvcore_DefsGnucNetBSD.h) = b5497bad0aac0cfbc8c10da70b0918621935a919
SHA1 (patch-src_nvcore_nvcore.h) = c769e4d3a4bfe02054df7c7529554e21c3108e3c
SHA1 (patch-src_nvcore_poshlib_posh.h) = 0641af0a61d0f5cc158623b204136c0e383586a3
SHA1 (patch-src_nvimage_ImageIO.cpp) = 0863e3d4f6dfcd2d1b94c0e9e7592a17c85caafd
SHA1 (patch-src_nvmath_nvmath.h) = c6a06d8043f5f80dc936b26f1cae41e7b2f4d804

File Added: pkgsrc/graphics/nvidia-texture-tools/patches/Attic/patch-src_nvcore_Debug.cpp
$NetBSD: patch-src_nvcore_Debug.cpp,v 1.1 2016/09/18 17:08:20 kamil Exp $

Add NetBSD support.

--- src/nvcore/Debug.cpp.orig	2010-05-15 09:12:05.000000000 +0000
+++ src/nvcore/Debug.cpp
@@ -34,7 +34,7 @@
 #	endif
 #endif
 
-#if NV_OS_DARWIN
+#if NV_OS_DARWIN || NV_OS_NETBSD
 #	include <unistd.h>	// getpid
 #	include <sys/types.h>
 #	include <sys/sysctl.h>	// sysctl
@@ -133,7 +133,7 @@ namespace 
 
 #elif !NV_OS_WIN32 && defined(HAVE_SIGNAL_H) // NV_OS_LINUX || NV_OS_DARWIN
 
-#if defined(HAVE_EXECINFO_H) // NV_OS_LINUX
+#if defined(HAVE_EXECINFO_H) // NV_OS_LINUX || NV_OS_NETBSD
 
 	static bool nvHasStackTrace() {
 #if NV_OS_DARWIN
@@ -199,6 +199,17 @@ namespace 
 				return (void *) ucp->uc_mcontext->ss.eip;
 #			endif
 #		endif
+#	elif NV_OS_NETBSD
+#		if NV_CPU_X86_64
+			ucontext_t * ucp = (ucontext_t *)secret;
+			return (void *)ucp->uc_mcontext.__gregs[_REG_RIP];
+#		elif NV_CPU_X86
+			ucontext_t * ucp = (ucontext_t *)secret;
+			return (void *)ucp->uc_mcontext.__gregs[_REG_EIP];
+#		elif NV_CPU_PPC
+			ucontext_t * ucp = (ucontext_t *)secret;
+			return (void *)ucp->uc_mcontext.__gregs[_REG_PC];
+#		endif
 #	else
 #		if NV_CPU_X86_64
 			// #define REG_RIP REG_INDEX(rip) // seems to be 16
@@ -215,7 +226,7 @@ namespace 
 		
 		// How to obtain the instruction pointers in different platforms, from mlton's source code.
 		// http://mlton.org/
-		// OpenBSD && NetBSD
+		// OpenBSD
 		// ucp->sc_eip
 		// FreeBSD:
 		// ucp->uc_mcontext.mc_eip
@@ -534,4 +545,3 @@ void debug::disableSigHandler()
 	
 #endif
 }
-

File Added: pkgsrc/graphics/nvidia-texture-tools/patches/Attic/patch-src_nvcore_DefsGnucNetBSD.h
$NetBSD: patch-src_nvcore_DefsGnucNetBSD.h,v 1.1 2016/09/18 17:08:20 kamil Exp $

Add NetBSD support.

--- src/nvcore/DefsGnucNetBSD.h.orig	2016-07-29 23:19:05.554359582 +0000
+++ src/nvcore/DefsGnucNetBSD.h
@@ -0,0 +1,65 @@
+#ifndef NV_CORE_H
+#error "Do not include this file directly."
+#endif
+
+#include <stdint.h> // uint8_t, int8_t, ...
+
+// Function linkage
+#define DLL_IMPORT
+#if __GNUC__ >= 4
+#       define DLL_EXPORT __attribute__((visibility("default")))
+#       define DLL_EXPORT_CLASS DLL_EXPORT
+#else
+#       define DLL_EXPORT
+#       define DLL_EXPORT_CLASS
+#endif
+
+// Function calling modes
+#if NV_CPU_X86
+#       define NV_CDECL         __attribute__((cdecl))
+#       define NV_STDCALL       __attribute__((stdcall))
+#else
+#       define NV_CDECL
+#       define NV_STDCALL
+#endif
+
+#define NV_FASTCALL             __attribute__((fastcall))
+#define NV_FORCEINLINE  __attribute__((always_inline))
+#define NV_DEPRECATED   __attribute__((deprecated))
+
+#if __GNUC__ > 2
+#define NV_PURE     __attribute__((pure))
+#define NV_CONST    __attribute__((const))
+#else
+#define NV_PURE
+#define NV_CONST
+#endif
+
+// Define __FUNC__ properly.
+#if __STDC_VERSION__ < 199901L
+#       if __GNUC__ >= 2
+#               define __FUNC__ __PRETTY_FUNCTION__     // __FUNCTION__
+#       else
+#               define __FUNC__ "<unknown>"
+#       endif
+#else
+#       define __FUNC__ __PRETTY_FUNCTION__
+#endif
+
+#define restrict    __restrict__
+
+// Type definitions
+typedef uint8_t     uint8;
+typedef int8_t      int8;
+
+typedef uint16_t    uint16;
+typedef int16_t     int16;
+
+typedef uint32_t    uint32;
+typedef int32_t     int32;
+
+typedef unsigned long long    uint64;
+typedef int64_t     int64;
+
+// Aliases
+typedef uint32      uint;

File Added: pkgsrc/graphics/nvidia-texture-tools/patches/Attic/patch-src_nvcore_nvcore.h
$NetBSD: patch-src_nvcore_nvcore.h,v 1.1 2016/09/18 17:08:20 kamil Exp $

Add NetBSD support.

--- src/nvcore/nvcore.h.orig	2010-05-15 09:12:05.000000000 +0000
+++ src/nvcore/nvcore.h
@@ -43,6 +43,9 @@
 #elif defined POSH_OS_MINGW
 #	define NV_OS_MINGW 1
 #	define NV_OS_WIN32 1
+#elif defined POSH_OS_NETBSD
+#	define NV_OS_NETBSD 1
+#	define NV_OS_UNIX 1
 #elif defined POSH_OS_OSX
 #	define NV_OS_DARWIN 1
 #	define NV_OS_UNIX 1
@@ -160,6 +163,8 @@
 #		include "DefsGnucLinux.h"
 #	elif NV_OS_DARWIN
 #		include "DefsGnucDarwin.h"
+#	elif NV_OS_NETBSD
+#		include "DefsGnucNetBSD.h"
 #	elif NV_OS_MINGW
 #		include "DefsGnucWin32.h"
 #	elif NV_OS_CYGWIN

File Added: pkgsrc/graphics/nvidia-texture-tools/patches/Attic/patch-src_nvcore_poshlib_posh.h
$NetBSD: patch-src_nvcore_poshlib_posh.h,v 1.1 2016/09/18 17:08:20 kamil Exp $

Add NetBSD support.

--- src/nvcore/poshlib/posh.h.orig	2010-05-15 09:12:05.000000000 +0000
+++ src/nvcore/poshlib/posh.h
@@ -372,6 +372,11 @@ Metrowerks:
 #  define POSH_OS_STRING "Amiga"
 #endif
 
+#if defined __NetBSD__
+#  define POSH_OS_NETBSD 1 
+#  define POSH_OS_STRING "NetBSD"
+#endif
+
 #if defined __unix__
 #  define POSH_OS_UNIX 1 
 #  if !defined POSH_OS_STRING
@@ -1003,5 +1008,3 @@ extern posh_i64_t  POSH_ReadI64FromBig( 
 #ifdef __cplusplus
 }
 #endif
-
-

File Added: pkgsrc/graphics/nvidia-texture-tools/patches/Attic/patch-src_nvimage_ImageIO.cpp
$NetBSD: patch-src_nvimage_ImageIO.cpp,v 1.1 2016/09/18 17:08:20 kamil Exp $

Add NetBSD support.
Adapt for new libpng API.
Fix false->NULL conversion warnings.

--- src/nvimage/ImageIO.cpp.orig	2010-05-15 09:12:05.000000000 +0000
+++ src/nvimage/ImageIO.cpp
@@ -135,7 +135,7 @@ FloatImage * nv::ImageIO::loadFloat(cons
 	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);
@@ -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()) {
@@ -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.
@@ -1506,4 +1506,3 @@ namespace ImageIO {
 } // ImageIO
 
 #endif // 0
-

File Added: pkgsrc/graphics/nvidia-texture-tools/patches/Attic/patch-src_nvmath_nvmath.h
$NetBSD: patch-src_nvmath_nvmath.h,v 1.1 2016/09/18 17:08:20 kamil Exp $

Add support for NetBSD.

--- src/nvmath/nvmath.h.orig	2010-05-15 09:12:05.000000000 +0000
+++ 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_NETBSD
 	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_NETBSD
 	return isnan(f);
 #elif NV_OS_LINUX
 	return isnanf(f);