pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/graphics/kphotools Added workaround for missing std::v...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/76baef73c746
branches:  trunk
changeset: 490639:76baef73c746
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Wed Mar 16 20:03:57 2005 +0000

description:
Added workaround for missing std::vector.at() in libc++-2. Approved by wiz.

diffstat:

 graphics/kphotools/Makefile             |   5 +++-
 graphics/kphotools/distinfo             |   5 ++-
 graphics/kphotools/files/pkgsrc_fixes.h |  18 +++++++++++++++++
 graphics/kphotools/patches/patch-aa     |  34 ++++++++++++++++++++++++++++++--
 graphics/kphotools/patches/patch-ai     |  23 ++++++++++++++++++++++
 5 files changed, 79 insertions(+), 6 deletions(-)

diffs (130 lines):

diff -r a571fdf9152b -r 76baef73c746 graphics/kphotools/Makefile
--- a/graphics/kphotools/Makefile       Wed Mar 16 20:00:52 2005 +0000
+++ b/graphics/kphotools/Makefile       Wed Mar 16 20:03:57 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2004/10/15 12:22:13 tv Exp $
+# $NetBSD: Makefile,v 1.5 2005/03/16 20:03:57 rillig Exp $
 #
 
 DISTNAME=      kphotools-0.2.1
@@ -23,6 +23,9 @@
 SUBST_SED.kphotools=   -e 's|@kphotoolsdir@|${KDEDIR}/share/kde/apps/kphotools|'
 SUBST_STAGE.kphotools= post-patch
 
+post-configure:
+       ${_PKG_DEBUG}${_PKG_SILENT}${LN} -s ${FILESDIR}/pkgsrc_fixes.h ${BUILDLINK_DIR}/include/
+
 .include "../../meta-pkgs/kde3/kde3.mk"
 .include "../../graphics/imlib2/buildlink3.mk"
 .include "../../x11/kdelibs3/buildlink3.mk"
diff -r a571fdf9152b -r 76baef73c746 graphics/kphotools/distinfo
--- a/graphics/kphotools/distinfo       Wed Mar 16 20:00:52 2005 +0000
+++ b/graphics/kphotools/distinfo       Wed Mar 16 20:03:57 2005 +0000
@@ -1,9 +1,9 @@
-$NetBSD: distinfo,v 1.3 2005/02/24 08:45:08 agc Exp $
+$NetBSD: distinfo,v 1.4 2005/03/16 20:03:57 rillig Exp $
 
 SHA1 (kphotools-0.2.1.tar.bz2) = 51769be5e6d3533e409b4c24bfcc94fc46c9e169
 RMD160 (kphotools-0.2.1.tar.bz2) = 80d342fd45d0f1f19fc6a951f2127ee0542d4d3e
 Size (kphotools-0.2.1.tar.bz2) = 703387 bytes
-SHA1 (patch-aa) = 3818e56a0fffb7f9439a8e6b2049c46c66b2f96d
+SHA1 (patch-aa) = 4b254fb9f0a9a1765f33dafdf76316962c4d562c
 SHA1 (patch-ab) = ef9ff406ff7fded74b82edcc67e7f684dfe8a227
 SHA1 (patch-ac) = 36c45d2e8321e94f3842cd59cceb5c64c26ac661
 SHA1 (patch-ad) = 005991fbd92a6a55f856cbcbb8440acc51a6c7fe
@@ -11,3 +11,4 @@
 SHA1 (patch-af) = c45640848e877ad8ad455a1e9cfa225eb8d253a8
 SHA1 (patch-ag) = 02767da467413439844e6167ef1a470ffdebfca1
 SHA1 (patch-ah) = e145a89db623351c204f73acc38cb8062f66bdde
+SHA1 (patch-ai) = cb2343c51bf96928c7eb973e57ef50ef068f5f23
diff -r a571fdf9152b -r 76baef73c746 graphics/kphotools/files/pkgsrc_fixes.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/kphotools/files/pkgsrc_fixes.h   Wed Mar 16 20:03:57 2005 +0000
@@ -0,0 +1,18 @@
+#ifndef KPHOTOOLS_PKGSRC_FIXES_H
+#define KPHOTOOLS_PKGSRC_FIXES_H
+
+#if !(defined(__GNUC__) && (__GNUC__ < 3))
+#  define HAVE_STD_VECTOR_AT
+#endif
+
+#ifdef __cplusplus
+template <class T> typename T::reference at_replacement(T &c, const typename T::size_type &i) {
+# ifdef HAVE_STD_VECTOR_AT
+       return c.at(i);
+# else
+       return c[i];
+# endif
+}
+#endif
+
+#endif
diff -r a571fdf9152b -r 76baef73c746 graphics/kphotools/patches/patch-aa
--- a/graphics/kphotools/patches/patch-aa       Wed Mar 16 20:00:52 2005 +0000
+++ b/graphics/kphotools/patches/patch-aa       Wed Mar 16 20:03:57 2005 +0000
@@ -1,7 +1,35 @@
-$NetBSD: patch-aa,v 1.1 2004/07/31 22:30:12 markd Exp $
+$NetBSD: patch-aa,v 1.2 2005/03/16 20:03:57 rillig Exp $
+
+c++-2.95.3 does not know vector::at().
 
---- src/GalleryThrd.cpp.orig   2004-06-13 03:14:01.000000000 +1200
-+++ src/GalleryThrd.cpp
+--- src/GalleryThrd.cpp.orig   Sat Jun 12 17:14:01 2004
++++ src/GalleryThrd.cpp        Wed Mar 16 20:11:05 2005
+@@ -19,7 +19,7 @@
+  ***************************************************************************/
+ #include <qdir.h> 
+ #include "GalleryThrd.h"
+-
++#include <pkgsrc_fixes.h>
+  
+ void GalleryThrd::run()
+ {
+@@ -105,14 +105,14 @@ void GalleryThrd::begin()
+       for(uint i = 0; i<files;i++)
+       {
+               //try loading image
+-              image = imlib_load_image_without_cache(m_pvecFileList->at(i)->fileName);
++              image = imlib_load_image_without_cache(at_replacement(*m_pvecFileList, i)->fileName);
+               //if files was loaded:
+               if (image)
+               {   
+                       //set the context to this image
+                       imlib_context_set_image(image);
+                       //rotate it as needed
+-                      imlib_image_orientate(m_pvecFileList->at(i)->rotation);
++                      imlib_image_orientate(at_replacement(*m_pvecFileList, i)->rotation);
+                       //load sizes of the current image
+                       orig_height = imlib_image_get_height();
+                       orig_width = imlib_image_get_width();
 @@ -305,7 +305,7 @@ void GalleryThrd::doCreateWebsite(uint f
                if(strFiles[i][0] == 'f')//if is file copy it
                {
diff -r a571fdf9152b -r 76baef73c746 graphics/kphotools/patches/patch-ai
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/kphotools/patches/patch-ai       Wed Mar 16 20:03:57 2005 +0000
@@ -0,0 +1,23 @@
+$NetBSD: patch-ai,v 1.1 2005/03/16 20:03:57 rillig Exp $
+
+c++-2.95.3 does not know vector::at().
+
+--- src/AlbumWid.ui.h.orig     Thu Jun  3 20:53:22 2004
++++ src/AlbumWid.ui.h  Wed Mar 16 20:22:58 2005
+@@ -26,6 +26,7 @@
+  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+  ***************************************************************************/
+ 
++#include <pkgsrc_fixes.h>
+ 
+ void AlbumWid::init()
+ {
+@@ -88,7 +89,7 @@ void AlbumWid::onRemoveAll()
+       //run through the vector and delete each item
+       for(uint i = 0;i<m_vecFileList.size();i++)
+       {
+-              delete m_vecFileList.at(i);
++              delete at_replacement(m_vecFileList, i);
+       }
+       //clear vector
+       m_vecFileList.clear();



Home | Main Index | Thread Index | Old Index