diff options
author | Samuli Suominen <ssuominen@gentoo.org> | 2012-05-03 19:52:53 +0000 |
---|---|---|
committer | Samuli Suominen <ssuominen@gentoo.org> | 2012-05-03 19:52:53 +0000 |
commit | 3faf229ee1d54fc81126f147e7ff6b789f29dfdd (patch) | |
tree | b22b1c95735cc0a8a0fb97a74b9064b227dc8cd7 /media-gfx | |
parent | Drop *-macos and *-solaris keywords from 7.0.4, it's not tested/prepared, 7.4... (diff) | |
download | historical-3faf229ee1d54fc81126f147e7ff6b789f29dfdd.tar.gz historical-3faf229ee1d54fc81126f147e7ff6b789f29dfdd.tar.bz2 historical-3faf229ee1d54fc81126f147e7ff6b789f29dfdd.zip |
Create patchset tarball because of the valgrind patch filesize.
Package-Manager: portage-2.2.0_alpha101/cvs/Linux x86_64
Diffstat (limited to 'media-gfx')
9 files changed, 25 insertions, 1283 deletions
diff --git a/media-gfx/nvidia-texture-tools/ChangeLog b/media-gfx/nvidia-texture-tools/ChangeLog index a1059817e590..0c6c56a1faaf 100644 --- a/media-gfx/nvidia-texture-tools/ChangeLog +++ b/media-gfx/nvidia-texture-tools/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for media-gfx/nvidia-texture-tools # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-gfx/nvidia-texture-tools/ChangeLog,v 1.1 2012/05/03 19:45:31 ssuominen Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-gfx/nvidia-texture-tools/ChangeLog,v 1.2 2012/05/03 19:52:52 ssuominen Exp $ + + 03 May 2012; Samuli Suominen <ssuominen@gentoo.org> + nvidia-texture-tools-2.0.8.ebuild, + -files/nvidia-texture-tools-2.0.8-aliasing.patch, + -files/nvidia-texture-tools-2.0.8-cuda.patch, + -files/nvidia-texture-tools-2.0.8-libpng15.patch, + -files/nvidia-texture-tools-2.0.8-tiff4.patch, + -files/nvidia-texture-tools-2.0.8-valgrind.patch, + -files/nvidia-texture-tools-cmake.patch: + Create patchset tarball because of the valgrind patch filesize. *nvidia-texture-tools-2.0.8 (03 May 2012) diff --git a/media-gfx/nvidia-texture-tools/Manifest b/media-gfx/nvidia-texture-tools/Manifest index 7b2dc618aa0f..d8c31f515c5c 100644 --- a/media-gfx/nvidia-texture-tools/Manifest +++ b/media-gfx/nvidia-texture-tools/Manifest @@ -1,24 +1,19 @@ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 -AUX nvidia-texture-tools-2.0.8-aliasing.patch 1553 RMD160 18525e0eb8d3b8a0212e670243f01099e41ef97a SHA1 73272c8e6661c56dcaa9bf96d971cb7df77cec54 SHA256 12df5dab88246e239ff9c96bd87ccb86ea3769b6f817fee08d7613d1ae6b3a0c -AUX nvidia-texture-tools-2.0.8-cuda.patch 722 RMD160 e76a003405e7fcfbe60023a1de3da659879e62bf SHA1 83dff56cbbec9d69c19e9a53502a27c301251f3f SHA256 ef3ecafbf040c0193ac6ad5dc86974f667d74a6a96eae2526ae2abbc14398f5c -AUX nvidia-texture-tools-2.0.8-libpng15.patch 591 RMD160 89c68d37852bcd4d333a34efc2d5b7daa3b5a663 SHA1 9df903aff0253e99448efd446232f3109bc382ba SHA256 30aa82b877926e91e95139b89277ae3e73bc1c3c14e4abbc90378e42deacd8c3 -AUX nvidia-texture-tools-2.0.8-tiff4.patch 2897 RMD160 16485b0934b934139e33de995f39317de161384f SHA1 cff6768bf053606c0b4032b02b7f7f5538a2a41e SHA256 86ca76aacd4219d10326e54fce887943aea8cb55662bfbd4ffe7a9695f223448 -AUX nvidia-texture-tools-2.0.8-valgrind.patch 26286 RMD160 d2b438833024c1448d0aef7221668e8853f2ad68 SHA1 e46eff41188629c831d53ce0b045e0b939b0e34d SHA256 2ee618e7d9ddfe11bc3f304e7045832bc0e1e3a79b70924996830cdd46676539 -AUX nvidia-texture-tools-cmake.patch 5412 RMD160 f5ed6ea64b55cded3fda6261d3eb75454b9ce82c SHA1 a3dcf923e982bf5d86e023a9226c0246fdeb25fa SHA256 bab9c3228ce6fd04351c338fcb8c16d899b476ad3840f9fa4686ebaf72a74de9 DIST nvidia-texture-tools-2.0.8-1.tar.gz 935227 RMD160 dbb2a1ea4bef259af8520d881ab414d69ee0dea2 SHA1 3eaa578acc35159684748055aeb4bacdeaef12d1 SHA256 6b3c83500b420ee976f61eeae16e5727e2401e133f543baeac76c66c381eed2e -EBUILD nvidia-texture-tools-2.0.8.ebuild 1734 RMD160 ad97987de7586dc9207c67e6248ab7182753c91c SHA1 77a3cb2f4290133665fc1b819f5ea4bb549140c8 SHA256 e038154a93f3749a258a23668e613f47ac40ba5dea1257be048304a4be868a5d -MISC ChangeLog 725 RMD160 02cd04d1fb6c8d590286d3e84fce81d1d1d37397 SHA1 1f75abbd39ac2a92b0300d78f313bcd8e65b09a2 SHA256 6945016091664298f94915696309e4ae396196c07e6b2918838e28bc129ef4ad +DIST nvidia-texture-tools-2.0.8-patchset-1.tar.xz 9688 RMD160 e20153a6e9692e828e0677fbe255361ff81dd75c SHA1 a3d4d1724685336a3eafa3863a4955547cc55343 SHA256 7cc8ba61cf0290984b31bdbe7b291ff75f2eeab8b07da908dfb5a1b421341516 +EBUILD nvidia-texture-tools-2.0.8.ebuild 1612 RMD160 a4359d7aeaf9fd634ee0eba6183a4d1fceba248a SHA1 550fd4f695be6f43a3dce376053b9669f44a5d09 SHA256 573b9eb850475cb58ff678d422ed669da2629a8a0ccf4feb1b435033bf656f87 +MISC ChangeLog 1179 RMD160 fc8731b91d4b606896ede0513ba8bed717bfeb12 SHA1 6acad1698bc88a2e24affa3347388c241f9b8acf SHA256 75b2ed91a74581ae82a249a5328d21191859d660b0c064d7f7a49b8499cc0fa2 MISC metadata.xml 597 RMD160 7b156a0efb17ef004ba146b74fa265528aca3715 SHA1 2e533ed568bb55ffced759d0808c47691632c3d2 SHA256 86c23f0bb1ed47aeebbc91e8d5bfacfccdc68d6406fc29daa952dd2ece2f4da5 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) -iQEcBAEBAgAGBQJPot/OAAoJEEdUh39IaPFN0cUH/3uERZvThPkS/PwPgTa9HdCN -PXVuRCpQcFhBJVGwLc4vJJNovl/5WUn26oaVIV4T5ZPSZlWHJbqhJdQQiorQiAKW -qICRHbf/63NZwgKeUkAtl4X6ckQL6EBcLBVlF/YSCTBoJMGV/OVSU9nDgCRAItWu -h6+B3GyyZAk0eklutEp3WgF3kxi4Xg8UJdRgnYRXd/+FFALqp0G/C0LfqHTeDewq -cCXXPjO2rmqalpXcQ6B0c6JfuvHB+k0NXo0MNETqsJKwwk6buJPBQY9cMON6ugyq -DLYIc59ZpQadogOaMgOySb1dwFV7Kc35cHXxEUdH+z9DiIz4fGblBgxm5wAbS/Y= -=3KLg +iQEcBAEBAgAGBQJPouGIAAoJEEdUh39IaPFNdy4H/3iIlLUDIxAOCt2iJGf3mNIc +wNEGaY5vKl6rSyUkEoih8q2VYUJijS3WSOvQpzLjkx7N5E3O8oVrevdxMoftlg6F +codIORPW6LsHtBI83tH9bY1qlSNQ9O1rp48pUXiVMDjbFUj7wRKqLKALXe1GM7Gx +kYGHMXRUQkFfga9Zybg1BOnH4bqA0d4Ae6FAws/LPnXVAg3+G+L8vZN0o+QTv96a +hEBP+Mfd0/rwd+y+/JqJIbjun/F8Mdtj21xIJKKSDVjwsvG60nuDuXltRmhXm9DB +JdeuEOjG0uarxb4pzxnLO3B6EmMUfEEPhMOKfDpuvwQSWTkJiqwkG9hwrJKEM+o= +=czr2 -----END PGP SIGNATURE----- diff --git a/media-gfx/nvidia-texture-tools/files/nvidia-texture-tools-2.0.8-aliasing.patch b/media-gfx/nvidia-texture-tools/files/nvidia-texture-tools-2.0.8-aliasing.patch deleted file mode 100644 index a362e7494636..000000000000 --- a/media-gfx/nvidia-texture-tools/files/nvidia-texture-tools-2.0.8-aliasing.patch +++ /dev/null @@ -1,59 +0,0 @@ -Subject: Aliasing violation causes erroneous output in GCC 4.4.4 -Origin, upstream, http://code.google.com/p/nvidia-texture-tools/source/detail?r=1167 -Bug: http://code.google.com/p/nvidia-texture-tools/issues/detail?id=139 - -Index: src/src/nvmath/Vector.h -=================================================================== ---- src/src/nvmath/Vector.h (revision 8311) -+++ src/src/nvmath/Vector.h (working copy) -@@ -68,7 +68,7 @@ - scalar y() const; - scalar z() const; - -- const Vector2 & xy() const; -+ Vector2 xy() const; - - scalar component(uint idx) const; - -@@ -111,8 +111,8 @@ - scalar z() const; - scalar w() const; - -- const Vector2 & xy() const; -- const Vector3 & xyz() const; -+ Vector2 xy() const; -+ Vector3 xyz() const; - - scalar component(uint idx) const; - -@@ -231,9 +231,9 @@ - inline scalar Vector3::y() const { return m_y; } - inline scalar Vector3::z() const { return m_z; } - --inline const Vector2 & Vector3::xy() const -+inline Vector2 Vector3::xy() const - { -- return *(Vector2 *)this; -+ return Vector2(m_x, m_y); - } - - inline scalar Vector3::component(uint idx) const -@@ -332,14 +332,14 @@ - inline scalar Vector4::z() const { return m_z; } - inline scalar Vector4::w() const { return m_w; } - --inline const Vector2 & Vector4::xy() const -+inline Vector2 Vector4::xy() const - { -- return *(Vector2 *)this; -+ return Vector2(m_x, m_y); - } - --inline const Vector3 & Vector4::xyz() const -+inline Vector3 Vector4::xyz() const - { -- return *(Vector3 *)this; -+ return Vector3(m_x, m_y, m_z); - } - - inline scalar Vector4::component(uint idx) const diff --git a/media-gfx/nvidia-texture-tools/files/nvidia-texture-tools-2.0.8-cuda.patch b/media-gfx/nvidia-texture-tools/files/nvidia-texture-tools-2.0.8-cuda.patch deleted file mode 100644 index abf6041a613b..000000000000 --- a/media-gfx/nvidia-texture-tools/files/nvidia-texture-tools-2.0.8-cuda.patch +++ /dev/null @@ -1,16 +0,0 @@ -Subject: Current CUDA runtime generates cpp code by default. Fix extension. -Origin: upstream, http://code.google.com/p/nvidia-texture-tools/source/detail?r=1157 - -Index: branches/2.0/cmake/FindCUDA.cmake -=================================================================== ---- branches/2.0/cmake/FindCUDA.cmake (revision 1156) -+++ branches/2.0/cmake/FindCUDA.cmake (revision 1157) -@@ -120,7 +120,7 @@ - FOREACH (CUFILE ${ARGN}) - GET_FILENAME_COMPONENT (CUFILE ${CUFILE} ABSOLUTE) - GET_FILENAME_COMPONENT (CFILE ${CUFILE} NAME_WE) -- SET (CFILE ${CMAKE_CURRENT_BINARY_DIR}/${CFILE}.gen.c) -+ SET (CFILE ${CMAKE_CURRENT_BINARY_DIR}/${CFILE}.gen.cpp) - - GET_CUFILE_DEPENDENCIES(CUDEPS ${CUFILE}) - #MESSAGE("${CUDEPS}") diff --git a/media-gfx/nvidia-texture-tools/files/nvidia-texture-tools-2.0.8-libpng15.patch b/media-gfx/nvidia-texture-tools/files/nvidia-texture-tools-2.0.8-libpng15.patch deleted file mode 100644 index ce36224319a1..000000000000 --- a/media-gfx/nvidia-texture-tools/files/nvidia-texture-tools-2.0.8-libpng15.patch +++ /dev/null @@ -1,17 +0,0 @@ -Subject: Fixed build with libpng1.5 -Last-Update: 2012-03-31 -Origin: upstream, http://code.google.com/p/nvidia-texture-tools/source/detail?r=1248 - -diff --git a/src/nvimage/ImageIO.cpp b/src/nvimage/ImageIO.cpp -index 0b24600..22e920a 100644 ---- a/src/nvimage/ImageIO.cpp -+++ b/src/nvimage/ImageIO.cpp -@@ -603,7 +603,7 @@ static void user_read_data(png_structp png_ptr, png_bytep data, png_size_t lengt - { - 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/media-gfx/nvidia-texture-tools/files/nvidia-texture-tools-2.0.8-tiff4.patch b/media-gfx/nvidia-texture-tools/files/nvidia-texture-tools-2.0.8-tiff4.patch deleted file mode 100644 index e78769eebc1a..000000000000 --- a/media-gfx/nvidia-texture-tools/files/nvidia-texture-tools-2.0.8-tiff4.patch +++ /dev/null @@ -1,116 +0,0 @@ -Origin: upstream, http://code.google.com/p/nvidia-texture-tools/source/detail?r=1156 - -Index: branches/2.0/src/nvcore/nvcore.h -=================================================================== ---- branches/2.0/src/nvcore/nvcore.h (revision 1155) -+++ branches/2.0/src/nvcore/nvcore.h (revision 1156) -@@ -99,6 +99,23 @@ - #define NV_ENDIAN_STRING POSH_ENDIAN_STRING - - -+// Type definitions: -+typedef posh_u8_t uint8; -+typedef posh_i8_t int8; -+ -+typedef posh_u16_t uint16; -+typedef posh_i16_t int16; -+ -+typedef posh_u32_t uint32; -+typedef posh_i32_t int32; -+ -+typedef posh_u64_t uint64; -+typedef posh_i64_t int64; -+ -+// Aliases -+typedef uint32 uint; -+ -+ - // Version string: - #define NV_VERSION_STRING \ - NV_OS_STRING "/" NV_CC_STRING "/" NV_CPU_STRING"/" \ -Index: branches/2.0/src/nvcore/DefsVcWin32.h -=================================================================== ---- branches/2.0/src/nvcore/DefsVcWin32.h (revision 1155) -+++ branches/2.0/src/nvcore/DefsVcWin32.h (revision 1156) -@@ -39,7 +39,7 @@ - #define __FUNC__ __FUNCTION__ - #endif - -- -+/* - // Type definitions - typedef unsigned char uint8; - typedef signed char int8; -@@ -55,8 +55,8 @@ - - // Aliases - typedef uint32 uint; -+*/ - -- - // Unwanted VC++ warnings to disable. - /* - #pragma warning(disable : 4244) // conversion to float, possible loss of data -Index: branches/2.0/src/nvcore/DefsGnucDarwin.h -=================================================================== ---- branches/2.0/src/nvcore/DefsGnucDarwin.h (revision 1155) -+++ branches/2.0/src/nvcore/DefsGnucDarwin.h (revision 1156) -@@ -2,7 +2,7 @@ - #error "Do not include this file directly." - #endif - --#include <stdint.h> // uint8_t, int8_t, ... -+//#include <stdint.h> // uint8_t, int8_t, ... - - // Function linkage - #define DLL_IMPORT -@@ -48,7 +48,7 @@ - - #define restrict __restrict__ - -- -+/* - // Type definitions - typedef uint8_t uint8; - typedef int8_t int8; -@@ -64,3 +64,4 @@ - - // Aliases - typedef uint32 uint; -+*/ -Index: branches/2.0/src/nvcore/DefsGnucLinux.h -=================================================================== ---- branches/2.0/src/nvcore/DefsGnucLinux.h (revision 1155) -+++ branches/2.0/src/nvcore/DefsGnucLinux.h (revision 1156) -@@ -47,7 +47,7 @@ - - #define restrict __restrict__ - -- -+/* - // Type definitions - typedef unsigned char uint8; - typedef signed char int8; -@@ -63,3 +63,4 @@ - - // Aliases - typedef uint32 uint; -+*/ -Index: branches/2.0/src/nvcore/DefsGnucWin32.h -=================================================================== ---- branches/2.0/src/nvcore/DefsGnucWin32.h (revision 1155) -+++ branches/2.0/src/nvcore/DefsGnucWin32.h (revision 1156) -@@ -41,7 +41,7 @@ - - #define restrict __restrict__ - -- -+/* - // Type definitions - typedef unsigned char uint8; - typedef signed char int8; -@@ -57,3 +57,4 @@ - - // Aliases - typedef uint32 uint; -+*/ diff --git a/media-gfx/nvidia-texture-tools/files/nvidia-texture-tools-2.0.8-valgrind.patch b/media-gfx/nvidia-texture-tools/files/nvidia-texture-tools-2.0.8-valgrind.patch deleted file mode 100644 index 808e59dd90c9..000000000000 --- a/media-gfx/nvidia-texture-tools/files/nvidia-texture-tools-2.0.8-valgrind.patch +++ /dev/null @@ -1,857 +0,0 @@ -Subject: Remove malloc overrides -Last-Update: 2012-03-31 -Origin, upstream, http://code.google.com/p/nvidia-texture-tools/source/detail?r=1172 -Bug: http://code.google.com/p/nvidia-texture-tools/issues/detail?id=138 - -diff --git a/src/nvcore/Containers.h b/src/nvcore/Containers.h -index f0b63d4..3d1d8ee 100644 ---- a/src/nvcore/Containers.h -+++ b/src/nvcore/Containers.h -@@ -16,9 +16,9 @@ Do not use memmove in insert & remove, use copy ctors instead. - - - // nvcore --#include <nvcore/nvcore.h> --#include <nvcore/Memory.h> --#include <nvcore/Debug.h> -+#include "nvcore.h" -+#include "Memory.h" -+#include "Debug.h" - - #include <string.h> // memmove - #include <new> // for placement new -@@ -589,15 +589,15 @@ namespace nv - // free the buffer. - if( m_buffer_size == 0 ) { - if( m_buffer ) { -- mem::free( m_buffer ); -+ free( m_buffer ); - m_buffer = NULL; - } - } - - // realloc the buffer - else { -- if( m_buffer ) m_buffer = (T *) mem::realloc( m_buffer, sizeof(T) * m_buffer_size ); -- else m_buffer = (T *) mem::malloc( sizeof(T) * m_buffer_size ); -+ if( m_buffer ) m_buffer = (T *) realloc(m_buffer, sizeof(T) * m_buffer_size); -+ else m_buffer = (T *) ::malloc(sizeof(T) * m_buffer_size); - } - } - -@@ -778,7 +778,7 @@ namespace nv - e->clear(); - } - } -- mem::free(table); -+ free(table); - table = NULL; - entry_count = 0; - size_mask = -1; -@@ -1001,7 +1001,7 @@ namespace nv - new_size = nextPowerOfTwo(new_size); - - HashMap<T, U, hash_functor> new_hash; -- new_hash.table = (Entry *) mem::malloc(sizeof(Entry) * new_size); -+ new_hash.table = (Entry *) ::malloc(sizeof(Entry) * new_size); - nvDebugCheck(new_hash.table != NULL); - - new_hash.entry_count = 0; -@@ -1026,7 +1026,7 @@ namespace nv - } - - // Delete our old data buffer. -- mem::free(table); -+ free(table); - } - - // Steal new_hash's data. -diff --git a/src/nvcore/Memory.cpp b/src/nvcore/Memory.cpp -index 7ece018..d470580 100644 ---- a/src/nvcore/Memory.cpp -+++ b/src/nvcore/Memory.cpp -@@ -1,36 +1,118 @@ -+// This code is in the public domain -- Ignacio Castaño <castano@gmail.com> - - #include "Memory.h" - #include "Debug.h" - --//#if HAVE_MALLOC_H --//#include <malloc.h> --//#endif -- - #include <stdlib.h> - -+#define USE_EFENCE 0 -+ -+#if USE_EFENCE -+extern "C" void *EF_malloc(size_t size); -+extern "C" void *EF_realloc(void * oldBuffer, size_t newSize); -+extern "C" void EF_free(void * address); -+#endif - - using namespace nv; - --void * nv::mem::malloc(size_t size) -+#if NV_OVERRIDE_ALLOC -+ -+void * malloc(size_t size) -+{ -+#if USE_EFENCE -+ return EF_malloc(size); -+#else -+ return ::malloc(size); -+#endif -+} -+ -+void * debug_malloc(size_t size, const char * file, int line) -+{ -+ NV_UNUSED(file); -+ NV_UNUSED(line); -+#if USE_EFENCE -+ return EF_malloc(size); -+#else -+ return ::malloc(size); -+#endif -+} -+ -+void free(void * ptr) - { -- return ::malloc(size); -+#if USE_EFENCE -+ return EF_free(const_cast<void *>(ptr)); -+#else -+ ::free(const_cast<void *>(ptr)); -+#endif - } - --void * nv::mem::malloc(size_t size, const char * file, int line) -+void * realloc(void * ptr, size_t size) - { -- NV_UNUSED(file); -- NV_UNUSED(line); -- return ::malloc(size); -+ nvDebugCheck(ptr != NULL || size != 0); // undefined realloc behavior. -+#if USE_EFENCE -+ return EF_realloc(ptr, size); -+#else -+ return ::realloc(ptr, size); -+#endif - } - --void nv::mem::free(const void * ptr) -+/* No need to override this unless we want line info. -+void * operator new (size_t size) throw() - { -- ::free(const_cast<void *>(ptr)); -+ return malloc(size); - } - --void * nv::mem::realloc(void * ptr, size_t size) -+void operator delete (void *p) throw() - { -- nvDebugCheck(ptr != NULL || size != 0); // undefined realloc behavior. -- return ::realloc(ptr, size); -+ free(p); - } - -+void * operator new [] (size_t size) throw() -+{ -+ return malloc(size); -+} -+ -+void operator delete [] (void * p) throw() -+{ -+ free(p); -+} -+*/ -+ -+#if 0 // Code from Apple: -+void* operator new(std::size_t sz) throw (std::bad_alloc) -+{ -+ void *result = std::malloc (sz == 0 ? 1 : sz); -+ if (result == NULL) -+ throw std::bad_alloc(); -+ gNewCounter++; -+ return result; -+} -+void operator delete(void* p) throw() -+{ -+ if (p == NULL) -+ return; -+ std::free (p); -+ gDeleteCounter++; -+} -+ -+/* These are the 'nothrow' versions of the above operators. -+ The system version will try to call a std::new_handler if they -+ fail, but your overriding versions are not required to do this. */ -+void* operator new(std::size_t sz, const std::nothrow_t&) throw() -+{ -+ try { -+ void * result = ::operator new (sz); // calls our overridden operator new -+ return result; -+ } catch (std::bad_alloc &) { -+ return NULL; -+ } -+} -+void operator delete(void* p, const std::nothrow_t&) throw() -+{ -+ ::operator delete (p); -+} -+ -+#endif // 0 -+ -+ -+#endif // NV_OVERRIDE_ALLOC -diff --git a/src/nvcore/Memory.h b/src/nvcore/Memory.h -index d699926..897388b 100644 ---- a/src/nvcore/Memory.h -+++ b/src/nvcore/Memory.h -@@ -1,186 +1,52 @@ --// This code is in the public domain -- castanyo@yahoo.es -+// This code is in the public domain -- Ignacio Castaño <castano@gmail.com> - -+#pragma once - #ifndef NV_CORE_MEMORY_H - #define NV_CORE_MEMORY_H - --#include <nvcore/nvcore.h> -+#include "nvcore.h" - - #include <stdlib.h> // malloc(), realloc() and free() --#include <stddef.h> // size_t -+#include <stddef.h> // size_t - - #include <new> // new and delete - --// Custom memory allocator --namespace nv --{ -- namespace mem -- { -- NVCORE_API void * malloc(size_t size); -- NVCORE_API void * malloc(size_t size, const char * file, int line); -- -- NVCORE_API void free(const void * ptr); -- NVCORE_API void * realloc(void * ptr, size_t size); -- -- } // mem namespace -- --} // nv namespace -- -- --// Override new/delete -+#define NV_OVERRIDE_ALLOC 0 - --inline void * operator new (size_t size) throw() --{ -- return nv::mem::malloc(size); --} -- --inline void operator delete (void *p) throw() --{ -- nv::mem::free(p); --} -+#if NV_OVERRIDE_ALLOC - --inline void * operator new [] (size_t size) throw() --{ -- return nv::mem::malloc(size); --} -- --inline void operator delete [] (void * p) throw() --{ -- nv::mem::free(p); -+// Custom memory allocator -+extern "C" { -+ NVCORE_API void * malloc(size_t size); -+ NVCORE_API void * debug_malloc(size_t size, const char * file, int line); -+ NVCORE_API void free(void * ptr); -+ NVCORE_API void * realloc(void * ptr, size_t size); - } - - /* - #ifdef _DEBUG - #define new new(__FILE__, __LINE__) --#define malloc(i) malloc(i, __FILE__, __LINE__) -+#define malloc(i) debug_malloc(i, __FILE__, __LINE__) - #endif - */ - --#if 0 --/* -- File: main.cpp -- -- Version: 1.0 -- -- Abstract: Overrides the C++ 'operator new' and 'operator delete'. -- -- Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. -- ("Apple") in consideration of your agreement to the following terms, and your -- use, installation, modification or redistribution of this Apple software -- constitutes acceptance of these terms. If you do not agree with these terms, -- please do not use, install, modify or redistribute this Apple software. -- -- In consideration of your agreement to abide by the following terms, and subject -- to these terms, Apple grants you a personal, non-exclusive license, under Apple’s -- copyrights in this original Apple software (the "Apple Software"), to use, -- reproduce, modify and redistribute the Apple Software, with or without -- modifications, in source and/or binary forms; provided that if you redistribute -- the Apple Software in its entirety and without modifications, you must retain -- this notice and the following text and disclaimers in all such redistributions of -- the Apple Software. Neither the name, trademarks, service marks or logos of -- Apple Computer, Inc. may be used to endorse or promote products derived from the -- Apple Software without specific prior written permission from Apple. Except as -- expressly stated in this notice, no other rights or licenses, express or implied, -- are granted by Apple herein, including but not limited to any patent rights that -- may be infringed by your derivative works or by other works in which the Apple -- Software may be incorporated. -- -- The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO -- WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED -- WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR -- PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN -- COMBINATION WITH YOUR PRODUCTS. -- -- IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -- GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -- ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION -- OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT -- (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN -- ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- Copyright © 2006 Apple Computer, Inc., All Rights Reserved --*/ -- --/* This sample shows how to override the C++ global 'new' and 'delete' operators. */ --#include <new> --#include <iostream> --#include <cstdlib> --#include <stdexcept> --#include <locale> -- --/* Some variables and code to make the example do something. */ --namespace { -- unsigned long long gNewCounter; // number of times 'new' was called -- unsigned long long gDeleteCounter; // number of times 'delete' was called -- -- void printCounters() // print the counters above -- { -- std::cout << "new was called " << gNewCounter << " times and delete was called " << gDeleteCounter << " times\n"; -- } --} -- --/* These are the overridden new and delete routines. -- Most applications will want to override at least these four versions of new/delete if they override any of them. -- -- In Mac OS, it's not necessary to override the array versions of operator new and delete if all -- they would do is call the non-array versions; the C++ standard library, as an extension -- to the C++ standard, does this for you. -+#endif - -- Developers should consult the section [lib.support.dynamic] in the C++ standard to see the requirements -- on the generic operators new and delete; the system may expect that your overridden operators meet all these -- requirements. -+namespace nv { - -- Your operators may be called by the system, even early in start-up before constructors have been executed. */ --void* operator new(std::size_t sz) throw (std::bad_alloc) --{ -- void *result = std::malloc (sz == 0 ? 1 : sz); -- if (result == NULL) -- throw std::bad_alloc(); -- gNewCounter++; -- return result; --} --void operator delete(void* p) throw() --{ -- if (p == NULL) -- return; -- std::free (p); -- gDeleteCounter++; --} -+ // C++ helpers. -+ template <typename T> T * malloc(size_t count) { -+ return (T *)::malloc(sizeof(T) * count); -+ } - --/* These are the 'nothrow' versions of the above operators. -- The system version will try to call a std::new_handler if they -- fail, but your overriding versions are not required to do this. */ --void* operator new(std::size_t sz, const std::nothrow_t&) throw() --{ -- try { -- void * result = ::operator new (sz); // calls our overridden operator new -- return result; -- } catch (std::bad_alloc &) { -- return NULL; -- } --} --void operator delete(void* p, const std::nothrow_t&) throw() --{ -- ::operator delete (p); --} -+ template <typename T> T * realloc(T * ptr, size_t count) { -+ return (T *)::realloc(ptr, sizeof(T) * count); -+ } - --/* Bug 4067110 is that if your program has no weak symbols at all, the linker will not set the -- WEAK_DEFINES bit in the Mach-O header and as a result the new and delete operators above won't -- be seen by system libraries. This is mostly a problem for test programs and small examples, -- since almost all real C++ programs complicated enough to override new and delete will have at -- least one weak symbol. However, this is a small example, so: */ --void __attribute__((weak, visibility("default"))) workaroundFor4067110 () { } -+ template <typename T> void free(const T * ptr) { -+ ::free((void *)ptr); -+ } - --/* This is a simple test program that causes the runtime library to call new and delete. */ --int main() --{ -- atexit (printCounters); -- try { -- std::locale example("does_not_exist"); -- } catch (std::runtime_error &x) { -- } -- return 0; --} --#endif // 0 -+} // nv namespace - - #endif // NV_CORE_MEMORY_H -diff --git a/src/nvcore/StrLib.cpp b/src/nvcore/StrLib.cpp -index 34cf992..34518d9 100644 ---- a/src/nvcore/StrLib.cpp -+++ b/src/nvcore/StrLib.cpp -@@ -21,17 +21,17 @@ namespace - { - static char * strAlloc(uint size) - { -- return static_cast<char *>(mem::malloc(size)); -+ return static_cast<char *>(::malloc(size)); - } - - static char * strReAlloc(char * str, uint size) - { -- return static_cast<char *>(mem::realloc(str, size)); -+ return static_cast<char *>(::realloc(str, size)); - } - - static void strFree(const char * str) - { -- return mem::free(const_cast<char *>(str)); -+ return ::free(const_cast<char *>(str)); - } - - /*static char * strDup( const char * str ) -diff --git a/src/nvcore/StrLib.h b/src/nvcore/StrLib.h -index 8012271..4164cf5 100644 ---- a/src/nvcore/StrLib.h -+++ b/src/nvcore/StrLib.h -@@ -294,7 +294,7 @@ namespace nv - const uint16 count = getRefCount(); - setRefCount(count - 1); - if (count - 1 == 0) { -- mem::free(data - 2); -+ free(data - 2); - data = NULL; - } - } -@@ -323,7 +323,7 @@ namespace nv - - void allocString(const char * str, int len) - { -- const char * ptr = static_cast<const char *>(mem::malloc(2 + len + 1)); -+ const char * ptr = static_cast<const char *>(::malloc(2 + len + 1)); - - setData( ptr ); - setRefCount( 0 ); -diff --git a/src/nvimage/FloatImage.cpp b/src/nvimage/FloatImage.cpp -index 90818ca..6e82ade 100644 ---- a/src/nvimage/FloatImage.cpp -+++ b/src/nvimage/FloatImage.cpp -@@ -148,13 +148,13 @@ void FloatImage::allocate(uint c, uint w, uint h) - m_height = h; - m_componentNum = c; - m_count = w * h * c; -- m_mem = reinterpret_cast<float *>(nv::mem::malloc(m_count * sizeof(float))); -+ m_mem = reinterpret_cast<float *>(::malloc(m_count * sizeof(float))); - } - - /// Free the image, but don't clear the members. - void FloatImage::free() - { -- nv::mem::free( reinterpret_cast<void *>(m_mem) ); -+ ::free( reinterpret_cast<void *>(m_mem) ); - m_mem = NULL; - } - -diff --git a/src/nvimage/Image.cpp b/src/nvimage/Image.cpp -index 2307d5c..53c0b5f 100644 ---- a/src/nvimage/Image.cpp -+++ b/src/nvimage/Image.cpp -@@ -78,7 +78,7 @@ void Image::unwrap() - - void Image::free() - { -- nv::mem::free(m_data); -+ ::free(m_data); - m_data = NULL; - } - -diff --git a/src/nvimage/ImageIO.cpp b/src/nvimage/ImageIO.cpp -index 0b24600..70949ff 100644 ---- a/src/nvimage/ImageIO.cpp -+++ b/src/nvimage/ImageIO.cpp -@@ -954,7 +954,7 @@ FloatImage * nv::ImageIO::loadFloatTIFF(const char * fileName, Stream & s) - fimage->allocate(spp, width, height); - - int linesize = TIFFScanlineSize(tif); -- tdata_t buf = (::uint8 *)nv::mem::malloc(linesize); -+ tdata_t buf = (::uint8 *)::malloc(linesize); - - for (uint y = 0; y < height; y++) - { -@@ -991,7 +991,7 @@ FloatImage * nv::ImageIO::loadFloatTIFF(const char * fileName, Stream & s) - } - } - -- nv::mem::free(buf); -+ ::free(buf); - - TIFFClose(tif); - -diff --git a/src/nvtt/CompressRGB.cpp b/src/nvtt/CompressRGB.cpp -index 35239c4..7a6564d 100644 ---- a/src/nvtt/CompressRGB.cpp -+++ b/src/nvtt/CompressRGB.cpp -@@ -1,140 +1,140 @@ --// Copyright NVIDIA Corporation 2007 -- Ignacio Castano <icastano@nvidia.com>
--//
--// Permission is hereby granted, free of charge, to any person
--// obtaining a copy of this software and associated documentation
--// files (the "Software"), to deal in the Software without
--// restriction, including without limitation the rights to use,
--// copy, modify, merge, publish, distribute, sublicense, and/or sell
--// copies of the Software, and to permit persons to whom the
--// Software is furnished to do so, subject to the following
--// conditions:
--//
--// The above copyright notice and this permission notice shall be
--// included in all copies or substantial portions of the Software.
--//
--// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
--// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
--// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
--// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
--// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
--// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
--// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
--// OTHER DEALINGS IN THE SOFTWARE.
--
--#include <nvcore/Debug.h>
--
--#include <nvimage/Image.h>
--#include <nvimage/PixelFormat.h>
--#include <nvmath/Color.h>
--
--#include "CompressRGB.h"
--#include "CompressionOptions.h"
--#include "OutputOptions.h"
--
--using namespace nv;
--using namespace nvtt;
--
--namespace
--{
--
-- inline uint computePitch(uint w, uint bitsize)
-- {
-- uint p = w * ((bitsize + 7) / 8);
--
-- // Align to 32 bits.
-- return ((p + 3) / 4) * 4;
-- }
--
-- inline void convert_to_a8r8g8b8(const void * src, void * dst, uint w)
-- {
-- memcpy(dst, src, 4 * w);
-- }
--
-- inline void convert_to_x8r8g8b8(const void * src, void * dst, uint w)
-- {
-- memcpy(dst, src, 4 * w);
-- }
--
--} // namespace
--
--
--// Pixel format converter.
--void nv::compressRGB(const Image * image, const OutputOptions::Private & outputOptions, const CompressionOptions::Private & compressionOptions)
--{
-- nvCheck(image != NULL);
--
-- const uint w = image->width();
-- const uint h = image->height();
--
-- const uint bitCount = compressionOptions.bitcount;
-- nvCheck(bitCount == 8 || bitCount == 16 || bitCount == 24 || bitCount == 32);
--
-- const uint byteCount = bitCount / 8;
--
-- const uint rmask = compressionOptions.rmask;
-- uint rshift, rsize;
-- PixelFormat::maskShiftAndSize(rmask, &rshift, &rsize);
--
-- const uint gmask = compressionOptions.gmask;
-- uint gshift, gsize;
-- PixelFormat::maskShiftAndSize(gmask, &gshift, &gsize);
--
-- const uint bmask = compressionOptions.bmask;
-- uint bshift, bsize;
-- PixelFormat::maskShiftAndSize(bmask, &bshift, &bsize);
--
-- const uint amask = compressionOptions.amask;
-- uint ashift, asize;
-- PixelFormat::maskShiftAndSize(amask, &ashift, &asize);
--
-- // Determine pitch.
-- uint pitch = computePitch(w, compressionOptions.bitcount);
--
-- uint8 * dst = (uint8 *)mem::malloc(pitch + 4);
--
-- for (uint y = 0; y < h; y++)
-- {
-- const Color32 * src = image->scanline(y);
--
-- if (bitCount == 32 && rmask == 0xFF0000 && gmask == 0xFF00 && bmask == 0xFF && amask == 0xFF000000)
-- {
-- convert_to_a8r8g8b8(src, dst, w);
-- }
-- else if (bitCount == 32 && rmask == 0xFF0000 && gmask == 0xFF00 && bmask == 0xFF && amask == 0)
-- {
-- convert_to_x8r8g8b8(src, dst, w);
-- }
-- else
-- {
-- // Generic pixel format conversion.
-- for (uint x = 0; x < w; x++)
-- {
-- uint c = 0;
-- c |= PixelFormat::convert(src[x].r, 8, rsize) << rshift;
-- c |= PixelFormat::convert(src[x].g, 8, gsize) << gshift;
-- c |= PixelFormat::convert(src[x].b, 8, bsize) << bshift;
-- c |= PixelFormat::convert(src[x].a, 8, asize) << ashift;
--
-- // Output one byte at a time.
-- for (uint i = 0; i < byteCount; i++)
-- {
-- *(dst + x * byteCount + i) = (c >> (i * 8)) & 0xFF;
-- }
-- }
--
-- // Zero padding.
-- for (uint x = w * byteCount; x < pitch; x++)
-- {
-- *(dst + x) = 0;
-- }
-- }
--
-- if (outputOptions.outputHandler != NULL)
-- {
-- outputOptions.outputHandler->writeData(dst, pitch);
-- }
-- }
--
-- mem::free(dst);
--}
--
-+// Copyright NVIDIA Corporation 2007 -- Ignacio Castano <icastano@nvidia.com> -+// -+// Permission is hereby granted, free of charge, to any person -+// obtaining a copy of this software and associated documentation -+// files (the "Software"), to deal in the Software without -+// restriction, including without limitation the rights to use, -+// copy, modify, merge, publish, distribute, sublicense, and/or sell -+// copies of the Software, and to permit persons to whom the -+// Software is furnished to do so, subject to the following -+// conditions: -+// -+// The above copyright notice and this permission notice shall be -+// included in all copies or substantial portions of the Software. -+// -+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+// OTHER DEALINGS IN THE SOFTWARE. -+ -+#include <nvcore/Debug.h> -+ -+#include <nvimage/Image.h> -+#include <nvimage/PixelFormat.h> -+#include <nvmath/Color.h> -+ -+#include "CompressRGB.h" -+#include "CompressionOptions.h" -+#include "OutputOptions.h" -+ -+using namespace nv; -+using namespace nvtt; -+ -+namespace -+{ -+ -+ inline uint computePitch(uint w, uint bitsize) -+ { -+ uint p = w * ((bitsize + 7) / 8); -+ -+ // Align to 32 bits. -+ return ((p + 3) / 4) * 4; -+ } -+ -+ inline void convert_to_a8r8g8b8(const void * src, void * dst, uint w) -+ { -+ memcpy(dst, src, 4 * w); -+ } -+ -+ inline void convert_to_x8r8g8b8(const void * src, void * dst, uint w) -+ { -+ memcpy(dst, src, 4 * w); -+ } -+ -+} // namespace -+ -+ -+// Pixel format converter. -+void nv::compressRGB(const Image * image, const OutputOptions::Private & outputOptions, const CompressionOptions::Private & compressionOptions) -+{ -+ nvCheck(image != NULL); -+ -+ const uint w = image->width(); -+ const uint h = image->height(); -+ -+ const uint bitCount = compressionOptions.bitcount; -+ nvCheck(bitCount == 8 || bitCount == 16 || bitCount == 24 || bitCount == 32); -+ -+ const uint byteCount = bitCount / 8; -+ -+ const uint rmask = compressionOptions.rmask; -+ uint rshift, rsize; -+ PixelFormat::maskShiftAndSize(rmask, &rshift, &rsize); -+ -+ const uint gmask = compressionOptions.gmask; -+ uint gshift, gsize; -+ PixelFormat::maskShiftAndSize(gmask, &gshift, &gsize); -+ -+ const uint bmask = compressionOptions.bmask; -+ uint bshift, bsize; -+ PixelFormat::maskShiftAndSize(bmask, &bshift, &bsize); -+ -+ const uint amask = compressionOptions.amask; -+ uint ashift, asize; -+ PixelFormat::maskShiftAndSize(amask, &ashift, &asize); -+ -+ // Determine pitch. -+ uint pitch = computePitch(w, compressionOptions.bitcount); -+ -+ uint8 * dst = (uint8 *)::malloc(pitch + 4); -+ -+ for (uint y = 0; y < h; y++) -+ { -+ const Color32 * src = image->scanline(y); -+ -+ if (bitCount == 32 && rmask == 0xFF0000 && gmask == 0xFF00 && bmask == 0xFF && amask == 0xFF000000) -+ { -+ convert_to_a8r8g8b8(src, dst, w); -+ } -+ else if (bitCount == 32 && rmask == 0xFF0000 && gmask == 0xFF00 && bmask == 0xFF && amask == 0) -+ { -+ convert_to_x8r8g8b8(src, dst, w); -+ } -+ else -+ { -+ // Generic pixel format conversion. -+ for (uint x = 0; x < w; x++) -+ { -+ uint c = 0; -+ c |= PixelFormat::convert(src[x].r, 8, rsize) << rshift; -+ c |= PixelFormat::convert(src[x].g, 8, gsize) << gshift; -+ c |= PixelFormat::convert(src[x].b, 8, bsize) << bshift; -+ c |= PixelFormat::convert(src[x].a, 8, asize) << ashift; -+ -+ // Output one byte at a time. -+ for (uint i = 0; i < byteCount; i++) -+ { -+ *(dst + x * byteCount + i) = (c >> (i * 8)) & 0xFF; -+ } -+ } -+ -+ // Zero padding. -+ for (uint x = w * byteCount; x < pitch; x++) -+ { -+ *(dst + x) = 0; -+ } -+ } -+ -+ if (outputOptions.outputHandler != NULL) -+ { -+ outputOptions.outputHandler->writeData(dst, pitch); -+ } -+ } -+ -+ ::free(dst); -+} -+ -diff --git a/src/nvtt/cuda/CudaCompressDXT.cpp b/src/nvtt/cuda/CudaCompressDXT.cpp -index c59bedd..6b45ceb 100644 ---- a/src/nvtt/cuda/CudaCompressDXT.cpp -+++ b/src/nvtt/cuda/CudaCompressDXT.cpp -@@ -137,7 +137,7 @@ void CudaCompressor::compressDXT1(const CompressionOptions::Private & compressio - const uint h = (m_image->height() + 3) / 4; - - uint imageSize = w * h * 16 * sizeof(Color32); -- uint * blockLinearImage = (uint *) malloc(imageSize); -+ uint * blockLinearImage = (uint *) ::malloc(imageSize); - convertToBlockLinear(m_image, blockLinearImage); // @@ Do this in parallel with the GPU, or in the GPU! - - const uint blockNum = w * h; -@@ -207,14 +207,14 @@ void CudaCompressor::compressDXT3(const CompressionOptions::Private & compressio - const uint h = (m_image->height() + 3) / 4; - - uint imageSize = w * h * 16 * sizeof(Color32); -- uint * blockLinearImage = (uint *) malloc(imageSize); -+ uint * blockLinearImage = (uint *) ::malloc(imageSize); - convertToBlockLinear(m_image, blockLinearImage); - - const uint blockNum = w * h; - const uint compressedSize = blockNum * 8; - - AlphaBlockDXT3 * alphaBlocks = NULL; -- alphaBlocks = (AlphaBlockDXT3 *)malloc(min(compressedSize, MAX_BLOCKS * 8U)); -+ alphaBlocks = (AlphaBlockDXT3 *)::malloc(min(compressedSize, MAX_BLOCKS * 8U)); - - setupCompressKernel(compressionOptions.colorWeight.ptr()); - -@@ -298,14 +298,14 @@ void CudaCompressor::compressDXT5(const CompressionOptions::Private & compressio - const uint h = (m_image->height() + 3) / 4; - - uint imageSize = w * h * 16 * sizeof(Color32); -- uint * blockLinearImage = (uint *) malloc(imageSize); -+ uint * blockLinearImage = (uint *) ::malloc(imageSize); - convertToBlockLinear(m_image, blockLinearImage); - - const uint blockNum = w * h; - const uint compressedSize = blockNum * 8; - - AlphaBlockDXT5 * alphaBlocks = NULL; -- alphaBlocks = (AlphaBlockDXT5 *)malloc(min(compressedSize, MAX_BLOCKS * 8U)); -+ alphaBlocks = (AlphaBlockDXT5 *)::malloc(min(compressedSize, MAX_BLOCKS * 8U)); - - setupCompressKernel(compressionOptions.colorWeight.ptr()); - diff --git a/media-gfx/nvidia-texture-tools/files/nvidia-texture-tools-cmake.patch b/media-gfx/nvidia-texture-tools/files/nvidia-texture-tools-cmake.patch deleted file mode 100644 index cee6fb5aa067..000000000000 --- a/media-gfx/nvidia-texture-tools/files/nvidia-texture-tools-cmake.patch +++ /dev/null @@ -1,192 +0,0 @@ -From: hasufell <julian.ospald@googlemail.com> -Date: Sun Apr 22 19:08:52 UTC 2012 -Subject: various cmake fixes - -fix hardcoded install paths for BINDIR and LIBDIR -make cg, cuda, glew, glut and openexr controllable and not automagic -add install-rules for headers (used by media-libs/devil) - ---- src/CMakeLists.txt -+++ src/CMakeLists.txt -@@ -6,6 +6,13 @@ - - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) - -+# initial variables -+SET(GLUT TRUE CACHE BOOL "") -+SET(GLEW TRUE CACHE BOOL "") -+SET(CG TRUE CACHE BOOL "") -+SET(CUDA TRUE CACHE BOOL "") -+SET(OPENEXR TRUE CACHE BOOL "") -+ - # OpenGL - INCLUDE(FindOpenGL) - IF(OPENGL_FOUND) -@@ -15,13 +22,15 @@ - ENDIF(OPENGL_FOUND) - - # GLUT --INCLUDE(${NV_CMAKE_DIR}/FindGLUT.cmake) --#INCLUDE(FindGLUT) --IF(GLUT_FOUND) -- MESSAGE(STATUS "Looking for GLUT - found") --ELSE(GLUT_FOUND) -- MESSAGE(STATUS "Looking for GLUT - not found") --ENDIF(GLUT_FOUND) -+IF(GLUT) -+ INCLUDE(${NV_CMAKE_DIR}/FindGLUT.cmake) -+ #INCLUDE(FindGLUT) -+ IF(GLUT_FOUND) -+ MESSAGE(STATUS "Looking for GLUT - found") -+ ELSE(GLUT_FOUND) -+ MESSAGE(STATUS "Looking for GLUT - not found") -+ ENDIF(GLUT_FOUND) -+ENDIF(GLUT) - - # DirectX - INCLUDE(${NV_CMAKE_DIR}/FindDirectX.cmake) -@@ -32,29 +41,35 @@ - ENDIF(DX10_FOUND) - - # GLEW --INCLUDE(${NV_CMAKE_DIR}/FindGLEW.cmake) --IF(GLEW_FOUND) -- MESSAGE(STATUS "Looking for GLEW - found") --ELSE(GLEW_FOUND) -- MESSAGE(STATUS "Looking for GLEW - not found") --ENDIF(GLEW_FOUND) -+IF(GLEW) -+ INCLUDE(${NV_CMAKE_DIR}/FindGLEW.cmake) -+ IF(GLEW_FOUND) -+ MESSAGE(STATUS "Looking for GLEW - found") -+ ELSE(GLEW_FOUND) -+ MESSAGE(STATUS "Looking for GLEW - not found") -+ ENDIF(GLEW_FOUND) -+ENDIF(GLEW) - - # Cg --INCLUDE(${NV_CMAKE_DIR}/FindCg.cmake) --IF(CG_FOUND) -- MESSAGE(STATUS "Looking for Cg - found") --ELSE(CG_FOUND) -- MESSAGE(STATUS "Looking for Cg - not found") --ENDIF(CG_FOUND) -+IF(CG) -+ INCLUDE(${NV_CMAKE_DIR}/FindCg.cmake) -+ IF(CG_FOUND) -+ MESSAGE(STATUS "Looking for Cg - found") -+ ELSE(CG_FOUND) -+ MESSAGE(STATUS "Looking for Cg - not found") -+ ENDIF(CG_FOUND) -+ENDIF(CG) - - # CUDA --INCLUDE(${NV_CMAKE_DIR}/FindCUDA.cmake) --IF(CUDA_FOUND) -- SET(HAVE_CUDA ${CUDA_FOUND} CACHE BOOL "Set to TRUE if CUDA is found, FALSE otherwise") -- MESSAGE(STATUS "Looking for CUDA - found") --ELSE(CUDA_FOUND) -- MESSAGE(STATUS "Looking for CUDA - not found") --ENDIF(CUDA_FOUND) -+IF(CUDA) -+ INCLUDE(${NV_CMAKE_DIR}/FindCUDA.cmake) -+ IF(CUDA_FOUND) -+ SET(HAVE_CUDA ${CUDA_FOUND} CACHE BOOL "Set to TRUE if CUDA is found, FALSE otherwise") -+ MESSAGE(STATUS "Looking for CUDA - found") -+ ELSE(CUDA_FOUND) -+ MESSAGE(STATUS "Looking for CUDA - not found") -+ ENDIF(CUDA_FOUND) -+ENDIF(CUDA) - - # Maya - INCLUDE(${NV_CMAKE_DIR}/FindMaya.cmake) -@@ -93,13 +108,15 @@ - ENDIF(TIFF_FOUND) - - # OpenEXR --INCLUDE(${NV_CMAKE_DIR}/FindOpenEXR.cmake) --IF(OPENEXR_FOUND) -- SET(HAVE_OPENEXR ${OPENEXR_FOUND} CACHE BOOL "Set to TRUE if OpenEXR is found, FALSE otherwise") -- MESSAGE(STATUS "Looking for OpenEXR - found") --ELSE(OPENEXR_FOUND) -- MESSAGE(STATUS "Looking for OpenEXR - not found") --ENDIF(OPENEXR_FOUND) -+IF(OPENEXR) -+ INCLUDE(${NV_CMAKE_DIR}/FindOpenEXR.cmake) -+ IF(OPENEXR_FOUND) -+ SET(HAVE_OPENEXR ${OPENEXR_FOUND} CACHE BOOL "Set to TRUE if OpenEXR is found, FALSE otherwise") -+ MESSAGE(STATUS "Looking for OpenEXR - found") -+ ELSE(OPENEXR_FOUND) -+ MESSAGE(STATUS "Looking for OpenEXR - not found") -+ ENDIF(OPENEXR_FOUND) -+ENDIF(OPENEXR) - - # Qt - FIND_PACKAGE(Qt4) -@@ -121,3 +138,4 @@ - - #INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/nvconfig.h DESTINATION include) - -+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/nvconfig.h DESTINATION include) ---- src/nvtt/CMakeLists.txt -+++ src/nvtt/CMakeLists.txt -@@ -53,13 +53,11 @@ - TARGET_LINK_LIBRARIES(nvtt ${LIBS} nvcore nvmath nvimage squish) - - INSTALL(TARGETS nvtt -- RUNTIME DESTINATION bin -- LIBRARY DESTINATION lib -- ARCHIVE DESTINATION lib/static) -- --INSTALL(FILES nvtt.h DESTINATION include/nvtt) -- -+ RUNTIME DESTINATION ${BINDIR} -+ LIBRARY DESTINATION ${LIBDIR} -+ ARCHIVE DESTINATION ${LIBDIR}) - -+INSTALL(DIRECTORY . DESTINATION include/nvtt FILES_MATCHING PATTERN "*.h") - - # test executables - ADD_EXECUTABLE(nvcompress tools/compress.cpp tools/cmdline.h) ---- src/nvmath/CMakeLists.txt -+++ src/nvmath/CMakeLists.txt -@@ -28,6 +28,8 @@ - TARGET_LINK_LIBRARIES(nvmath ${LIBS} nvcore) - - INSTALL(TARGETS nvmath -- RUNTIME DESTINATION bin -- LIBRARY DESTINATION lib -- ARCHIVE DESTINATION lib/static) -+ RUNTIME DESTINATION ${BINDIR} -+ LIBRARY DESTINATION ${LIBDIR} -+ ARCHIVE DESTINATION ${LIBDIR}) -+ -+INSTALL(DIRECTORY . DESTINATION include/nvmath FILES_MATCHING PATTERN "*.h") ---- src/nvimage/CMakeLists.txt -+++ src/nvimage/CMakeLists.txt -@@ -62,7 +62,8 @@ - TARGET_LINK_LIBRARIES(nvimage ${LIBS} nvcore nvmath posh) - - INSTALL(TARGETS nvimage -- RUNTIME DESTINATION bin -- LIBRARY DESTINATION lib -- ARCHIVE DESTINATION lib/static) -+ RUNTIME DESTINATION ${BINDIR} -+ LIBRARY DESTINATION ${LIBDIR} -+ ARCHIVE DESTINATION ${LIBDIR}) - -+INSTALL(DIRECTORY . DESTINATION include/nvimage FILES_MATCHING PATTERN "*.h") ---- src/nvcore/CMakeLists.txt -+++ src/nvcore/CMakeLists.txt -@@ -42,6 +42,8 @@ - TARGET_LINK_LIBRARIES(nvcore ${LIBS}) - - INSTALL(TARGETS nvcore -- RUNTIME DESTINATION bin -- LIBRARY DESTINATION lib -- ARCHIVE DESTINATION lib/static) -+ RUNTIME DESTINATION ${BINDIR} -+ LIBRARY DESTINATION ${LIBDIR} -+ ARCHIVE DESTINATION ${LIBDIR}) -+ -+INSTALL(DIRECTORY . DESTINATION include/nvcore FILES_MATCHING PATTERN "*.h") diff --git a/media-gfx/nvidia-texture-tools/nvidia-texture-tools-2.0.8.ebuild b/media-gfx/nvidia-texture-tools/nvidia-texture-tools-2.0.8.ebuild index ee16ae763230..089ea73fede4 100644 --- a/media-gfx/nvidia-texture-tools/nvidia-texture-tools-2.0.8.ebuild +++ b/media-gfx/nvidia-texture-tools/nvidia-texture-tools-2.0.8.ebuild @@ -1,14 +1,14 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/media-gfx/nvidia-texture-tools/nvidia-texture-tools-2.0.8.ebuild,v 1.1 2012/05/03 19:45:31 ssuominen Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-gfx/nvidia-texture-tools/nvidia-texture-tools-2.0.8.ebuild,v 1.2 2012/05/03 19:52:52 ssuominen Exp $ EAPI=4 - inherit cmake-utils eutils multilib toolchain-funcs DESCRIPTION="A set of cuda-enabled texture tools and compressors" HOMEPAGE="http://developer.nvidia.com/object/texture_tools.html" -SRC_URI="http://${PN}.googlecode.com/files/${P}-1.tar.gz" +SRC_URI="http://${PN}.googlecode.com/files/${P}-1.tar.gz + http://dev.gentoo.org/~ssuominen/${P}-patchset-1.tar.xz" LICENSE="MIT" SLOT="0" @@ -42,13 +42,7 @@ pkg_setup() { } src_prepare() { - epatch \ - "${FILESDIR}"/${PN}-cmake.patch \ - "${FILESDIR}"/${P}-aliasing.patch \ - "${FILESDIR}"/${P}-libpng15.patch \ - "${FILESDIR}"/${P}-valgrind.patch \ - "${FILESDIR}"/${P}-cuda.patch \ - "${FILESDIR}"/${P}-tiff4.patch + EPATCH_SUFFIX=patch epatch "${WORKDIR}"/patches } src_configure() { |