pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Import 0ad-0.0.20.alpha as wip/0ad.



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Fri Jul 29 23:54:37 2016 +0200
Changeset:	88302183b034bec40df8dc4ada6549fe8dd67acc

Added Files:
	0ad/DESCR
	0ad/Makefile
	0ad/PLIST
	0ad/distinfo
	0ad/patches/patch-build_premake_extern__libs4.lua
	0ad/patches/patch-build_workspaces_clean-workspaces.sh
	0ad/patches/patch-build_workspaces_update-workspaces.sh
	0ad/patches/patch-libraries_source_fcollada_include_FCDocument_FCDocument.h
	0ad/patches/patch-libraries_source_fcollada_include_FUtils_FUCriticalSection.h
	0ad/patches/patch-libraries_source_fcollada_include_FUtils_Platforms.h
	0ad/patches/patch-libraries_source_fcollada_src_FCollada_FCDocument_FCDocument.h
	0ad/patches/patch-libraries_source_fcollada_src_FCollada_FUtils_FUCriticalSection.h
	0ad/patches/patch-libraries_source_fcollada_src_FCollada_FUtils_FUStringBuilder.hpp
	0ad/patches/patch-libraries_source_fcollada_src_FCollada_FUtils_Platforms.h
	0ad/patches/patch-libraries_source_nvtt_src_src_nvcore_Debug.cpp
	0ad/patches/patch-libraries_source_nvtt_src_src_nvcore_nvcore.h
	0ad/patches/patch-libraries_source_nvtt_src_src_nvcore_poshlib_posh.h
	0ad/patches/patch-libraries_source_nvtt_src_src_nvmath_nvmath.h
	0ad/patches/patch-source_third__party_mikktspace_weldmesh.cpp

Log Message:
Import 0ad-0.0.20.alpha as wip/0ad.

0 A.D. (pronounced "zero ey-dee") is a free, open-source, cross-platform
real-time strategy (RTS) game of ancient warfare. In short, it is a
historically-based war/economy game that allows players to relive or rewrite
the history of Western civilizations, focusing on the years between 500 B.C.
and 500 A.D. The project is highly ambitious, involving state-of-the-art 3D
graphics, detailed artwork, sound, and a flexible and powerful custom-built
game engine.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=88302183b034bec40df8dc4ada6549fe8dd67acc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 0ad/DESCR                                          |   7 +
 0ad/Makefile                                       |  31 ++++
 0ad/PLIST                                          |   1 +
 0ad/distinfo                                       |  21 +++
 0ad/patches/patch-build_premake_extern__libs4.lua  |  22 +++
 .../patch-build_workspaces_clean-workspaces.sh     |  22 +++
 .../patch-build_workspaces_update-workspaces.sh    |  15 ++
 ...source_fcollada_include_FCDocument_FCDocument.h |  13 ++
 ...rce_fcollada_include_FUtils_FUCriticalSection.h |  13 ++
 ...ries_source_fcollada_include_FUtils_Platforms.h |  43 ++++++
 ...e_fcollada_src_FCollada_FCDocument_FCDocument.h |  13 ++
 ...collada_src_FCollada_FUtils_FUCriticalSection.h |  13 ++
 ...collada_src_FCollada_FUtils_FUStringBuilder.hpp | 156 +++++++++++++++++++++
 ...source_fcollada_src_FCollada_FUtils_Platforms.h |  34 +++++
 ...-libraries_source_nvtt_src_src_nvcore_Debug.cpp |  42 ++++++
 ...h-libraries_source_nvtt_src_src_nvcore_nvcore.h |  23 +++
 ...aries_source_nvtt_src_src_nvcore_poshlib_posh.h |  22 +++
 ...h-libraries_source_nvtt_src_src_nvmath_nvmath.h |  22 +++
 ...tch-source_third__party_mikktspace_weldmesh.cpp |  18 +++
 19 files changed, 531 insertions(+)

diffs:
diff --git a/0ad/DESCR b/0ad/DESCR
new file mode 100644
index 0000000..e581dd0
--- /dev/null
+++ b/0ad/DESCR
@@ -0,0 +1,7 @@
+0 A.D. (pronounced "zero ey-dee") is a free, open-source, cross-platform
+real-time strategy (RTS) game of ancient warfare. In short, it is a
+historically-based war/economy game that allows players to relive or rewrite
+the history of Western civilizations, focusing on the years between 500 B.C.
+and 500 A.D. The project is highly ambitious, involving state-of-the-art 3D
+graphics, detailed artwork, sound, and a flexible and powerful custom-built
+game engine.
diff --git a/0ad/Makefile b/0ad/Makefile
new file mode 100644
index 0000000..44e5c07
--- /dev/null
+++ b/0ad/Makefile
@@ -0,0 +1,31 @@
+# $NetBSD$
+
+DISTNAME=	0ad-0.0.20-alpha-unix-build
+PKGNAME=	${DISTNAME:S/-unix-build//:S/-alpha/.alpha/}
+CATEGORIES=	games
+MASTER_SITES=	http://releases.wildfiregames.com/
+EXTRACT_SUFX=	.tar.xz
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	http://releases.wildfiregames.com/
+COMMENT=	Historical real-time strategy game
+LICENSE=	gnu-gpl-v2 AND gnu-lgpl-v2.1
+
+WRKSRC=		${WRKDIR}/${DISTNAME:S/-unix-build//}
+USE_LANGUAGES=	c c++
+
+USE_TOOLS+=	gmake perl bash
+
+do-configure:
+	${RUN} cd ${WRKSRC} && ./build/workspaces/clean-workspaces.sh
+	${RUN} cd ${WRKSRC} && ./build/workspaces/update-workspaces.sh \
+		--bindir=${PREFIX}/bin \
+		--datadir=${PREFIX}/share/${PKGBASE} \
+		--libdir=${PREFIX}/lib/${PKGBASE}
+
+do-build:
+	${RUN} cd ${WRKSRC} && \
+		${GMAKE} config=release verbose=1 -C build/workspaces/gcc
+
+.include "../../textproc/libxml2/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/0ad/PLIST b/0ad/PLIST
new file mode 100644
index 0000000..48d96a5
--- /dev/null
+++ b/0ad/PLIST
@@ -0,0 +1 @@
+@comment $NetBSD$
diff --git a/0ad/distinfo b/0ad/distinfo
new file mode 100644
index 0000000..4923e67
--- /dev/null
+++ b/0ad/distinfo
@@ -0,0 +1,21 @@
+$NetBSD$
+
+SHA1 (0ad-0.0.20-alpha-unix-build.tar.xz) = 4c056ee114e6b50f456ad14be961a101728e99a3
+RMD160 (0ad-0.0.20-alpha-unix-build.tar.xz) = 0f1283fe287f539f32fa0466f93b881aeca45dc9
+SHA512 (0ad-0.0.20-alpha-unix-build.tar.xz) = 786f92b74c2e0c64c07ef2f5578dcb5c753fb4fed7238d385bca23549805fcfaeecb9bfbfae809a2ac09a7dfc804455237346588099db347c28a3ff0ae284c43
+Size (0ad-0.0.20-alpha-unix-build.tar.xz) = 25610932 bytes
+SHA1 (patch-build_premake_extern__libs4.lua) = dfdbce501c9506ebfe9be2a5bdf30f5f7cdbb86b
+SHA1 (patch-build_workspaces_clean-workspaces.sh) = fed7e867eb8e24e37860599269f9feb4d30c5a43
+SHA1 (patch-build_workspaces_update-workspaces.sh) = 26093813799b24ec86e91b1d51e8a6d1c9922087
+SHA1 (patch-libraries_source_fcollada_include_FCDocument_FCDocument.h) = 9f60871e9f05784b10ba97efffe756ece473f9b2
+SHA1 (patch-libraries_source_fcollada_include_FUtils_FUCriticalSection.h) = 1ece7ae54c07515fdbca12f71c97add7c9e496e1
+SHA1 (patch-libraries_source_fcollada_include_FUtils_Platforms.h) = 32308e3fe673903b4b1a17c364840818136411b9
+SHA1 (patch-libraries_source_fcollada_src_FCollada_FCDocument_FCDocument.h) = e7359366d4aa5f76feefe8c79768b341335a2c80
+SHA1 (patch-libraries_source_fcollada_src_FCollada_FUtils_FUCriticalSection.h) = 55ee4470672e0e3a55bd208c0c1df9b6bedf604a
+SHA1 (patch-libraries_source_fcollada_src_FCollada_FUtils_FUStringBuilder.hpp) = 8f9983120b63141ac3b342bc924d82748e23850d
+SHA1 (patch-libraries_source_fcollada_src_FCollada_FUtils_Platforms.h) = d0dbefd34af4b87d24c486a6af19e05ae5231deb
+SHA1 (patch-libraries_source_nvtt_src_src_nvcore_Debug.cpp) = e1f16fedfa6cc22be43e799415ce91d8d9e7305f
+SHA1 (patch-libraries_source_nvtt_src_src_nvcore_nvcore.h) = 2cd3f056b75172ae5e15404746374d627e78ba09
+SHA1 (patch-libraries_source_nvtt_src_src_nvcore_poshlib_posh.h) = b0759ead96db78237c5fa400cf320ab02e8b262b
+SHA1 (patch-libraries_source_nvtt_src_src_nvmath_nvmath.h) = 218723373dc9f117eca33960cac045acc0eee97a
+SHA1 (patch-source_third__party_mikktspace_weldmesh.cpp) = 35df7dd5d5d2aa784ef03599a47cc69982ebe332
diff --git a/0ad/patches/patch-build_premake_extern__libs4.lua b/0ad/patches/patch-build_premake_extern__libs4.lua
new file mode 100644
index 0000000..2da0226
--- /dev/null
+++ b/0ad/patches/patch-build_premake_extern__libs4.lua
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- build/premake/extern_libs4.lua.orig	2016-03-12 18:15:04.000000000 +0000
++++ build/premake/extern_libs4.lua
+@@ -347,7 +347,7 @@ extern_lib_defs = {
+ 			elseif os.is("macosx") then
+ 				add_default_include_paths("iconv")
+ 				defines { "LIBICONV_STATIC" }
+-			elseif os.getversion().description == "FreeBSD" then
++			elseif os.getversion().description == "NetBSD" then
+ 				defines { "HAVE_ICONV_CONST" }
+ 				defines { "ICONV_CONST=const" }
+ 			end
+@@ -366,7 +366,7 @@ extern_lib_defs = {
+ 			-- FreeBSD 10+ has iconv as a part of libc
+ 			if os.is("bsd")
+ 			   and not (os.getversion().description == "FreeBSD" and os.getversion().majorversion >= 10
+-			            or os.getversion().description == "GNU/kFreeBSD") then
++			            or os.getversion().description == "GNU/kFreeBSD") and not os.getversion().description == "NetBSD" then
+ 				add_default_links({
+ 					bsd_names = { "iconv" },
+ 				})
diff --git a/0ad/patches/patch-build_workspaces_clean-workspaces.sh b/0ad/patches/patch-build_workspaces_clean-workspaces.sh
new file mode 100644
index 0000000..e43c052
--- /dev/null
+++ b/0ad/patches/patch-build_workspaces_clean-workspaces.sh
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- build/workspaces/clean-workspaces.sh.orig	2015-08-19 01:30:09.000000000 +0000
++++ build/workspaces/clean-workspaces.sh
+@@ -3,7 +3,7 @@
+ # Some of our makefiles depend on GNU make, so we set some sane defaults if MAKE
+ # is not set.
+ case "`uname -s`" in
+-  "FreeBSD" | "OpenBSD" )
++  "FreeBSD" | "NetBSD" | "OpenBSD" )
+     MAKE=${MAKE:="gmake"}
+     ;;
+   * )
+@@ -37,7 +37,7 @@ fi
+ 
+ echo "Removing generated test files..."
+ 
+-find ../../source -name "test_*.cpp" -type f -not -name "test_setup.cpp" -exec rm {} \;
++find ../../source -name "test_*.cpp" -type f ! -name "test_setup.cpp" -exec rm {} \;
+ 
+ echo "Cleaning build output..."
+ 
diff --git a/0ad/patches/patch-build_workspaces_update-workspaces.sh b/0ad/patches/patch-build_workspaces_update-workspaces.sh
new file mode 100644
index 0000000..fa50ea6
--- /dev/null
+++ b/0ad/patches/patch-build_workspaces_update-workspaces.sh
@@ -0,0 +1,15 @@
+$NetBSD$
+
+--- build/workspaces/update-workspaces.sh.orig	2016-07-29 19:33:02.688237533 +0000
++++ build/workspaces/update-workspaces.sh
+@@ -1,10 +1,5 @@
+ #!/bin/sh
+ 
+-if [ "$(id -u)" = "0" ]; then
+-   echo "Running as root will mess up file permissions. Aborting ..." 1>&2
+-   exit 1
+-fi
+-
+ die()
+ {
+   echo ERROR: $*
diff --git a/0ad/patches/patch-libraries_source_fcollada_include_FCDocument_FCDocument.h b/0ad/patches/patch-libraries_source_fcollada_include_FCDocument_FCDocument.h
new file mode 100644
index 0000000..112a472
--- /dev/null
+++ b/0ad/patches/patch-libraries_source_fcollada_include_FCDocument_FCDocument.h
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- libraries/source/fcollada/include/FCDocument/FCDocument.h.orig	2012-06-04 21:33:15.000000000 +0000
++++ libraries/source/fcollada/include/FCDocument/FCDocument.h
+@@ -30,7 +30,7 @@
+ #if defined(WIN32)
+ template <class T> class FCOLLADA_EXPORT FCDLibrary; /**< Trick Doxygen. */
+ template <class T> class FCOLLADA_EXPORT FUUniqueStringMapT; /**< Trick Doxygen. */
+-#elif defined(LINUX) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
++#elif defined(LINUX) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ template <class T> class FCDLibrary; /**< Trick Doxygen. */
+ template <class T> class FUUniqueStringMapT; /**< Trick Doxygen. */
+ #endif // LINUX
diff --git a/0ad/patches/patch-libraries_source_fcollada_include_FUtils_FUCriticalSection.h b/0ad/patches/patch-libraries_source_fcollada_include_FUtils_FUCriticalSection.h
new file mode 100644
index 0000000..076b771
--- /dev/null
+++ b/0ad/patches/patch-libraries_source_fcollada_include_FUtils_FUCriticalSection.h
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- libraries/source/fcollada/include/FUtils/FUCriticalSection.h.orig	2012-06-04 21:33:15.000000000 +0000
++++ libraries/source/fcollada/include/FUtils/FUCriticalSection.h
+@@ -33,7 +33,7 @@ private:
+ #elif defined(__APPLE__)
+ 	//Do something here.
+ 	MPCriticalRegionID criticalSection;
+-#elif defined(LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
++#elif defined(LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ #else
+ #warning "FUCriticalSection: Critical section not implemented for other platforms."
+ #endif
diff --git a/0ad/patches/patch-libraries_source_fcollada_include_FUtils_Platforms.h b/0ad/patches/patch-libraries_source_fcollada_include_FUtils_Platforms.h
new file mode 100644
index 0000000..73dc9b8
--- /dev/null
+++ b/0ad/patches/patch-libraries_source_fcollada_include_FUtils_Platforms.h
@@ -0,0 +1,43 @@
+$NetBSD$
+
+--- libraries/source/fcollada/include/FUtils/Platforms.h.orig	2012-06-04 21:33:15.000000000 +0000
++++ libraries/source/fcollada/include/FUtils/Platforms.h
+@@ -74,7 +74,7 @@
+ #include <wchar.h>
+ #include <stdint.h>
+ 
+-#elif defined(LINUX) || defined(__PPU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
++#elif defined(LINUX) || defined(__PPU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ #include <ctype.h>
+ #include <wctype.h>
+ #include <unistd.h>
+@@ -82,9 +82,9 @@
+ #include <wchar.h>
+ #include <stdarg.h>
+ 
+-#if !defined(__FreeBSD__) && !defined(__OpenBSD__)
++#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
+ #include <malloc.h>
+-#endif // !__FreeBSD__ && !__OpenBSD__
++#endif // !__FreeBSD__ && !__NetBSD__ && !__OpenBSD__
+ 
+ #include <stdlib.h>
+ #include <stdio.h>
+@@ -125,7 +125,7 @@ typedef uint8_t byte;
+ #endif // PLATFORMS
+ 
+ // Important functions that some OSes have missing!
+-#if defined(__APPLE__) || defined(LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
++#if defined(__APPLE__) || defined(LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ inline char* strlower(char* str) { char* it = str; while (*it != 0) { *it = tolower(*it); ++it; } return str; }
+ inline wchar_t* wcslwr(wchar_t* str) { wchar_t* it = str; while (*it != 0) { *it = towlower(*it); ++it; } return str; }
+ inline int wcsicmp(const wchar_t* s1, const wchar_t* s2) { wchar_t c1 = *s1, c2 = *s2; while (c1 != 0 && c2 != 0) { if (c1 >= 'a' && c1 <= 'z') c1 -= 'a' + 'A'; if (c2 >= 'a' && c2 <= 'z') c2 -= 'a' + 'A'; if (c2 < c1) return -1; else if (c2 > c1) return 1; c1 = *(++s1); c2 = *(++s2); } return 0; }
+@@ -139,7 +139,7 @@ inline int wcsicmp(const wchar_t* s1, co
+ #elif defined(__PPU__)
+ #define glClearDepth glClearDepthf
+ 
+-#endif // __APPLE__ || LINUX || _FreeBSD__ || __FreeBSD_kernel__ || __OpenBSD__
++#endif // __APPLE__ || LINUX || _FreeBSD__ || __FreeBSD_kernel__ || __NetBSD__ || __OpenBSD__
+ 
+ // Cross-platform needed functions
+ #ifdef WIN32
diff --git a/0ad/patches/patch-libraries_source_fcollada_src_FCollada_FCDocument_FCDocument.h b/0ad/patches/patch-libraries_source_fcollada_src_FCollada_FCDocument_FCDocument.h
new file mode 100644
index 0000000..ff2278d
--- /dev/null
+++ b/0ad/patches/patch-libraries_source_fcollada_src_FCollada_FCDocument_FCDocument.h
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- libraries/source/fcollada/src/FCollada/FCDocument/FCDocument.h.orig	2012-06-04 21:33:15.000000000 +0000
++++ libraries/source/fcollada/src/FCollada/FCDocument/FCDocument.h
+@@ -30,7 +30,7 @@
+ #if defined(WIN32)
+ template <class T> class FCOLLADA_EXPORT FCDLibrary; /**< Trick Doxygen. */
+ template <class T> class FCOLLADA_EXPORT FUUniqueStringMapT; /**< Trick Doxygen. */
+-#elif defined(LINUX) || defined(__APPLE__) || defined (__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
++#elif defined(LINUX) || defined(__APPLE__) || defined (__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ template <class T> class FCDLibrary; /**< Trick Doxygen. */
+ template <class T> class FUUniqueStringMapT; /**< Trick Doxygen. */
+ #endif // LINUX
diff --git a/0ad/patches/patch-libraries_source_fcollada_src_FCollada_FUtils_FUCriticalSection.h b/0ad/patches/patch-libraries_source_fcollada_src_FCollada_FUtils_FUCriticalSection.h
new file mode 100644
index 0000000..88dfbaf
--- /dev/null
+++ b/0ad/patches/patch-libraries_source_fcollada_src_FCollada_FUtils_FUCriticalSection.h
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- libraries/source/fcollada/src/FCollada/FUtils/FUCriticalSection.h.orig	2012-06-04 21:33:15.000000000 +0000
++++ libraries/source/fcollada/src/FCollada/FUtils/FUCriticalSection.h
+@@ -33,7 +33,7 @@ private:
+ #elif defined(__APPLE__)
+ 	//Do something here.
+ 	MPCriticalRegionID criticalSection;
+-#elif defined(LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
++#elif defined(LINUX) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ #else
+ #warning "FUCriticalSection: Critical section not implemented for other platforms."
+ #endif
diff --git a/0ad/patches/patch-libraries_source_fcollada_src_FCollada_FUtils_FUStringBuilder.hpp b/0ad/patches/patch-libraries_source_fcollada_src_FCollada_FUtils_FUStringBuilder.hpp
new file mode 100644
index 0000000..1cb36c7
--- /dev/null
+++ b/0ad/patches/patch-libraries_source_fcollada_src_FCollada_FUtils_FUStringBuilder.hpp
@@ -0,0 +1,156 @@
+$NetBSD$
+
+--- libraries/source/fcollada/src/FCollada/FUtils/FUStringBuilder.hpp.orig	2008-09-07 22:13:25.000000000 +0000
++++ libraries/source/fcollada/src/FCollada/FUtils/FUStringBuilder.hpp
+@@ -26,62 +26,6 @@
+ #define SAFE_DELETE_ARRAY(ptr) if (ptr != NULL) { delete [] ptr; ptr = NULL; }
+ #endif
+ 
+-template <class Char, class FloatType>
+-void FloatToString(FloatType f, Char* sz)
+-{
+-	Char* buffer = sz + 1;
+-	static const int digitCount = 6;
+-	int decimal, sign;
+-
+-	// ecvt rounds the string for us: http://www.datafocus.com/docs/man3/ecvt.3.asp
+-	char* end = ecvt(f, digitCount, &decimal, &sign);
+-
+-	if (sign != 0) (*buffer++) = '-';
+-	int count = digitCount;
+-	if (decimal > digitCount)
+-	{
+-		// We use the scientific notation: P.MeX
+-		(*buffer++) = (*end++); // P is one character.
+-		(*buffer++) = '.';
+-
+-		// Mantissa (cleaned for zeroes)
+-		for (--count; count > 0; --count) if (end[count - 1] != '0') break;
+-		for (int i = 0; i < count; ++i) (*buffer++) = (*end++);
+-		if (buffer[-1] == '.') --buffer;
+-
+-		// Exponent
+-		(*buffer++) = 'e';
+-		uint32 exponent = decimal - 1; // X
+-		if (exponent >= 10) (*buffer++) = (Char) ('0' + (exponent / 10));
+-		(*buffer++) = (Char) ('0' + (exponent % 10));
+-		(*buffer) = 0;
+-		return;
+-	}
+-	else if (decimal > 0)
+-	{
+-		// Simple number: A.B
+-		for (int i = 0; i < decimal; ++i) (*buffer++) = (*end++);
+-		if (decimal < digitCount) (*buffer++) = '.';
+-		count = digitCount - decimal;
+-	}
+-	else if (decimal < -digitCount)
+-	{
+-		// What case is this?
+-		decimal = count = 0;
+-	}
+-	else if (decimal < 0 || (decimal == 0 && *end != '0'))
+-	{
+-		// Tiny number: 0.Me-X
+-		(*buffer++) = '0'; (*buffer++) = '.';
+-		for (int i = 0; i < -decimal; ++i) (*buffer++) = '0';
+-		count = digitCount + decimal;
+-	}
+-	for (; count > 0; --count) if (end[count - 1] != '0') break;
+-	for (int i = 0; i < count; ++i) (*buffer++) = (*end++);
+-	if (decimal == 0 && count == 0) (*buffer++) = '0';
+-	if (buffer[-1] == '.') --buffer;
+-	(*buffer) = 0;
+-}
+ 
+ template <class Char>
+ FUStringBuilderT<Char>::FUStringBuilderT(const String& sz)
+@@ -234,53 +178,46 @@ void FUStringBuilderT<Char>::append(cons
+ template <class Char>
+ void FUStringBuilderT<Char>::append(float f)
+ {
+-#ifdef WIN32
+-	// use <float.h> _isnan method to detect the 1.#IND00 NaN.
+-	if (f != std::numeric_limits<float>::infinity() && f != -std::numeric_limits<float>::infinity() && f != std::numeric_limits<float>::quiet_NaN() && f != std::numeric_limits<float>::signaling_NaN() && !_isnan((double)f))
+-#else
+-	if (f != std::numeric_limits<float>::infinity() && f != -std::numeric_limits<float>::infinity() && f != std::numeric_limits<float>::quiet_NaN() && f != std::numeric_limits<float>::signaling_NaN())
+-#endif
+-	{
+-		if (IsEquivalent(f, 0.0f, std::numeric_limits<float>::epsilon())) append((Char)'0');
+-		else
+-		{
+-			Char sz[128];
+-			FloatToString(f, sz);
+-			append(sz + 1);
+-		}
+-	}
+-	else if (f == std::numeric_limits<float>::infinity())
+-	{ append((Char)'I'); append((Char)'N'); append((Char)'F'); }
+-	else if (f == -std::numeric_limits<float>::infinity())
+-	{ append((Char)'-'); append((Char)'I'); append((Char)'N'); append((Char)'F'); }
+-	else
+-	{ append((Char)'N'); append((Char)'a'); append((Char)'N'); }
++	append((double)f);
+ }
+ 
+ template <class Char>
+ void FUStringBuilderT<Char>::append(double f)
+ {
+-#ifdef WIN32
+-	// use <float.h> _isnan method to detect the .#IND00 NaN.
+-	if (f != std::numeric_limits<float>::infinity() && f != -std::numeric_limits<float>::infinity() && f != std::numeric_limits<float>::quiet_NaN() && f != std::numeric_limits<float>::signaling_NaN() && !_isnan(f))
+-#else
+-	if (f != std::numeric_limits<float>::infinity() && f != -std::numeric_limits<float>::infinity() && f != std::numeric_limits<float>::quiet_NaN() && f != std::numeric_limits<float>::signaling_NaN())
+-#endif
+-	{
+-		if (IsEquivalent(f, 0.0, std::numeric_limits<double>::epsilon())) append((Char)'0');
+-		else
+-		{
+-			Char sz[128];
+-			FloatToString(f, sz);
+-			append(sz + 1);
+-		}
+-	}
+-	else if (f == std::numeric_limits<double>::infinity())
+-	{ append((Char)'I'); append((Char)'N'); append((Char)'F'); }
+-	else if (f == -std::numeric_limits<double>::infinity())
+-	{ append((Char)'-'); append((Char)'I'); append((Char)'N'); append((Char)'F'); }
+-	else
+-	{ append((Char)'N'); append((Char)'a'); append((Char)'N'); }
++       if (f == -std::numeric_limits<double>::infinity()) {
++               append("-INF");
++               return;
++       } else if (f == std::numeric_limits<double>::infinity()) {
++               append("INF");
++               return;
++       } else if (f != f) {
++               append("NaN");
++               return;
++       } else if (-std::numeric_limits<double>::epsilon() < f && f < std::numeric_limits<double>::epsilon()) {
++               append("0.0E0");
++               return;
++	}
++       if (f < 0.0) {
++               f = -f;
++               append('-');
++       }
++
++       int e = 0;
++       if (f < 1.0)
++               for (; f < 1.0; f *= 10.0)
++                       e--;
++     else
++               for (; f >= 10.0; f /= 10.0)
++                       e++;
++
++       char tmp[10];
++       sprintf(tmp, "%.6g", f);
++       append(tmp);
++       if (tmp[1] == 0) // only one digit, add missing part according canonical representation
++               append(".0");
++
++       sprintf(tmp, "E%d", e);
++       append(tmp);
+ }
+ 
+ template <class Char>
diff --git a/0ad/patches/patch-libraries_source_fcollada_src_FCollada_FUtils_Platforms.h b/0ad/patches/patch-libraries_source_fcollada_src_FCollada_FUtils_Platforms.h
new file mode 100644
index 0000000..6c574ba
--- /dev/null
+++ b/0ad/patches/patch-libraries_source_fcollada_src_FCollada_FUtils_Platforms.h
@@ -0,0 +1,34 @@
+$NetBSD$
+
+--- libraries/source/fcollada/src/FCollada/FUtils/Platforms.h.orig	2012-06-04 21:33:15.000000000 +0000
++++ libraries/source/fcollada/src/FCollada/FUtils/Platforms.h
+@@ -74,7 +74,7 @@
+ #include <wchar.h>
+ #include <stdint.h>
+ 
+-#elif defined(LINUX) || defined(__PPU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
++#elif defined(LINUX) || defined(__PPU__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ #include <ctype.h>
+ #include <wctype.h>
+ #include <unistd.h>
+@@ -82,9 +82,9 @@
+ #include <wchar.h>
+ #include <stdarg.h>
+ 
+-#if !defined(__FreeBSD__) && !defined(__OpenBSD__)
++#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
+ #include <malloc.h>
+-#endif // !__FreeBSD__ && !__OpenBSD__
++#endif // !__FreeBSD__ && !__NetBSD__ && !__OpenBSD__
+ 
+ #include <stdlib.h>
+ #include <stdio.h>
+@@ -125,7 +125,7 @@ typedef uint8_t byte;
+ #endif // PLATFORMS
+ 
+ // Important functions that some OSes have missing!
+-#if defined(__APPLE__) || defined (LINUX) || defined (__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__)
++#if defined(__APPLE__) || defined (LINUX) || defined (__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ inline char* strlower(char* str) { char* it = str; while (*it != 0) { *it = tolower(*it); ++it; } return str; }
+ inline wchar_t* wcslwr(wchar_t* str) { wchar_t* it = str; while (*it != 0) { *it = towlower(*it); ++it; } return str; }
+ inline int wcsicmp(const wchar_t* s1, const wchar_t* s2) { wchar_t c1 = *s1, c2 = *s2; while (c1 != 0 && c2 != 0) { if (c1 >= 'a' && c1 <= 'z') c1 -= 'a' + 'A'; if (c2 >= 'a' && c2 <= 'z') c2 -= 'a' + 'A'; if (c2 < c1) return -1; else if (c2 > c1) return 1; c1 = *(++s1); c2 = *(++s2); } return 0; }
diff --git a/0ad/patches/patch-libraries_source_nvtt_src_src_nvcore_Debug.cpp b/0ad/patches/patch-libraries_source_nvtt_src_src_nvcore_Debug.cpp
new file mode 100644
index 0000000..9f3d6cb
--- /dev/null
+++ b/0ad/patches/patch-libraries_source_nvtt_src_src_nvcore_Debug.cpp
@@ -0,0 +1,42 @@
+$NetBSD$
+
+--- libraries/source/nvtt/src/src/nvcore/Debug.cpp.orig	2015-07-21 15:53:21.000000000 +0000
++++ libraries/source/nvtt/src/src/nvcore/Debug.cpp
+@@ -27,7 +27,7 @@
+ #	include <signal.h>
+ #endif
+ 
+-#if NV_OS_LINUX || NV_OS_DARWIN || NV_OS_FREEBSD || NV_OS_OPENBSD
++#if NV_OS_LINUX || NV_OS_DARWIN || NV_OS_FREEBSD || NV_OS_NETBSD || NV_OS_OPENBSD
+ #	include <unistd.h>	// getpid
+ #endif
+ 
+@@ -38,7 +38,7 @@
+ #	endif
+ #endif
+ 
+-#if NV_OS_DARWIN || NV_OS_FREEBSD || NV_OS_OPENBSD
++#if NV_OS_DARWIN || NV_OS_FREEBSD || NV_OS_NETBSD || NV_OS_OPENBSD
+ #	include <sys/types.h>
+ #	include <sys/param.h>
+ #	include <sys/sysctl.h>	// sysctl
+@@ -213,6 +213,14 @@ namespace 
+ 			ucontext_t * ucp = (ucontext_t *)secret;
+ 			return (void *)ucp->uc_mcontext.mc_eip;
+ #		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];
++#		endif
+ #	elif NV_OS_OPENBSD
+ #		if NV_CPU_X86_64
+ 			ucontext_t * ucp = (ucontext_t *)secret;
+@@ -559,4 +567,3 @@ void debug::disableSigHandler()
+ 	
+ #endif
+ }
+-
diff --git a/0ad/patches/patch-libraries_source_nvtt_src_src_nvcore_nvcore.h b/0ad/patches/patch-libraries_source_nvtt_src_src_nvcore_nvcore.h
new file mode 100644
index 0000000..c732649
--- /dev/null
+++ b/0ad/patches/patch-libraries_source_nvtt_src_src_nvcore_nvcore.h
@@ -0,0 +1,23 @@
+$NetBSD$
+
+--- libraries/source/nvtt/src/src/nvcore/nvcore.h.orig	2015-07-21 15:53:21.000000000 +0000
++++ libraries/source/nvtt/src/src/nvcore/nvcore.h
+@@ -41,6 +41,9 @@
+ #elif defined POSH_OS_FREEBSD
+ #	define NV_OS_FREEBSD 1
+ #	define NV_OS_UNIX 1
++#elif defined POSH_OS_NETBSD
++#	define NV_OS_NETBSD 1
++#	define NV_OS_UNIX 1
+ #elif defined POSH_OS_OPENBSD
+ #	define NV_OS_OPENBSD 1
+ #	define NV_OS_UNIX 1
+@@ -187,7 +190,7 @@ typedef uint32      uint;
+ #elif NV_CC_GNUC
+ #	if NV_OS_LINUX
+ #		include "DefsGnucLinux.h"
+-#	elif NV_OS_DARWIN || NV_OS_FREEBSD || NV_OS_OPENBSD
++#	elif NV_OS_DARWIN || NV_OS_FREEBSD || NV_OS_NETBSD || NV_OS_OPENBSD
+ #		include "DefsGnucDarwin.h"
+ #	elif NV_OS_MINGW
+ #		include "DefsGnucWin32.h"
diff --git a/0ad/patches/patch-libraries_source_nvtt_src_src_nvcore_poshlib_posh.h b/0ad/patches/patch-libraries_source_nvtt_src_src_nvcore_poshlib_posh.h
new file mode 100644
index 0000000..b5e3eb5
--- /dev/null
+++ b/0ad/patches/patch-libraries_source_nvtt_src_src_nvcore_poshlib_posh.h
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- libraries/source/nvtt/src/src/nvcore/poshlib/posh.h.orig	2015-07-21 15:53:21.000000000 +0000
++++ libraries/source/nvtt/src/src/nvcore/poshlib/posh.h
+@@ -298,6 +298,11 @@ Metrowerks:
+ #  define POSH_OS_STRING "FreeBSD"
+ #endif
+ 
++#if defined __NetBSD__
++#  define POSH_OS_NETBSD 1 
++#  define POSH_OS_STRING "NetBSD"
++#endif
++
+ #if defined __OpenBSD__
+ #  define POSH_OS_OPENBSD 1
+ #  define POSH_OS_STRING "OpenBSD"
+@@ -1018,5 +1023,3 @@ extern posh_i64_t  POSH_ReadI64FromBig( 
+ #ifdef __cplusplus
+ }
+ #endif
+-
+-
diff --git a/0ad/patches/patch-libraries_source_nvtt_src_src_nvmath_nvmath.h b/0ad/patches/patch-libraries_source_nvtt_src_src_nvmath_nvmath.h
new file mode 100644
index 0000000..517a0e4
--- /dev/null
+++ b/0ad/patches/patch-libraries_source_nvtt_src_src_nvmath_nvmath.h
@@ -0,0 +1,22 @@
+$NetBSD$
+
+--- libraries/source/nvtt/src/src/nvmath/nvmath.h.orig	2012-06-10 22:39:26.000000000 +0000
++++ libraries/source/nvtt/src/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 || NV_OS_FREEBSD || NV_OS_OPENBSD
++#elif NV_OS_DARWIN || NV_OS_FREEBSD || NV_OS_NETBSD || NV_OS_OPENBSD
+ 	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 || NV_OS_FREEBSD || NV_OS_OPENBSD
++#elif NV_OS_DARWIN || NV_OS_FREEBSD || NV_OS_NETBSD || NV_OS_OPENBSD
+ 	return isnan(f);
+ #elif NV_OS_LINUX
+ 	return isnanf(f);
diff --git a/0ad/patches/patch-source_third__party_mikktspace_weldmesh.cpp b/0ad/patches/patch-source_third__party_mikktspace_weldmesh.cpp
new file mode 100644
index 0000000..67bd653
--- /dev/null
+++ b/0ad/patches/patch-source_third__party_mikktspace_weldmesh.cpp
@@ -0,0 +1,18 @@
+$NetBSD$
+
+--- source/third_party/mikktspace/weldmesh.cpp.orig	2013-12-06 00:42:50.000000000 +0000
++++ source/third_party/mikktspace/weldmesh.cpp
+@@ -30,7 +30,7 @@
+ #include <string.h>
+ #include <assert.h>
+ 
+-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
++#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+ #include <stdlib.h>  /* BSD-based OSes get their malloc stuff through here */
+ #else
+ #include <malloc.h> 
+@@ -199,4 +199,3 @@ static void MergeVertsFast(int * piCurNr
+ 						   pfVertexDataIn, iNrVerticesIn, iFloatsPerVert, iL, iR_in, iChannelNum);	// weld all right of (or equal to) fSep
+ 	}
+ }
+-


Home | Main Index | Thread Index | Old Index