USE_CURSES instead of hardwired dependency on ncurses.

Fix a segfault while I'm here.
This commit is contained in:
wiz 2001-01-07 03:10:50 +00:00
parent e6c49387a5
commit 49117c3626
5 changed files with 45 additions and 30 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.6 2000/06/12 20:52:55 dmcmahill Exp $
# $NetBSD: Makefile,v 1.7 2001/01/07 03:10:50 wiz Exp $
#
DISTNAME= emixer-0.05.5
@ -10,7 +10,10 @@ MAINTAINER= hubertf@netbsd.org
HOMEPAGE= http://emixer.linuxbox.com/
DEPENDS+= mpg123-0.59*:../../audio/mpg123
DEPENDS+= ncurses>=4.2:../../devel/ncurses
USE_CURSES= YES
REPLACE_NCURSES=${WRKSRC}/nctgui.h
MAKE_ENV+= NEED_NCURSES="${NEED_NCURSES}"
post-extract:
${CP} ${FILESDIR}/Makefile ${WRKSRC}

View file

@ -1,11 +1,16 @@
# $NetBSD: Makefile,v 1.3 2000/04/16 02:57:21 mycroft Exp $
# $NetBSD: Makefile,v 1.4 2001/01/07 03:10:50 wiz Exp $
.if defined(NEED_NCURSES) && ${NEED_NCURSES} == "YES"
CFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib -Wl,-R${LOCALBASE}/lib -lm
CURSESLIBS= -lncurses
.else
CURSESLIBS= -lcurses
.endif
all: emixer
emixer: main.o
${CC} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} -lncurses -lossaudio
${CC} ${LDFLAGS} -o ${.TARGET} ${.ALLSRC} ${CURSESLIBS} -lossaudio
install:
${BSD_INSTALL_PROGRAM} emixer ${PREFIX}/bin/emixer

View file

@ -1,7 +1,7 @@
$NetBSD: patch-sum,v 1.3 2000/04/16 03:59:32 mycroft Exp $
$NetBSD: patch-sum,v 1.4 2001/01/07 03:10:50 wiz Exp $
MD5 (patch-aa) = 35be17da885908004a97f5df45aa6752
MD5 (patch-ab) = f25b4f123fa22bd9a323a41cfa69ac9e
MD5 (patch-ac) = 5584a60f491c682a92c286ebeead68ba
MD5 (patch-ad) = 5011600d2e74e170dbde9c80a2446464
MD5 (patch-ac) = 4a66c110f261adbe932e1c7156086d86
MD5 (patch-ad) = e87d827cf0eff57a177beda009c5a6e6
MD5 (patch-ae) = b4bbb0d637aaa4143fc8c99402668122

View file

@ -1,12 +1,11 @@
$NetBSD: patch-ac,v 1.2 2000/04/16 03:59:32 mycroft Exp $
$NetBSD: patch-ac,v 1.3 2001/01/07 03:10:50 wiz Exp $
--- nctgui.c.orig Fri Jan 28 11:30:52 2000
+++ nctgui.c Sat Apr 15 23:53:35 2000
@@ -30,7 +30,10 @@
void ncurses_init(void)
--- nctgui.c.orig Fri Jan 28 17:30:52 2000
+++ nctgui.c
@@ -31,6 +31,10 @@
{
(void) initscr();
- curs_set(0);
curs_set(0);
+ cbreak();
+ noecho();
+ timeout(2);
@ -14,7 +13,7 @@ $NetBSD: patch-ac,v 1.2 2000/04/16 03:59:32 mycroft Exp $
}/* ncurses_init */
void ncurses_exit(void)
@@ -66,24 +69,23 @@
@@ -66,24 +70,23 @@
int j;
int maxY,maxX;
@ -46,7 +45,7 @@ $NetBSD: patch-ac,v 1.2 2000/04/16 03:59:32 mycroft Exp $
} /* display_bar */
/*Display additional info at bottom of screen*/
@@ -106,14 +108,14 @@
@@ -106,14 +109,14 @@
for(j=0;j<num_items[hpos];j++)
{
@ -64,7 +63,7 @@ $NetBSD: patch-ac,v 1.2 2000/04/16 03:59:32 mycroft Exp $
box(subWn,0,0);
wrefresh(subWn);
} /* display_menu */
@@ -127,7 +129,8 @@
@@ -127,7 +130,8 @@
switch(active_channel)
{
case CHANNEL_1:
@ -74,7 +73,7 @@ $NetBSD: patch-ac,v 1.2 2000/04/16 03:59:32 mycroft Exp $
box(chWin,0,0);
wmove(chWin,0,2);
wattrset(chWin,COLOR_PAIR(5)|A_BOLD|A_BLINK);
@@ -137,7 +140,8 @@
@@ -137,7 +141,8 @@
break;
case CHANNEL_2:
@ -84,7 +83,7 @@ $NetBSD: patch-ac,v 1.2 2000/04/16 03:59:32 mycroft Exp $
box(chWin,0,0);
wmove(chWin,0,width-13);
wattrset(chWin,COLOR_PAIR(6)|A_BOLD|A_BLINK);
@@ -155,6 +159,7 @@
@@ -155,6 +160,7 @@
int centre, j;
centre=(FADER_BARS/2)+2;
@ -92,7 +91,7 @@ $NetBSD: patch-ac,v 1.2 2000/04/16 03:59:32 mycroft Exp $
wbkgd(faderWin,COLOR_PAIR(1)|A_BOLD);
box(faderWin,0,0);
wattrset(faderWin,COLOR_PAIR(9)|A_BOLD);
@@ -201,6 +206,7 @@
@@ -201,6 +207,7 @@
getmaxyx(volumeWin,maxY,maxX);
centre=(VOLUME_BARS/2)+2;
@ -100,7 +99,7 @@ $NetBSD: patch-ac,v 1.2 2000/04/16 03:59:32 mycroft Exp $
wbkgd(volumeWin,COLOR_PAIR(1)|A_BOLD);
box(volumeWin,0,0);
if(bar==VOLBAR)mvwaddstr(volumeWin,maxY-1,maxX-9,"[Active]");
@@ -263,6 +269,7 @@
@@ -263,6 +270,7 @@
getmaxyx(speedWin,maxY,maxX);
centre=(SPEED_BARS/2)+2;
@ -108,7 +107,7 @@ $NetBSD: patch-ac,v 1.2 2000/04/16 03:59:32 mycroft Exp $
wbkgd(speedWin,COLOR_PAIR(1)|A_BOLD);
box(speedWin,0,0);
if(bar==SPDBAR)mvwaddstr(speedWin,maxY-1,maxX-9,"[Active]");
@@ -323,6 +330,7 @@
@@ -323,6 +331,7 @@
void display_player_status(int sim_play, int playmode)
{
@ -116,7 +115,7 @@ $NetBSD: patch-ac,v 1.2 2000/04/16 03:59:32 mycroft Exp $
wbkgd(pStatusWin,COLOR_PAIR(1)|A_BOLD);
box(pStatusWin,0,0);
wattrset(pStatusWin,COLOR_PAIR(9)|A_BOLD);
@@ -343,54 +351,6 @@
@@ -343,54 +352,6 @@
exit(0);
} /*gui_exit/*/
@ -171,7 +170,7 @@ $NetBSD: patch-ac,v 1.2 2000/04/16 03:59:32 mycroft Exp $
void create_windows()
{
int maxY, maxX, height, width, origY=1, origX=0;
@@ -398,10 +358,7 @@
@@ -398,10 +359,7 @@
getmaxyx(stdscr,maxY,maxX);
height = maxY-4; width = (maxX/10)*7;
chWin = newwin(height,width,origY,origX);

View file

@ -1,7 +1,7 @@
$NetBSD: patch-ad,v 1.2 2000/04/16 03:59:32 mycroft Exp $
$NetBSD: patch-ad,v 1.3 2001/01/07 03:10:50 wiz Exp $
--- main.c.orig Tue Jan 25 19:11:56 2000
+++ main.c Sat Apr 15 23:51:57 2000
--- main.c.orig Wed Jan 26 01:11:56 2000
+++ main.c
@@ -115,8 +115,6 @@
menus_active = FALSE;
@ -282,7 +282,7 @@ $NetBSD: patch-ad,v 1.2 2000/04/16 03:59:32 mycroft Exp $
}
else if(active_channel==CHANNEL_2)
{
@@ -904,14 +889,11 @@
@@ -904,46 +889,53 @@
while(temp!=bHead){tracktotal++;temp=temp->fLink;}
/* display current track number and total tracks */
@ -297,9 +297,17 @@ $NetBSD: patch-ad,v 1.2 2000/04/16 03:59:32 mycroft Exp $
while (top!=NULL)
{
@@ -921,29 +903,34 @@
+ char *fnstart;
fpath=top->filePath;
playcount=top->playcount;
/*get songname from path, the songname is assumed to be
the characters after the last forward slash(/) */
songname=strstr(strrchr(fpath,'/'),"/")+1;
- songname=strstr(strrchr(fpath,'/'),"/")+1;
+ fnstart = strrchr(fpath,'/');
+ if (fnstart == NULL)
+ songname=fpath;
+ else
+ songname=strstr(fnstart,"/")+1;
if(current==top)
+ {
if(active_channel==CHANNEL_1)
@ -339,7 +347,7 @@ $NetBSD: patch-ad,v 1.2 2000/04/16 03:59:32 mycroft Exp $
} /*display_listdata */
void menu_action(char *item_name)
@@ -967,21 +954,10 @@
@@ -967,21 +959,10 @@
void exit_prog(void)
{
reset_audio();