From 9edb01352c85bd644eadcade6518be7133254bb0 Mon Sep 17 00:00:00 2001 From: miwi Date: Sun, 3 Dec 2006 23:21:53 +0000 Subject: - Unbreak fix build on 5.X PR: ports/106198 Submitted by: Peter Johnson --- editors/xenon/Makefile | 20 +++++++++++-------- editors/xenon/files/patch-Makefile.common | 20 +++++++++++++++++++ editors/xenon/files/patch-XeFontTable.h | 29 +++++++++++++++++++++++++++ editors/xenon/files/patch-XeText.C | 33 +++++++++++++++++++++++++++++++ 4 files changed, 94 insertions(+), 8 deletions(-) create mode 100644 editors/xenon/files/patch-Makefile.common create mode 100644 editors/xenon/files/patch-XeFontTable.h create mode 100644 editors/xenon/files/patch-XeText.C (limited to 'editors') diff --git a/editors/xenon/Makefile b/editors/xenon/Makefile index 55eb188..095a8a1 100644 --- a/editors/xenon/Makefile +++ b/editors/xenon/Makefile @@ -7,7 +7,7 @@ PORTNAME= xenon PORTVERSION= 1.0.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= editors MASTER_SITES= http://sydney.proximity.com.au/~ben/xenon/dist/ \ ftp://yankee.proximitygroup.com/pub/xenon/ @@ -16,25 +16,29 @@ MAINTAINER= ports@FreeBSD.org COMMENT= Simple X-based text editor USE_GMAKE= yes +USE_GCC= 3.4+ USE_X_PREFIX= yes USE_XPM= yes MAKEFILE= ${WRKSRC}/makefiles/Makefile.Linux MAN1= xe.1 -FIX_FILES= Xe.h XeApp.h XeFontTable.C XeFontTable.h XeKeyTable.C \ - XeKeyTable.h XeObjectTable.h +FIX_FILES= Xe.h XeApp.C XeApp.h XeFontTable.C XeKeyTable.C \ + XeKeyTable.h XeObject.C XeObject.h XeObjectTable.h XeText.C \ + XeText.h .include -.if ${OSVERSION} >= 500113 -BROKEN= "Does not compile (bad C++ code)" -.endif - do-configure: .for file in ${FIX_FILES} @${REINPLACE_CMD} -e 's|#include |#include |' \ + -e 's|std::slist|std::list|g' \ + -e 's|#include |#include |' \ + -e 's|std::hash_map|__gnu_cxx::hash_map|g' \ + -e 's|std::hash|__gnu_cxx::hash|g' \ + ${WRKSRC}/${file} .endfor do-install: diff --git a/editors/xenon/files/patch-Makefile.common b/editors/xenon/files/patch-Makefile.common new file mode 100644 index 0000000..a07d8d2 --- /dev/null +++ b/editors/xenon/files/patch-Makefile.common @@ -0,0 +1,20 @@ +--- makefiles/Makefile.common.orig Sat Aug 4 16:59:06 2001 ++++ makefiles/Makefile.common Fri Dec 1 20:33:15 2006 +@@ -67,7 +67,7 @@ + MKDEPEND = ./mkdepend + DEPEND = .depend + +-_CCFLAGS = $(ARCH) $(CCFLAGS) $(INCLUDES) ++_CCFLAGS = $(CCFLAGS) $(INCLUDES) + _LDFLAGS = $(TARGETLIB) $(LIBS) + + #LDFLAGS = $(TARGETLIB) -lXpm -lX11 +@@ -94,7 +94,7 @@ + # $(CC) -shared -o $(TARGETSO) $(OBJECTS) + + $(TARGET): $(TARGETLIB) $(AUXTARGET).o +- $(CC) $(ARCH) $(LDFLAGS) $(AUXTARGET).o $(_LDFLAGS) -o $(TARGET) ++ $(CC) $(LDFLAGS) $(AUXTARGET).o $(_LDFLAGS) -o $(TARGET) + + #$(SHTARGET): $(TARGETSO) $(TARGET).o + # $(CC) -o $(TARGET) -g $(TARGET).o $(SHLDFLAGS) diff --git a/editors/xenon/files/patch-XeFontTable.h b/editors/xenon/files/patch-XeFontTable.h new file mode 100644 index 0000000..15cdd9a --- /dev/null +++ b/editors/xenon/files/patch-XeFontTable.h @@ -0,0 +1,29 @@ +--- XeFontTable.h.orig Wed Aug 1 04:22:25 2001 ++++ XeFontTable.h Fri Dec 1 20:55:07 2006 +@@ -18,21 +18,21 @@ + // hash function object for std::string - maybe move this to Xe.h if it + // turns out that string keyed hash_maps are used elsewhere + +-namespace std ++namespace __gnu_cxx + { +-template<> struct hash ++template<> struct hash + { +- size_t operator()(const string& s) const ++ size_t operator()(const std::string& s) const + { + return __stl_hash_string(s.c_str()); + } + }; + } + +-class XeFontTable : public std::hash_map { ++class XeFontTable : public __gnu_cxx::hash_map { + public: + XeFontTable(void) +- : std::hash_map(64) {} ++ : __gnu_cxx::hash_map(64) {} + ~XeFontTable(); + + XFontStruct* getFont(const char* fontname); diff --git a/editors/xenon/files/patch-XeText.C b/editors/xenon/files/patch-XeText.C new file mode 100644 index 0000000..5025149 --- /dev/null +++ b/editors/xenon/files/patch-XeText.C @@ -0,0 +1,33 @@ +--- XeText.C.orig Sat Jan 5 20:39:39 2002 ++++ XeText.C Fri Dec 1 21:25:34 2006 +@@ -1612,26 +1612,19 @@ + + if(_numUndos >= _maxUndos) { + +- // $$$ calling previous() here assums _undoList is not empty +- // previous() is O(N) where N is the number of undo items in the list +- // if this turns out to be too much of a performance penalty, use +- // std::list instead of std::slist for _undoList +- +- std::slist::iterator pos = _undoList.previous(_undoList.end()); +- Undo* undo = *pos; ++ Undo* undo = _undoList.back(); + + _undoBuf.remove(KRBUF_END, _undoBuf.length() - undo->len); + delete undo; +- _undoList.erase(pos); ++ _undoList.pop_back(); + + if (!_undoList.empty()) { +- pos = _undoList.previous(_undoList.end()); +- undo = *pos; ++ undo = _undoList.back(); + + if (undo && undo->type == InsertSelection) { + _undoBuf.remove(KRBUF_END, _undoBuf.length() - undo->len); + delete undo; +- _undoList.erase(pos); ++ _undoList.pop_back(); + } + } + -- cgit v1.1