Update to ncmpc 0.16.1, from maintainer Tobias Ulmer, thanks!

This commit is contained in:
landry 2010-04-05 19:05:11 +00:00
parent 7f73232c5a
commit 80bffc958a
11 changed files with 73 additions and 201 deletions

View File

@ -1,45 +1,34 @@
# $OpenBSD: Makefile,v 1.11 2010/02/13 13:17:03 jasper Exp $
# $OpenBSD: Makefile,v 1.12 2010/04/05 19:05:11 landry Exp $
COMMENT= curses based frontend for mpd
DISTNAME= ncmpc-20070917
PKGNAME= ${DISTNAME}p1
DISTNAME= ncmpc-0.16.1
PKGNAME= ${DISTNAME}v0
CATEGORIES= audio
HOMEPAGE= http://hem.bredband.net/kaw/ncmpc/
HOMEPAGE= http://mpd.wikia.com/wiki/Client:Ncmpc
MAINTAINER= Tobias Ulmer <tobiasu@tmux.org>
# GPL
# GPLv2
PERMIT_PACKAGE_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
WANTLIB= c ncurses
LIB_DEPENDS= glib-2.0::devel/glib2
USE_LIBTOOL= Yes
BUILD_DEPENDS= ${MODGNU_AUTOCONF_DEPENDS} \
${MODGNU_AUTOMAKE_DEPENDS}
LIB_DEPENDS= glib-2.0::devel/glib2 mpdclient::audio/libmpdclient
MODULES= devel/gettext
MASTER_SITES= http://www.phil.uu.nl/~lievisse/distfiles/
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=musicpd/}
CONFIGURE_STYLE= gnu
AUTOMAKE_VERSION= 1.8
AUTOCONF_VERSION= 2.61
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib"
CONFIGURE_ENV= CPPFLAGS=-I${LOCALBASE}/include \
LDFLAGS=-L${LOCALBASE}/lib
CFLAGS+= -ftrampolines
WRKDIST= ${WRKDIR}/ncmpc
pre-configure:
cd ${WRKSRC} && env AUTOCONF_VERSION=${AUTOCONF_VERSION} \
AUTOMAKE_VERSION=${AUTOMAKE_VERSION} ./autogen.sh
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/ncmpc
mv ${PREFIX}/share/doc/ncmpc/{config.sample,keys.sample,ncmpc.lirc} \
${PREFIX}/share/examples/ncmpc/
.include <bsd.port.mk>

View File

@ -1,5 +1,5 @@
MD5 (ncmpc-20070917.tar.gz) = OqGlggazd/isBhJYbw/oBg==
RMD160 (ncmpc-20070917.tar.gz) = wIIALvJO/u0mkGUzj+YuhRySxoQ=
SHA1 (ncmpc-20070917.tar.gz) = GhgwMJZ4bsQEsb7Cu3jc0xQ+8Pg=
SHA256 (ncmpc-20070917.tar.gz) = kM/BD6vSt/KT64PQ2HEw8RGkgMG0nrxzcrl0w7lHzaA=
SIZE (ncmpc-20070917.tar.gz) = 247962
MD5 (ncmpc-0.16.1.tar.gz) = NahCXVZwjIYx5Hcabsu5Wg==
RMD160 (ncmpc-0.16.1.tar.gz) = KuRO+r/4JkXhv9tgDiEzWK420Ug=
SHA1 (ncmpc-0.16.1.tar.gz) = 58cxX+ZUH8LYzoJ+5arZF6RZfvo=
SHA256 (ncmpc-0.16.1.tar.gz) = H4lLoXsPq22q5B4wGI+x8yrABZ7Yj/9uRxGr8nstrl8=
SIZE (ncmpc-0.16.1.tar.gz) = 326156

View File

@ -1,11 +0,0 @@
$OpenBSD: patch-doc_Makefile_am,v 1.1 2007/09/19 19:15:12 jasper Exp $
--- doc/Makefile.am.orig Wed Sep 19 19:34:17 2007
+++ doc/Makefile.am Wed Sep 19 19:34:30 2007
@@ -3,6 +3,6 @@
#
man_MANS = ncmpc.1
-docdir = $(prefix)/share/doc/$(PACKAGE)
+docdir = $(prefix)/share/examples/$(PACKAGE)
doc_DATA = config.sample keys.sample ncmpc.lirc
EXTRA_DIST = $(man_MANS) $(doc_DATA)

View File

@ -0,0 +1,23 @@
$OpenBSD: patch-src_colors_c,v 1.1 2010/04/05 19:05:11 landry Exp $
"Fix" screen corruption in ncmpc. Colors and attributes can not be mixed.
Colors are in the low 8 bit, mask them in the appropriate places.
--- src/colors.c.orig Sat Mar 20 11:00:32 2010
+++ src/colors.c Sat Mar 20 11:02:03 2010
@@ -86,7 +86,7 @@ colors_update_pair(enum color id)
assert(id > 0 && id < COLOR_END);
- fg = colors[id].color;
+ fg = colors[id].color & 0xff;
bg = colors[COLOR_BACKGROUND].color;
/* If color == COLOR_NONE (negative),
@@ -273,7 +273,7 @@ colors_use(WINDOW *w, enum color id)
if (options.enable_colors) {
/* color mode */
if ((int)attrs != entry->color || (short)id != pair)
- wattr_set(w, entry->color, id, NULL);
+ wattr_set(w, entry->color & ~0xff, id, NULL);
} else {
#endif
/* mono mode */

View File

@ -1,13 +0,0 @@
$OpenBSD: patch-src_libmpdclient_c,v 1.1 2007/10/31 06:34:55 jasper Exp $
--- src/libmpdclient.c.orig Wed Sep 19 18:27:39 2007
+++ src/libmpdclient.c Thu Oct 25 13:04:31 2007
@@ -197,6 +197,9 @@ mpd_Connection * mpd_newConnection(const char * host,
connection->sock = 0;
continue;
}
+
+ /* success! */
+ break;
}
}

View File

@ -1,33 +0,0 @@
$OpenBSD: patch-src_main_c,v 1.1 2008/07/21 07:53:03 bernd Exp $
--- src/main.c.orig Wed Sep 19 19:27:39 2007
+++ src/main.c Sat Jul 12 10:45:07 2008
@@ -153,6 +153,13 @@ sigstop(void)
kill(0, SIGSTOP); /* issue SIGSTOP */
}
+void
+catch_sigwinch(int x)
+{
+ (void)x;
+ screen_resize();
+}
+
#ifdef DEBUG
void
D(char *format, ...)
@@ -237,6 +244,15 @@ main(int argc, const char *argv[])
if( sigaction(SIGCONT, &act, NULL)<0 )
{
perror("sigaction(SIGCONT)");
+ exit(EXIT_FAILURE);
+ }
+
+ sigemptyset(&act.sa_mask);
+ act.sa_flags = 0;
+ act.sa_handler = catch_sigwinch;
+ if( sigaction(SIGWINCH, &act, NULL)<0 )
+ {
+ perror("sigaction(SIGWINCH)");
exit(EXIT_FAILURE);
}

View File

@ -1,28 +0,0 @@
$OpenBSD: patch-src_mpdclient_c,v 1.2 2007/09/19 19:15:13 jasper Exp $
--- src/mpdclient.c.orig Wed Sep 19 19:27:39 2007
+++ src/mpdclient.c Wed Sep 19 19:37:41 2007
@@ -848,10 +848,9 @@ mpdclient_filelist_get(mpdclient_t *c, gchar *path)
{
mpdclient_filelist_t *filelist;
mpd_InfoEntity *entity;
- gchar *path_utf8 = locale_to_utf8(path);
- D("mpdclient_filelist_get(%s)\n", path);
- mpd_sendLsInfoCommand(c->connection, path_utf8);
+ D("mpdclient_filelist_get(%s)\n", utf8_to_locale(path));
+ mpd_sendLsInfoCommand(c->connection, path);
filelist = g_malloc0(sizeof(mpdclient_filelist_t));
if( path && path[0] && strcmp(path, "/") )
{
@@ -873,11 +872,9 @@ mpdclient_filelist_get(mpdclient_t *c, gchar *path)
if( mpdclient_finish_command(c) )
{
- g_free(path_utf8);
return mpdclient_filelist_free(filelist);
}
- g_free(path_utf8);
filelist->path = g_strdup(path);
filelist->updated = TRUE;

View File

@ -1,37 +1,25 @@
$OpenBSD: patch-src_screen_c,v 1.1 2008/07/21 07:53:03 bernd Exp $
--- src/screen.c.orig Wed Sep 19 19:27:39 2007
+++ src/screen.c Sat Jul 12 10:53:09 2008
@@ -23,6 +23,7 @@
#include <stdarg.h>
$OpenBSD: patch-src_screen_c,v 1.2 2010/04/05 19:05:11 landry Exp $
--- src/screen.c.orig Sun Jan 17 16:54:56 2010
+++ src/screen.c Sun Mar 21 08:36:06 2010
@@ -47,6 +47,7 @@
#include <string.h>
#include <time.h>
+#include <termios.h>
#include <locale.h>
#include <glib.h>
#include <ncurses.h>
@@ -449,13 +450,22 @@ void
screen_resize(void)
+#include <termios.h>
#ifndef NCMPC_MINI
/** welcome message time [s] */
@@ -200,6 +201,13 @@ screen_exit(void)
void
screen_resize(struct mpdclient *c)
{
gint i;
+ struct winsize ws;
+ if (ioctl(fileno(stdout), TIOCGWINSZ, &ws) == 0) {
+ LINES = ws.ws_row;
+ COLS = ws.ws_col;
+ }
+ struct winsize ws;
+
D("Resize rows %d->%d, cols %d->%d\n",screen->rows,LINES,screen->cols,COLS);
if( COLS<SCREEN_MIN_COLS || LINES<SCREEN_MIN_ROWS )
{
- screen_exit();
- fprintf(stderr, _("Error: Screen to small!\n"));
- exit(EXIT_FAILURE);
+ /*
+ * Do not resize under a certain minimum, because that will fuck up the
+ * playlist amongst other things
+ */
+ LINES = SCREEN_MIN_ROWS;
+ COLS = SCREEN_MIN_COLS;
}
resizeterm(LINES, COLS);
+ if (ioctl(fileno(stdout), TIOCGWINSZ, &ws) == 0) {
+ LINES = ws.ws_row;
+ COLS = ws.ws_col;
+ }
+
if (COLS<SCREEN_MIN_COLS || LINES<SCREEN_MIN_ROWS) {
screen_exit();
fprintf(stderr, "%s", _("Error: Screen too small"));

View File

@ -1,21 +0,0 @@
$OpenBSD: patch-src_screen_file_c,v 1.2 2007/09/19 19:15:13 jasper Exp $
--- src/screen_file.c.orig Wed Sep 19 19:27:39 2007
+++ src/screen_file.c Wed Sep 19 19:37:41 2007
@@ -230,7 +230,7 @@ change_directory(screen_t *screen, mpdclient_t *c, fil
{
/* enter sub */
mpd_Directory *dir = entity->info.directory;
- path = utf8_to_locale(dir->path);
+ path = g_strdup(dir->path);
/* save current list window state */
list_window_push_state(lw_state,lw);
}
@@ -549,7 +549,7 @@ browse_close(void)
static char *
browse_title(char *str, size_t size)
{
- g_snprintf(str, size, _("Browse: %s"), basename(filelist->path));
+ g_snprintf(str, size, _("Browse: %s"), utf8_to_locale(basename(filelist->path)));
return str;
}

View File

@ -1,30 +0,0 @@
$OpenBSD: patch-src_support_c,v 1.2 2007/09/19 19:15:13 jasper Exp $
--- src/support.c.orig Wed Sep 19 19:27:39 2007
+++ src/support.c Wed Sep 19 19:37:42 2007
@@ -168,6 +168,7 @@ utf8_to_locale(char *utf8str)
gchar *str;
gsize rb, wb;
GError *error;
+ const char *charset;
if( noconvert )
return g_strdup(utf8str);
@@ -175,15 +176,11 @@ utf8_to_locale(char *utf8str)
rb = 0; /* bytes read */
wb = 0; /* bytes written */
error = NULL;
- str=g_locale_from_utf8(utf8str,
- strlen(utf8str),
- &wb, &rb,
- &error);
+ g_get_charset(&charset);
+ str = g_convert_with_fallback(
+ utf8str, -1, charset, "UTF-8", "?", &rb, &wb, &error);
if( error )
{
- const char *charset;
-
- g_get_charset(&charset);
screen_status_printf(_("Error: Unable to convert characters to %s"),
charset);
D("utf8_to_locale(): %s\n", error->message);

View File

@ -1,5 +1,5 @@
@comment $OpenBSD: PLIST,v 1.2 2007/09/19 19:15:13 jasper Exp $
bin/ncmpc
@comment $OpenBSD: PLIST,v 1.3 2010/04/05 19:05:11 landry Exp $
@bin bin/ncmpc
@man man/man1/ncmpc.1
share/doc/ncmpc/
share/doc/ncmpc/AUTHORS
@ -9,12 +9,20 @@ share/examples/ncmpc/
share/examples/ncmpc/config.sample
share/examples/ncmpc/keys.sample
share/examples/ncmpc/ncmpc.lirc
share/locale/cs/LC_MESSAGES/ncmpc.mo
share/locale/da/LC_MESSAGES/ncmpc.mo
share/locale/de/LC_MESSAGES/ncmpc.mo
share/locale/eo/LC_MESSAGES/ncmpc.mo
share/locale/es/LC_MESSAGES/ncmpc.mo
share/locale/fr/LC_MESSAGES/ncmpc.mo
share/locale/gl/LC_MESSAGES/ncmpc.mo
share/locale/no/LC_MESSAGES/ncmpc.mo
share/locale/he/LC_MESSAGES/ncmpc.mo
share/locale/hu/LC_MESSAGES/ncmpc.mo
share/locale/ko/LC_MESSAGES/ncmpc.mo
share/locale/nb/LC_MESSAGES/ncmpc.mo
share/locale/nl/LC_MESSAGES/ncmpc.mo
share/locale/ru/LC_MESSAGES/ncmpc.mo
share/locale/sk/LC_MESSAGES/ncmpc.mo
share/locale/sv/LC_MESSAGES/ncmpc.mo
@comment share/ncmpc/
share/locale/uk/LC_MESSAGES/ncmpc.mo
share/locale/zh_CN/LC_MESSAGES/ncmpc.mo