Skip to content

Commit

Permalink
Remove the need for ncurses, just a curses with libform is enough.
Browse files Browse the repository at this point in the history
Bump revision.
  • Loading branch information
joerg committed Sep 12, 2015
1 parent df56bc8 commit 861db2f
Show file tree
Hide file tree
Showing 6 changed files with 152 additions and 4 deletions.
5 changes: 2 additions & 3 deletions devel/cmake/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.103 2015/08/20 11:35:33 ryoon Exp $
# $NetBSD: Makefile,v 1.104 2015/09/12 15:15:49 joerg Exp $

DISTNAME= cmake-${CMAKE_API}.1
CATEGORIES= devel
Expand All @@ -13,7 +13,6 @@ LICENSE= modified-bsd

USE_TOOLS+= gmake
USE_LANGUAGES= c c++
USE_NCURSES= yes
HAS_CONFIGURE= yes
CONFIGURE_SCRIPT= bootstrap

Expand Down Expand Up @@ -63,7 +62,7 @@ pre-configure:
BUILDLINK_API_DEPENDS.libarchive+= libarchive>=3.0.0
.include "../../archivers/libarchive/buildlink3.mk"
.include "../../devel/libexecinfo/buildlink3.mk"
.include "../../devel/ncurses/buildlink3.mk"
.include "../../mk/curses.buildlink3.mk"
.include "../../textproc/expat/buildlink3.mk"
.include "../../www/curl/buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
6 changes: 5 additions & 1 deletion devel/cmake/distinfo
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
$NetBSD: distinfo,v 1.75 2015/08/20 11:35:33 ryoon Exp $
$NetBSD: distinfo,v 1.76 2015/09/12 15:15:49 joerg Exp $

SHA1 (cmake-3.3.1.tar.gz) = 799aff559e9f330fefc60e6509f1d025fc3d9c8c
RMD160 (cmake-3.3.1.tar.gz) = 39f63aef3c9ba9711f736fd8e51972429ceca527
Size (cmake-3.3.1.tar.gz) = 6577869 bytes
SHA1 (patch-Modules_FindX11.cmake) = 124a2d51155cb4455e8b829dc74598cbd50a4e1c
SHA1 (patch-Modules_Platform_SCO__SV.cmake) = 3ed230b3a06ea693812db8f57bc73aebec12b99f
SHA1 (patch-Modules_Platform_SunOS.cmake) = 7a53ae3c902dd69ee22ef9fe0ae2a022d5284f16
SHA1 (patch-Source_CursesDialog_cmCursesLongMessageForm.cxx) = 61a9df02d1d29ebfd10ebed61692ad4f7f9c8e0b
SHA1 (patch-Source_CursesDialog_cmCursesMainForm.cxx) = 3645f58b2b0ce70ce1cfa4084b95e5b0bbecf411
SHA1 (patch-Source_CursesDialog_cmCursesStringWidget.cxx) = 346171b148e673ef4d8467ca37579ba6c85db295
SHA1 (patch-Source_CursesDialog_cmCursesWidget.cxx) = a6652e6466e66b89bb987620fe9f5b6f7bafc800
SHA1 (patch-Source_cmELF.cxx) = 5eb9dc0b3567b5685596ddf0a03ca8e5c76e6f92
SHA1 (patch-Source_kwsys_SystemInformation.cxx) = e259da70601cf1b4641f253de3d4f3aaec5e68f6
SHA1 (patch-Source_kwsys_SystemTools.cxx) = 634348b9bc8ccf8c72f23837baa6ba0bcacf5961
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
$NetBSD: patch-Source_CursesDialog_cmCursesLongMessageForm.cxx,v 1.1 2015/09/12 15:15:49 joerg Exp $

printw takes a format string.

--- Source/CursesDialog/cmCursesLongMessageForm.cxx.orig 2015-09-07 09:50:13.000000000 +0000
+++ Source/CursesDialog/cmCursesLongMessageForm.cxx
@@ -82,10 +82,10 @@ void cmCursesLongMessageForm::UpdateStat

curses_move(y-4,0);
attron(A_STANDOUT);
- printw(bar);
+ printw("%s", bar);
attroff(A_STANDOUT);
curses_move(y-3,0);
- printw(version);
+ printw("%s", version);
pos_form_cursor(this->Form);
}

@@ -102,7 +102,7 @@ void cmCursesLongMessageForm::PrintKeys(
sprintf(firstLine, "Press [e] to exit help");

curses_move(y-2,0);
- printw(firstLine);
+ printw("%s", firstLine);
pos_form_cursor(this->Form);

}
45 changes: 45 additions & 0 deletions devel/cmake/patches/patch-Source_CursesDialog_cmCursesMainForm.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
$NetBSD: patch-Source_CursesDialog_cmCursesMainForm.cxx,v 1.1 2015/09/12 15:15:49 joerg Exp $

printw takes a format string.

--- Source/CursesDialog/cmCursesMainForm.cxx.orig 2015-09-07 09:50:58.000000000 +0000
+++ Source/CursesDialog/cmCursesMainForm.cxx
@@ -456,19 +456,19 @@ void cmCursesMainForm::PrintKeys(int pro
{
strcpy(fmt, " ");
}
- printw(fmt);
+ printw("%s", fmt);
curses_move(y-3,0);
- printw(firstLine);
+ printw("%s", firstLine);
curses_move(y-2,0);
- printw(secondLine);
+ printw("%s", secondLine);
curses_move(y-1,0);
- printw(thirdLine);
+ printw("%s", thirdLine);

if (cw)
{
sprintf(firstLine, "Page %d of %d", cw->GetPage(), this->NumberOfPages);
curses_move(0,65-static_cast<unsigned int>(strlen(firstLine))-1);
- printw(firstLine);
+ printw("%s", firstLine);
}
// }

@@ -614,11 +614,10 @@ void cmCursesMainForm::UpdateStatusBar(c
// Now print both lines
curses_move(y-5,0);
attron(A_STANDOUT);
- char format[] = "%s";
- printw(format, bar);
+ printw("%s", bar);
attroff(A_STANDOUT);
curses_move(y-4,0);
- printw(version);
+ printw("%s", version);
pos_form_cursor(this->Form);
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
$NetBSD: patch-Source_CursesDialog_cmCursesStringWidget.cxx,v 1.1 2015/09/12 15:15:49 joerg Exp $

printw takes a format string.

Don't use implemention-details of ncurses to see
if the overloading behavior of REQ_DEL_PREV is active, just undo any
damage it may have done.
--- Source/CursesDialog/cmCursesStringWidget.cxx.orig 2015-08-13 14:57:00.000000000 +0000
+++ Source/CursesDialog/cmCursesStringWidget.cxx
@@ -168,17 +168,16 @@ bool cmCursesStringWidget::HandleInput(i
else if ( key == 127 ||
key == KEY_BACKSPACE )
{
- if ( form->curcol > 0 )
- {
+ FIELD *cur = current_field(form);
form_driver(form, REQ_DEL_PREV);
- }
+ if (current_field(form) != cur)
+ {
+ set_current_field(form, cur);
+ }
}
else if ( key == ctrl('d') ||key == KEY_DC )
{
- if ( form->curcol >= 0 )
- {
- form_driver(form, REQ_DEL_CHAR);
- }
+ form_driver(form, REQ_DEL_CHAR);
}
else
{
@@ -229,17 +228,16 @@ bool cmCursesStringWidget::PrintKeys()
}
firstLine[511] = '\0';
curses_move(y-4,0);
- printw(firstLine);
+ printw("%s", firstLine);
curses_move(y-3,0);
- printw(firstLine);
+ printw("%s", firstLine);
curses_move(y-2,0);
- printw(firstLine);
+ printw("%s", firstLine);
curses_move(y-1,0);
- printw(firstLine);
+ printw("%s", firstLine);

- sprintf(firstLine, "Editing option, press [enter] to leave edit.");
curses_move(y-3,0);
- printw(firstLine);
+ printw("Editing option, press [enter] to leave edit.");
return true;
}
else
15 changes: 15 additions & 0 deletions devel/cmake/patches/patch-Source_CursesDialog_cmCursesWidget.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
$NetBSD: patch-Source_CursesDialog_cmCursesWidget.cxx,v 1.1 2015/09/12 15:15:49 joerg Exp $

Compensate for missing const attribute in NetBSD.

--- Source/CursesDialog/cmCursesWidget.cxx.orig 2015-09-07 09:53:22.000000000 +0000
+++ Source/CursesDialog/cmCursesWidget.cxx
@@ -49,7 +49,7 @@ void cmCursesWidget::Move(int x, int y,
void cmCursesWidget::SetValue(const std::string& value)
{
this->Value = value;
- set_field_buffer(this->Field, 0, value.c_str());
+ set_field_buffer(this->Field, 0, const_cast<char *>(value.c_str()));
}

const char* cmCursesWidget::GetValue()

0 comments on commit 861db2f

Please sign in to comment.