From f53b3dad2fc76677319810944440f7058f375f63 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Tue, 19 Mar 2013 18:40:56 +0100 Subject: added minor scinterm patches and cleaned up patch system * MinGW binaries are built from source bundles * patches are applied to the source bundle * so all necessary patches must be in the repository and distributed * use a leading number in patch names to ensure proper application order --- Makefile.am | 3 +-- distribute | 2 +- patches/010-scintilla-teco-control-codes.patch | 33 ++++++++++++++++++++++++++ patches/020-scinterm-fix-64-bit.patch | 22 +++++++++++++++++ patches/030-scinterm-crosscompile.patch | 19 +++++++++++++++ patches/035-scinterm-curses-header.patch | 11 +++++++++ patches/scinterm-fix-64-bit.patch | 22 ----------------- patches/scintilla-teco-control-codes.patch | 33 -------------------------- 8 files changed, 87 insertions(+), 58 deletions(-) create mode 100644 patches/010-scintilla-teco-control-codes.patch create mode 100644 patches/020-scinterm-fix-64-bit.patch create mode 100644 patches/030-scinterm-crosscompile.patch create mode 100644 patches/035-scinterm-curses-header.patch delete mode 100644 patches/scinterm-fix-64-bit.patch delete mode 100644 patches/scintilla-teco-control-codes.patch diff --git a/Makefile.am b/Makefile.am index 3fdeaae..11172d7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -6,7 +6,6 @@ noinst_HEADERS = compat/bsd/sys/cdefs.h \ compat/bsd/sys/queue.h \ compat/bsd/sys/tree.h -EXTRA_DIST = patches/scintilla-teco-control-codes.patch \ - patches/scinterm-fix-64-bit.patch +EXTRA_DIST = $(wildcard @top_srcdir@/patches/*.patch) EXTRA_DIST += TODO diff --git a/distribute b/distribute index 57bb953..4fd80d8 100755 --- a/distribute +++ b/distribute @@ -31,7 +31,7 @@ sciteco-$(SCITECO_VERSION)-bundle.tar.gz : $(SCITECO_SRC) $(SCINTILLA_SRC) $(SCI unzip -d scintilla/ ../$(SCINTERM_SRC); \ mv scintilla/scinterm_$(SCINTERM_VERSION) scintilla/scinterm; \ for patch in sciteco/patches/*.patch; do \ - patch --merge -p0 <$$patch; \ + patch --merge -p1 <$$patch; \ done; \ ) tar czf $@ sciteco-$(SCITECO_VERSION)/ diff --git a/patches/010-scintilla-teco-control-codes.patch b/patches/010-scintilla-teco-control-codes.patch new file mode 100644 index 0000000..f479909 --- /dev/null +++ b/patches/010-scintilla-teco-control-codes.patch @@ -0,0 +1,33 @@ +Hacks Scintilla to display control characters like TECO does: +Caret followed by code+64 with a few exceptions. +Also improves Scinterm's heuristics for printing control +characters. +--- a/scintilla/src/Editor.cxx 2013-01-19 21:51:58.002270685 +0100 ++++ b/scintilla/src/Editor.cxx 2013-01-20 02:07:27.212272030 +0100 +@@ -351,10 +351,10 @@ + + const char *ControlCharacterString(unsigned char ch) { + const char *reps[] = { +- "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL", +- "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI", +- "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB", +- "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US" ++ "^@", "^A", "^B", "^C", "^D", "^E", "^F", "^G", ++ "^H", "TAB" /* ^I */, "LF" /* ^J */, "^K", "^L", "CR" /* ^M */, "^N", "^O", ++ "^P", "^Q", "^R", "^S", "^T", "^U", "^V", "^W", ++ "^X", "^Y", "^Z", "$" /* ^[ */, "^\\", "^]", "^^", "^_" + }; + if (ch < (sizeof(reps) / sizeof(reps[0]))) { + return reps[ch]; +--- a/scintilla/scinterm/ScintillaTerm.cxx 2013-01-19 23:49:46.092268831 +0100 ++++ b/scintilla/scinterm/ScintillaTerm.cxx 2013-01-20 01:55:36.213521263 +0100 +@@ -290,8 +290,7 @@ + void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, + const char *s, int len, ColourDesired fore, + ColourDesired back) { +- if ((len == 2 && (isupper(s[0]) && isupper(s[1]))) || +- (len == 3 && (isupper(s[0]) && isupper(s[1]) && isupper(s[2])))) ++ if (rc.left >= rc.right) + rc.left -= 2, rc.right -= 2, rc.top -= 1, rc.bottom -= 1; + else if (rc.top > rc.bottom) + rc.top -= 1, rc.bottom += 1; diff --git a/patches/020-scinterm-fix-64-bit.patch b/patches/020-scinterm-fix-64-bit.patch new file mode 100644 index 0000000..47c7e6d --- /dev/null +++ b/patches/020-scinterm-fix-64-bit.patch @@ -0,0 +1,22 @@ +Fixes (void *) to (attr_t) casting on certain target configurations +where sizeof(attr_t) < sizeof(void *) +--- a/scintilla/scinterm/ScintillaTerm.cxx 2013-03-17 19:22:04.864167902 +0100 ++++ b/scintilla/scinterm/ScintillaTerm.cxx 2013-03-17 19:44:48.832401507 +0100 +@@ -9,6 +9,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -274,7 +275,8 @@ + void DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, + const char *s, int len, ColourDesired fore, + ColourDesired back) { +- wattr_set(win, reinterpret_cast(font_.GetID()), ++ intptr_t id = reinterpret_cast(font_.GetID()); ++ wattr_set(win, static_cast(id), + term_color_pair(fore, back), NULL); + if (rc.left < 0) s += static_cast(-rc.left), rc.left = 0; + mvwaddnstr(win, rc.top, rc.left, s, Platform::Minimum(len, COLS - rc.left)); diff --git a/patches/030-scinterm-crosscompile.patch b/patches/030-scinterm-crosscompile.patch new file mode 100644 index 0000000..e4bcd46 --- /dev/null +++ b/patches/030-scinterm-crosscompile.patch @@ -0,0 +1,19 @@ +--- a/scintilla/scinterm/Makefile 2013-02-18 20:41:07.357813654 +0100 ++++ b/scintilla/scinterm/Makefile 2013-02-18 20:42:31.535828138 +0100 +@@ -2,6 +2,7 @@ + + .SUFFIXES: .cxx .c .o .h .a + ++AR = ar + CXX = g++ + INCLUDEDIRS = -I ../include -I ../src -I ../lexlib + CXXFLAGS = -Wall -Wno-missing-braces -Wno-char-subscripts -Wno-long-long \ +@@ -30,7 +31,7 @@ + CharacterSet.o LexerBase.o LexerModule.o LexerNoExceptions.o \ + LexerSimple.o PropSetSimple.o StyleContext.o WordList.o \ + $(lexers) ScintillaTerm.o +- ar rc $@ $^ ++ $(AR) rc $@ $^ + touch $@ + clean: + rm -f *.o $(scintilla) diff --git a/patches/035-scinterm-curses-header.patch b/patches/035-scinterm-curses-header.patch new file mode 100644 index 0000000..fbce286 --- /dev/null +++ b/patches/035-scinterm-curses-header.patch @@ -0,0 +1,11 @@ +--- a/scintilla/scinterm/ScintillaTerm.cxx 2013-03-19 18:32:55.511861027 +0100 ++++ b/scintilla/scinterm/ScintillaTerm.cxx 2013-03-19 18:33:05.747736822 +0100 +@@ -15,7 +15,7 @@ + #include + #include + +-#include ++#include + + #include "Platform.h" + diff --git a/patches/scinterm-fix-64-bit.patch b/patches/scinterm-fix-64-bit.patch deleted file mode 100644 index 2196b03..0000000 --- a/patches/scinterm-fix-64-bit.patch +++ /dev/null @@ -1,22 +0,0 @@ -Fixes (void *) to (attr_t) casting on certain target configurations -where sizeof(attr_t) < sizeof(void *) ---- scintilla/scinterm/ScintillaTerm.cxx 2013-03-17 19:22:04.864167902 +0100 -+++ scintilla/scinterm/ScintillaTerm.cxx 2013-03-17 19:44:48.832401507 +0100 -@@ -9,6 +9,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -274,7 +275,8 @@ - void DrawTextNoClip(PRectangle rc, Font &font_, XYPOSITION ybase, - const char *s, int len, ColourDesired fore, - ColourDesired back) { -- wattr_set(win, reinterpret_cast(font_.GetID()), -+ intptr_t id = reinterpret_cast(font_.GetID()); -+ wattr_set(win, static_cast(id), - term_color_pair(fore, back), NULL); - if (rc.left < 0) s += static_cast(-rc.left), rc.left = 0; - mvwaddnstr(win, rc.top, rc.left, s, Platform::Minimum(len, COLS - rc.left)); diff --git a/patches/scintilla-teco-control-codes.patch b/patches/scintilla-teco-control-codes.patch deleted file mode 100644 index 55e52ad..0000000 --- a/patches/scintilla-teco-control-codes.patch +++ /dev/null @@ -1,33 +0,0 @@ -Hacks Scintilla to display control characters like TECO does: -Caret followed by code+64 with a few exceptions. -Also improves Scinterm's heuristics for printing control -characters. ---- scintilla/src/Editor.cxx 2013-01-19 21:51:58.002270685 +0100 -+++ scintilla/src/Editor.cxx 2013-01-20 02:07:27.212272030 +0100 -@@ -351,10 +351,10 @@ - - const char *ControlCharacterString(unsigned char ch) { - const char *reps[] = { -- "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL", -- "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI", -- "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB", -- "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US" -+ "^@", "^A", "^B", "^C", "^D", "^E", "^F", "^G", -+ "^H", "TAB" /* ^I */, "LF" /* ^J */, "^K", "^L", "CR" /* ^M */, "^N", "^O", -+ "^P", "^Q", "^R", "^S", "^T", "^U", "^V", "^W", -+ "^X", "^Y", "^Z", "$" /* ^[ */, "^\\", "^]", "^^", "^_" - }; - if (ch < (sizeof(reps) / sizeof(reps[0]))) { - return reps[ch]; ---- scintilla/scinterm/ScintillaTerm.cxx 2013-01-19 23:49:46.092268831 +0100 -+++ scintilla/scinterm/ScintillaTerm.cxx 2013-01-20 01:55:36.213521263 +0100 -@@ -290,8 +290,7 @@ - void DrawTextClipped(PRectangle rc, Font &font_, XYPOSITION ybase, - const char *s, int len, ColourDesired fore, - ColourDesired back) { -- if ((len == 2 && (isupper(s[0]) && isupper(s[1]))) || -- (len == 3 && (isupper(s[0]) && isupper(s[1]) && isupper(s[2])))) -+ if (rc.left >= rc.right) - rc.left -= 2, rc.right -= 2, rc.top -= 1, rc.bottom -= 1; - else if (rc.top > rc.bottom) - rc.top -= 1, rc.bottom += 1; -- cgit v1.2.3