aboutsummaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authorTilman Keskinoz <arved@FreeBSD.org>2004-10-13 08:26:49 +0000
committerTilman Keskinoz <arved@FreeBSD.org>2004-10-13 08:26:49 +0000
commitab16937b7459d99f6f8265ee41b90aa9a353bc86 (patch)
tree6820f942deb76c21a23741cc44c3509c13dc5c3e /devel
parenta9602a853568931bf63916c1ff9dcc6fb7376aea (diff)
downloadports-ab16937b7459d99f6f8265ee41b90aa9a353bc86.tar.gz
ports-ab16937b7459d99f6f8265ee41b90aa9a353bc86.zip
Notes
Diffstat (limited to 'devel')
-rw-r--r--devel/tvision/Makefile6
-rw-r--r--devel/tvision/files/patch-ncurses-mouse112
-rw-r--r--devel/tvision/files/patch-streambyteorder41
-rw-r--r--devel/tvision/files/patch-tfiledialog43
-rw-r--r--devel/tvision/files/patch-uchar161
5 files changed, 360 insertions, 3 deletions
diff --git a/devel/tvision/Makefile b/devel/tvision/Makefile
index 8ca8f2d395c0..b126b19f39cb 100644
--- a/devel/tvision/Makefile
+++ b/devel/tvision/Makefile
@@ -7,20 +7,20 @@
PORTNAME= tvision
PORTVERSION= 0.8
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= devel
MASTER_SITES= ${MASTER_SITE_SUNSITE} \
http://www.sigala.it/sergio/tvision/mysource/
MASTER_SITE_SUBDIR= devel/lang/c++
-MAINTAINER= libh@FreeBSD.org
+MAINTAINER= ports@FreeBSD.org
COMMENT= The Turbo Vision C++ CUI library for UNIX
USE_REINPLACE= yes
GNU_CONFIGURE= yes
CONFIGURE_TARGET= --build=${ARCH}-portbld-freebsd${OSREL}
INSTALLS_SHLIB= yes
-USE_GCC= 3.3
+USE_GCC= 3.4
.include <bsd.port.pre.mk>
diff --git a/devel/tvision/files/patch-ncurses-mouse b/devel/tvision/files/patch-ncurses-mouse
new file mode 100644
index 000000000000..3d4e81633072
--- /dev/null
+++ b/devel/tvision/files/patch-ncurses-mouse
@@ -0,0 +1,112 @@
+This enables ncurses mouse support, which was broken (it seemed to depend
+on gpm in an unhealthy way).
+
+diff -ur tvision-0.8-orig/lib/system.cc lib/system.cc
+--- tvision-0.8-orig/lib/system.cc Wed Jul 21 20:44:59 2004
++++ lib/system.cc Wed Jul 21 21:14:29 2004
+@@ -709,6 +709,10 @@
+ * Reads a key from the keyboard.
+ */
+ #ifdef NCURSES_MOUSE_VERSION
++static void msInit();
++static void msClose();
++static void msSuspend();
++static void msResume();
+ static void msHandle();
+ #endif
+
+@@ -1139,6 +1143,28 @@
+ */
+
+ #ifdef NCURSES_MOUSE_VERSION
++static mmask_t orig_mousemask = 0;
++
++static void msInit()
++{
++ mmask_t m = mousemask(ALL_MOUSE_EVENTS | REPORT_MOUSE_POSITION, &orig_mousemask);
++}
++
++static void msClose()
++{
++ mmask_t m = mousemask(orig_mousemask, NULL);
++}
++
++static void msSuspend()
++{
++ mmask_t m = mousemask(0, NULL);
++}
++
++static void msResume()
++{
++ mmask_t m = mousemask(ALL_MOUSE_EVENTS | REPORT_MOUSE_POSITION, NULL);
++}
++
+ static void msHandle()
+ {
+ TEvent event;
+@@ -1738,6 +1764,10 @@
+ TScreen::drawMouse(0);
+ #ifdef ENABLE_GPM
+ gpmClose();
++#else
++#ifdef NCURSES_MOUSE_VERSION
++ msClose();
++#endif
+ #endif
+ stopcurses();
+ #ifdef ENABLE_VCS
+@@ -1925,6 +1955,10 @@
+ startcurses(); /* curses stuff */
+ #ifdef ENABLE_GPM
+ gpmInit();
++#else
++#ifdef NCURSES_MOUSE_VERSION
++ msInit();
++#endif
+ #endif
+ /* catch useful signals */
+
+@@ -1958,6 +1992,10 @@
+ startcurses();
+ #ifdef ENABLE_GPM
+ gpmResume();
++#else
++#ifdef NCURSES_MOUSE_VERSION
++ msResume();
++#endif
+ #endif
+ doRepaint++;
+ }
+@@ -1966,6 +2004,10 @@
+ {
+ #ifdef ENABLE_GPM
+ gpmSuspend();
++#else
++#ifdef NCURSES_MOUSE_VERSION
++ msSuspend();
++#endif
+ #endif
+ stopcurses();
+ }
+@@ -1993,6 +2035,10 @@
+ */
+ #ifdef ENABLE_GPM
+ gpmSuspend();
++#else
++#ifdef NCURSES_MOUSE_VERSION
++ msSuspend();
++#endif
+ #endif
+ clear(); /* blank the screen */
+ refresh(); /* this is necessary */
+@@ -2000,6 +2046,10 @@
+ startcurses();
+ #ifdef ENABLE_GPM
+ gpmResume();
++#else
++#ifdef NCURSES_MOUSE_VERSION
++ msResume();
++#endif
+ #endif
+ doResize = 0;
+ winsize win;
diff --git a/devel/tvision/files/patch-streambyteorder b/devel/tvision/files/patch-streambyteorder
new file mode 100644
index 000000000000..3cd8284f6a89
--- /dev/null
+++ b/devel/tvision/files/patch-streambyteorder
@@ -0,0 +1,41 @@
+ntohs() won't work, because it converts from bigendian to native
+byteorder, and the format used in TVision streams is littleendian.
+Conversion must be done explicitly, by calling readByte() several
+times, in consecutive statements !
+
+
+diff -ur -orig/lib/tobjstrm.cc lib/tobjstrm.cc
+--- -orig/lib/tobjstrm.cc Tue Sep 7 17:31:19 2004
++++ lib/tobjstrm.cc Tue Sep 7 17:34:15 2004
+@@ -295,11 +295,9 @@
+ ipstream::readWord()
+ {
+ /* SS: words are stored in little endian format (LSB first) */
+- ushort val;
+-
+- read((char *)&val, 2);
+- val = ntohs(val);
+- return val;
++ ushort ret = readByte();
++ ret = ret | (readByte() << 8);
++ return ret;
+ }
+
+ /**
+@@ -309,11 +307,11 @@
+ ipstream::readLong()
+ {
+ /* SS: ints are stored in little endian format (LSB first) */
+- ulong val;
+-
+- read((char *)&val, 4);
+- val = ntohl(val);
+- return val;
++ ulong ret = readByte();
++ ret = ret | (readByte() << 8);
++ ret = ret | (readByte() << 16);
++ ret = ret | (readByte() << 24);
++ return ret;
+ }
+
+ /**
diff --git a/devel/tvision/files/patch-tfiledialog b/devel/tvision/files/patch-tfiledialog
new file mode 100644
index 000000000000..524045db430b
--- /dev/null
+++ b/devel/tvision/files/patch-tfiledialog
@@ -0,0 +1,43 @@
+Un*x filenames can easily contain spaces ... Don't trim the filename.
+
+diff -ur tvision-0.8-orig/lib/TFileDialog.cc lib/TFileDialog.cc
+--- tvision-0.8-orig/lib/TFileDialog.cc Thu Jul 26 09:59:20 2001
++++ lib/TFileDialog.cc Wed Sep 8 14:14:15 2004
+@@ -162,6 +162,7 @@
+
+ /* 'src' is cast to unsigned char * so that isspace sign extends it
+ correctly. */
++/* Function defined but not used
+ static void trim( char *dest, const char *src )
+ {
+ while( *src != EOS && isspace( * (const unsigned char *) src ) )
+@@ -170,11 +171,13 @@
+ *dest++ = *src++;
+ *dest = EOS;
+ }
++*/
+
+ void TFileDialog::getFileName( char *s )
+ {
+ /* SS: changed */
+
++#if 0
+ char buf[PATH_MAX];
+
+ trim( buf, fileName->data );
+@@ -185,6 +188,15 @@
+ }
+ fexpand( buf );
+ strcpy( s, buf );
++#else
++ strcpy( s, fileName->data );
++ if( relativePath( s ) == True )
++ {
++ strcpy( s, directory );
++ strcat( s, fileName->data );
++ }
++ fexpand( s );
++#endif
+ }
+
+ void TFileDialog::handleEvent(TEvent& event)
diff --git a/devel/tvision/files/patch-uchar b/devel/tvision/files/patch-uchar
new file mode 100644
index 000000000000..64cbc8a26e7f
--- /dev/null
+++ b/devel/tvision/files/patch-uchar
@@ -0,0 +1,161 @@
+Avoid possible problems with signed/unsigned char comparisons. And
+functions like toupper must be called with an unsigned char.
+
+
+diff -ur tvision-0.8-orig/lib/TButton.cc lib/TButton.cc
+--- tvision-0.8-orig/lib/TButton.cc Thu Jul 26 09:59:19 2001
++++ lib/TButton.cc Wed Jul 28 20:44:03 2004
+@@ -202,7 +202,7 @@
+ if( event.keyDown.keyCode == getAltCode(c) ||
+ ( owner->phase == phPostProcess &&
+ c != 0 &&
+- toupper(event.keyDown.charScan.charCode) == c
++ toupper(event.keyDown.charScan.charCode) == (uchar)c
+ ) ||
+ ( (state & sfFocused) != 0 &&
+ event.keyDown.charScan.charCode == ' '
+diff -ur tvision-0.8-orig/lib/TCluster.cc lib/TCluster.cc
+--- tvision-0.8-orig/lib/TCluster.cc Thu Jul 26 09:59:19 2001
++++ lib/TCluster.cc Wed Jul 28 20:44:16 2004
+@@ -271,7 +271,7 @@
+ (state & sfFocused) != 0
+ ) &&
+ c != 0 &&
+- toupper(event.keyDown.charScan.charCode) == c
++ toupper(event.keyDown.charScan.charCode) == (uchar)c
+ )
+ )
+ {
+diff -ur tvision-0.8-orig/lib/TFileList.cc lib/TFileList.cc
+--- tvision-0.8-orig/lib/TFileList.cc Wed Jul 28 18:52:17 2004
++++ lib/TFileList.cc Wed Jul 28 20:45:21 2004
+@@ -80,7 +80,7 @@
+
+ /* SS: changed */
+
+- for (char *p = sR.name; *p != '\0'; p++) *p = toupper(*p);
++ for (unsigned char *p = (unsigned char *)sR.name; *p != '\0'; p++) *p = toupper(*p);
+ return &sR;
+ }
+
+diff -ur tvision-0.8-orig/lib/TInputLine.cc lib/TInputLine.cc
+--- tvision-0.8-orig/lib/TInputLine.cc Thu Jul 26 09:59:20 2001
++++ lib/TInputLine.cc Wed Jul 28 20:45:56 2004
+@@ -29,7 +29,7 @@
+ char *p;
+
+ if( (p = strchr( (char *) s, '~' )) != 0 )
+- return toupper(p[1]);
++ return toupper((uchar)(p[1]));
+ else
+ return 0;
+ }
+diff -ur tvision-0.8-orig/lib/TLabel.cc lib/TLabel.cc
+--- tvision-0.8-orig/lib/TLabel.cc Thu Jul 26 09:59:20 2001
++++ lib/TLabel.cc Wed Jul 28 20:46:18 2004
+@@ -86,7 +86,7 @@
+ char c = hotKey( text );
+ if( getAltCode(c) == event.keyDown.keyCode ||
+ ( c != 0 && owner->phase == TGroup::phPostProcess &&
+- toupper(event.keyDown.charScan.charCode) == c )
++ toupper(event.keyDown.charScan.charCode) == (uchar)c )
+ )
+ focusLink(event);
+ }
+diff -ur tvision-0.8-orig/lib/TMenuView.cc lib/TMenuView.cc
+--- tvision-0.8-orig/lib/TMenuView.cc Wed Jul 28 18:52:17 2004
++++ lib/TMenuView.cc Wed Jul 28 20:47:15 2004
+@@ -339,14 +339,14 @@
+
+ TMenuItem *TMenuView::findItem( char ch )
+ {
+- ch = toupper(ch);
++ ch = toupper((uchar)ch);
+ TMenuItem *p = menu->items;
+ while( p != 0 )
+ {
+ if( p->name != 0 && !p->disabled )
+ {
+ char *loc = strchr( (char *) p->name, '~' );
+- if( loc != 0 && (uchar)ch == toupper( loc[1] ) )
++ if( loc != 0 && (uchar)ch == toupper( (uchar)(loc[1]) ) )
+ return p;
+ }
+ p = p->next;
+diff -ur tvision-0.8-orig/lib/TValidator.cc lib/TValidator.cc
+--- tvision-0.8-orig/lib/TValidator.cc Thu Jul 26 09:59:22 2001
++++ lib/TValidator.cc Wed Jul 28 20:49:31 2004
+@@ -388,10 +388,10 @@
+ if (! isLetter(ch))
+ return prError;
+ else
+- consume(toupper(ch), input);
++ consume(toupper((uchar)ch), input);
+ break;
+ case '!':
+- consume(toupper(ch), input);
++ consume(toupper((uchar)ch), input);
+ break;
+ case '@':
+ consume(ch, input);
+@@ -427,7 +427,7 @@
+
+ if (pic[index] == ';')
+ index++;
+- if (toupper(pic[index]) != toupper(ch))
++ if (toupper((uchar)(pic[index])) != toupper((uchar)ch))
+ #ifndef __UNPATCHED
+ if (ch != ' ')
+ return rScan;
+diff -ur tvision-0.8-orig/lib/asm.cc lib/asm.cc
+--- tvision-0.8-orig/lib/asm.cc Wed Jul 28 18:52:18 2004
++++ lib/asm.cc Wed Jul 28 20:51:59 2004
+@@ -137,8 +137,8 @@
+ long patternHash = 0;
+ long testHash = 0;
+
+- register const char* testP= (const char*)block;
+- register const char* patP = str;
++ register const unsigned char* testP= (const unsigned char*)block;
++ register const unsigned char* patP = (const unsigned char*)str;
+ register long x = 1;
+ int i = patternLength-1;
+ while(i--) x = (x<<5)%q;
+@@ -148,13 +148,13 @@
+ testHash = ( (testHash <<5) + toupper(*testP++) ) % q;
+ }
+
+- testP = (const char*)block;
+- const char* end = testP + testLength - patternLength;
++ testP = (const unsigned char*)block;
++ const unsigned char* end = testP + testLength - patternLength;
+
+ while (1) {
+
+ if(testHash == patternHash)
+- return testP-(const char*)block;
++ return testP-(const unsigned char*)block;
+
+ if (testP >= end) break;
+
+diff -ur tvision-0.8-orig/lib/tvtext.cc lib/tvtext.cc
+--- tvision-0.8-orig/lib/tvtext.cc Thu Jul 26 09:59:22 2001
++++ lib/tvtext.cc Wed Jul 28 20:40:13 2004
+@@ -64,7 +64,7 @@
+ return '\xF0'; // special case to handle alt-Space
+
+ else if( tmp >= 0x10 && tmp <= 0x32 )
+- return altCodes1[tmp-0x10]; // alt-letter
++ return altCodes1[tmp - 0x10]; // alt-letter
+
+ else if( tmp >= 0x78 && tmp <= 0x83 )
+ return altCodes2[tmp - 0x78]; // alt-number
+@@ -78,7 +78,7 @@
+ if( c == 0 )
+ return 0;
+
+- c = toupper(c);
++ c = toupper((unsigned char) c);
+
+ /* SS: this makes g++ happy */
+