- Fix crash (use new GLib threads) [1]

- Unbreak build with Vala 0.26 (there are lot of warnings, because Xfmpc still
uses Gtk2 code, deprecated since Vala 0.17.5)
- Bump PORTREVISION

PR:		195629 [1]
Submitted by:	Akhmichin Andrey
This commit is contained in:
Olivier Duchateau 2015-01-10 16:31:39 +00:00
parent b0633395f7
commit bcd2a6a363
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=376716
6 changed files with 151 additions and 1 deletions

View file

@ -3,7 +3,7 @@
PORTNAME= xfmpc
PORTVERSION= 0.2.2
PORTREVISION= 4
PORTREVISION= 5
CATEGORIES= audio xfce
MASTER_SITES= ${MASTER_SITE_XFCE}
MASTER_SITE_SUBDIR=/src/apps/${PORTNAME}/${PORTVERSION:R}
@ -12,6 +12,7 @@ DIST_SUBDIR= xfce4
MAINTAINER= xfce@FreeBSD.org
COMMENT= Graphical MPD client focusing on low footprint
BUILD_DEPENDS= valac:${PORTSDIR}/lang/vala
LIB_DEPENDS= libmpd.so:${PORTSDIR}/audio/libmpd
INSTALLS_ICONS= yes
@ -20,4 +21,11 @@ GNU_CONFIGURE= yes
USE_GNOME= gtk20 intltool intlhack
USE_XFCE= configenv libmenu libutil
post-extract:
${CP} ${FILESDIR}/config.vapi ${WRKSRC}/src
post-patch:
${FIND} ${WRKSRC} -type f -name 'Makefile.in' | \
${XARGS} ${REINPLACE_CMD} 's|@VALAC@|${LOCALBASE}/bin/valac|'
.include <bsd.port.mk>

View file

@ -0,0 +1,32 @@
/*
* Copyright (c) 2009-2010 Mike Massonnet <mmassonnet@xfce.org>
* Copyright (c) 2009-2010 Vincent Legout <vincent@xfce.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
[CCode (cprefix="", lower_case_prefix="", cheader_filename="config.h")]
namespace Config {
[CCode (cname = "GETTEXT_PACKAGE")]
public const string GETTEXT_PACKAGE;
[CCode (cname = "PACKAGE_LOCALE_DIR")]
public const string PACKAGE_LOCALE_DIR;
[CCode (cname = "PACKAGE_VERSION")]
public const string PACKAGE_VERSION;
[CCode (cname = "PACKAGE_STRING")]
public const string PACKAGE_STRING;
[CCode (cname = "PACKAGE_NAME")]
public const string PACKAGE_NAME;
}

View file

@ -0,0 +1,13 @@
Fix ambiguity between GLib.Menu and Gtk.Menu (bug #8922)
--- src/extended-interface.vala.orig 2011-10-23 13:55:52 UTC
+++ src/extended-interface.vala
@@ -197,7 +197,7 @@ namespace Xfmpc {
this.context_menu.show_all ();
}
- private void menu_detach (Widget attach_widget, Menu menu) {
+ private void menu_detach (Gtk.Widget attach_widget, Gtk.Menu menu) {
}
/*

View file

@ -0,0 +1,16 @@
main-window.vala:135.4-135.10: error: `Timeout' is an ambiguous reference
between `GLib.Timeout' and `Gtk.Timeout'
Timeout.add (1000, refresh);
^^^^^^^
--- src/main-window.vala.orig 2011-10-23 15:08:38 UTC
+++ src/main-window.vala
@@ -132,7 +132,7 @@ namespace Xfmpc {
this.preferences.notify["show-statusbar"].connect (cb_show_statusbar_changed);
/* === Timeout === */
- Timeout.add (1000, refresh);
+ GLib.Timeout.add (1000, refresh);
}
private void show_hide_status_icon () {

View file

@ -0,0 +1,68 @@
--- src/mpdclient.c.orig 2011-02-01 18:13:51 UTC
+++ src/mpdclient.c
@@ -106,7 +106,7 @@ struct _XfmpcMpdclientPrivate
gboolean env_cached;
gboolean connecting;
guint connection_count;
- GMutex *mutex;
+ GMutex mutex;
};
@@ -275,8 +275,7 @@ xfmpc_mpdclient_init (XfmpcMpdclient *mp
priv->mi = mpd_new_default ();
- if (!g_thread_supported ()) g_thread_init (NULL);
- priv->mutex = g_mutex_new ();
+ g_mutex_init (&priv->mutex);
mpd_signal_connect_status_changed (priv->mi, (StatusChangedCallback)cb_status_changed, mpdclient);
}
@@ -288,7 +287,7 @@ xfmpc_mpdclient_finalize (GObject *objec
XfmpcMpdclientPrivate *priv = XFMPC_MPDCLIENT (mpdclient)->priv;
mpd_free (priv->mi);
- g_mutex_free (priv->mutex);
+ g_mutex_clear (&priv->mutex);
(*G_OBJECT_CLASS (parent_class)->finalize) (object);
}
@@ -389,8 +388,6 @@ xfmpc_mpdclient_connect_thread (XfmpcMpd
priv->connecting = FALSE;
- g_mutex_unlock (priv->mutex);
-
return NULL;
}
@@ -405,7 +402,7 @@ xfmpc_mpdclient_connect (XfmpcMpdclient
return TRUE;
/* return FALSE if a we are already trying to connect to mpd */
- if (!g_mutex_trylock (priv->mutex))
+ if (!g_mutex_trylock (&priv->mutex))
{
g_warning ("Already connecting to mpd");
return FALSE;
@@ -413,8 +410,8 @@ xfmpc_mpdclient_connect (XfmpcMpdclient
priv->connecting = TRUE;
- thread = g_thread_create ((GThreadFunc) xfmpc_mpdclient_connect_thread,
- mpdclient, TRUE, NULL);
+ thread = g_thread_new ("0", (GThreadFunc) xfmpc_mpdclient_connect_thread,
+ mpdclient);
while (priv->connecting)
{
@@ -427,6 +424,8 @@ xfmpc_mpdclient_connect (XfmpcMpdclient
g_signal_emit (mpdclient, signals[SIG_CONNECTED], 0);
+ g_mutex_unlock (&priv->mutex);
+
return TRUE;
}

View file

@ -0,0 +1,13 @@
Fix ambiguity between GLib.Menu and Gtk.Menu (bug #8922)
--- src/playlist.vala.orig 2011-10-23 15:02:51 UTC
+++ src/playlist.vala
@@ -98,7 +98,7 @@ namespace Xfmpc {
new Gtk.Adjustment (0, 0, 0, 0, 0, 0));
scrolled.set_policy (Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.ALWAYS);
- this.menu = new Menu ();
+ this.menu = new Gtk.Menu ();
var mi = new Gtk.ImageMenuItem.from_stock (Gtk.Stock.REMOVE, null);
this.menu.append (mi);