summaryrefslogtreecommitdiff
path: root/editors/xenon
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2006-12-03 23:21:53 +0000
committerMartin Wilke <miwi@FreeBSD.org>2006-12-03 23:21:53 +0000
commit42ff63f8912e017692706d9f744e0ba3974acd15 (patch)
tree951fbb6ede4ac8f78b9c1def1767d7d8df7f7adb /editors/xenon
parent- Update to 1.05 (diff)
- Unbreak fix build on 5.X
PR: ports/106198 Submitted by: Peter Johnson <johnson.peter@gmail.com>
Notes
Notes: svn path=/head/; revision=178768
Diffstat (limited to 'editors/xenon')
-rw-r--r--editors/xenon/Makefile20
-rw-r--r--editors/xenon/files/patch-Makefile.common20
-rw-r--r--editors/xenon/files/patch-XeFontTable.h29
-rw-r--r--editors/xenon/files/patch-XeText.C33
4 files changed, 94 insertions, 8 deletions
diff --git a/editors/xenon/Makefile b/editors/xenon/Makefile
index 55eb188f0e67..095a8a1c6157 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 <bsd.port.pre.mk>
-.if ${OSVERSION} >= 500113
-BROKEN= "Does not compile (bad C++ code)"
-.endif
-
do-configure:
.for file in ${FIX_FILES}
@${REINPLACE_CMD} -e 's|#include <ext/|#include <|' \
- -e 's|ulong|u_long|g' -e 's|uint|u_int|g' ${WRKSRC}/${file}
+ -e 's|ulong|u_long|g' -e 's|uint|u_int|g' \
+ -e 's|#include <slist>|#include <list>|' \
+ -e 's|std::slist|std::list|g' \
+ -e 's|#include <hash_map>|#include <ext/hash_map>|' \
+ -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 000000000000..a07d8d2dd381
--- /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 000000000000..15cdd9ab9fc9
--- /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<string>
++template<> struct hash<std::string>
+ {
+- 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<std::string, XFontStruct*> {
++class XeFontTable : public __gnu_cxx::hash_map<std::string, XFontStruct*> {
+ public:
+ XeFontTable(void)
+- : std::hash_map<std::string, XFontStruct*>(64) {}
++ : __gnu_cxx::hash_map<std::string, XFontStruct*>(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 000000000000..502514913159
--- /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<Undo*>::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();
+ }
+ }
+