diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 13:49:04 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 17:38:18 -0700 |
commit | 56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch) | |
tree | 3f91093cdb475e565ae857f1c5a7fd339e2d781e /media-plugins/gkrellmpc | |
download | gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2 gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip |
proj/gentoo: Initial commit
This commit represents a new era for Gentoo:
Storing the gentoo-x86 tree in Git, as converted from CVS.
This commit is the start of the NEW history.
Any historical data is intended to be grafted onto this point.
Creation process:
1. Take final CVS checkout snapshot
2. Remove ALL ChangeLog* files
3. Transform all Manifests to thin
4. Remove empty Manifests
5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$
5.1. Do not touch files with -kb/-ko keyword flags.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests
X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project
X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration
X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn
X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts
X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration
X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging
X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'media-plugins/gkrellmpc')
-rw-r--r-- | media-plugins/gkrellmpc/Manifest | 2 | ||||
-rw-r--r-- | media-plugins/gkrellmpc/files/gkrellmpc-0.1_beta10-mt.patch | 154 | ||||
-rw-r--r-- | media-plugins/gkrellmpc/files/gkrellmpc-0.1_beta9-mt.patch | 152 | ||||
-rw-r--r-- | media-plugins/gkrellmpc/gkrellmpc-0.1_beta10.ebuild | 39 | ||||
-rw-r--r-- | media-plugins/gkrellmpc/gkrellmpc-0.1_beta9-r1.ebuild | 39 | ||||
-rw-r--r-- | media-plugins/gkrellmpc/metadata.xml | 9 |
6 files changed, 395 insertions, 0 deletions
diff --git a/media-plugins/gkrellmpc/Manifest b/media-plugins/gkrellmpc/Manifest new file mode 100644 index 000000000000..10a5af8ba5cf --- /dev/null +++ b/media-plugins/gkrellmpc/Manifest @@ -0,0 +1,2 @@ +DIST gkrellmpc-0.1_beta10.tar.gz 25388 SHA256 320c04cce9530d12e4cc20d58710c29a25154e3450f3e3cdee2aa3c9433312b6 SHA512 f5d687264f08146bf1eb54aee6d42a200fb97008a355d26a68be91b04e4bd622fc222725bf498c0837eacb8b94d6aede5aa1a05ed504fe5f9b790a9cd08d3973 WHIRLPOOL 4e4fc8772fb6c8a1caf405e6d045c973b37b7d03df2ded65c611268883f98a963de84a1f51cbc382dad9e39c3e0e8ba3607a5990559869817289e22b69a90f00 +DIST gkrellmpc-0.1_beta9.tar.gz 22029 SHA256 b4fed5b55afdeefe978d1ab7f82a0e2f79b15ea2158110775cf6e05616ded9e2 diff --git a/media-plugins/gkrellmpc/files/gkrellmpc-0.1_beta10-mt.patch b/media-plugins/gkrellmpc/files/gkrellmpc-0.1_beta10-mt.patch new file mode 100644 index 000000000000..42a5848a44cb --- /dev/null +++ b/media-plugins/gkrellmpc/files/gkrellmpc-0.1_beta10-mt.patch @@ -0,0 +1,154 @@ +diff --git a/gkrellmpc.c b/gkrellmpc.c +index eb28982..08a3fb3 100644 +--- a/gkrellmpc.c ++++ b/gkrellmpc.c +@@ -140,7 +140,7 @@ void mpc_create_plugin (GtkWidget *vbox, gint first_create) { + /* Create the status decal */ + mpc_status_decal = gkrellm_create_decal_pixmap(mpc_panel, gkrellm_decal_misc_pixmap(), gkrellm_decal_misc_mask(), N_MISC_DECALS, style, 0, t); + mpc_status_decal->x = w - mpc_status_decal->w; +- gkrellm_draw_decal_pixmap(mpc_panel, mpc_status_decal, (mpc_mpd ? D_MISC_LED1 : D_MISC_LED0)); ++ gkrellm_draw_decal_pixmap(mpc_panel, mpc_status_decal, (mpc_mpd_connected() ? D_MISC_LED1 : D_MISC_LED0)); + + /* Update t */ + t += mpc_label_decal->h > mpc_status_decal->h ? mpc_label_decal->h : mpc_status_decal->h; +@@ -279,7 +279,7 @@ void mpc_update_plugin () { + static gint x_scroll; + + /* Try to connect to mpd */ +- if (!mpc_mpd && mpc_ticker->ten_second_tick) { ++ if (!mpc_mpd_connected() && mpc_ticker->ten_second_tick) { + mpc_mpd_connect(); + } + +@@ -457,7 +457,7 @@ void mpc_sync_with_mpd() { + status = mpc_mpd_get("status\n"); + currentsong = mpc_mpd_get("currentsong\n"); + +- if (!mpc_mpd) { ++ if (!mpc_mpd_connected()) { + mpc_update_label(_("NO MPD")); + mpc_update_songname(""); + gtk_tooltips_set_tip(mpc_tooltip, mpc_panel->drawing_area, _("MPD is not running"), NULL); +diff --git a/mpd.c b/mpd.c +index 5918416..1d9ea6a 100644 +--- a/mpd.c ++++ b/mpd.c +@@ -12,18 +12,32 @@ + #include <sys/socket.h> + #include <netdb.h> + ++#include <errno.h> ++#include <pthread.h> ++ + GIOChannel * mpc_mpd = NULL; ++pthread_mutex_t mpc_mutex = { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, { 0 } } }; //PTHREAD_MUTEX_INITIALIZER; ++ ++gboolean mpc_mpd_connected() { ++ if(pthread_mutex_trylock(&mpc_mutex)){ ++ return (FALSE); ++ } ++ pthread_mutex_unlock(&mpc_mutex); ++ return (gboolean)mpc_mpd; ++} + + /* + * Connects to the MPD server, sets up the mpd object, sets the status decal to ON + */ +-gboolean mpc_mpd_connect() { ++void* mpc_mpd_connect_worker(void* arg) { + int sockfd; + struct hostent *server; + struct sockaddr_in serv_addr; + gchar * line; + gchar ** parts; + gboolean retval; ++ ++ pthread_mutex_lock(&mpc_mutex); + + if (mpc_mpd) { + /* +@@ -33,11 +47,11 @@ gboolean mpc_mpd_connect() { + } + + if (!mpc_conf_hostname || !mpc_conf_port) { +- return (FALSE); ++ goto err; + } + +- if ((sockfd = socket(PF_INET, SOCK_STREAM, 0)) == -1) return(FALSE); +- if (!(server = gethostbyname(mpc_conf_hostname))) return(FALSE); ++ if ((sockfd = socket(PF_INET, SOCK_STREAM, 0)) == -1) goto err; ++ if (!(server = gethostbyname(mpc_conf_hostname))) goto err; + + bzero((char *) &serv_addr, sizeof(serv_addr)); + serv_addr.sin_family = AF_INET; +@@ -46,7 +60,7 @@ gboolean mpc_mpd_connect() { + server->h_length); + serv_addr.sin_port = htons(mpc_conf_port); + +- if (connect(sockfd, (struct sockaddr*)&serv_addr, sizeof(serv_addr)) < 0) return(FALSE); ++ if (connect(sockfd, (struct sockaddr*)&serv_addr, sizeof(serv_addr)) < 0) goto err; + + /* Getup the mpd object */ + mpc_mpd = g_io_channel_unix_new(sockfd); +@@ -72,29 +86,39 @@ gboolean mpc_mpd_connect() { + retval = FALSE; + } + +- if (retval) { +- gkrellm_draw_decal_pixmap(mpc_panel, mpc_status_decal, D_MISC_LED1); +- mpc_update_label(_("MPD")); +- mpc_update_songname(""); +- } ++err: ++ pthread_mutex_unlock(&mpc_mutex); ++ return NULL; ++} + +- return(retval); ++gboolean mpc_mpd_connect() { ++ pthread_attr_t attr; ++ pthread_t thread_id; ++ ++ if(pthread_mutex_trylock(&mpc_mutex)){ ++ return (FALSE); ++ } ++ ++ pthread_attr_init(&attr); ++ pthread_create(&thread_id, &attr, mpc_mpd_connect_worker, NULL); ++ ++ pthread_mutex_unlock(&mpc_mutex); ++ ++ return (FALSE); + } + + /* + * Disconnects from MPD, destroys the mpd object, sets the status decal to off + */ + gboolean mpc_mpd_disconnect() { +- ++ pthread_mutex_lock(&mpc_mutex); + if (mpc_mpd) { + g_io_channel_shutdown(mpc_mpd, FALSE, NULL); + free(mpc_mpd); + mpc_mpd = NULL; + } + +- gkrellm_draw_decal_pixmap(mpc_panel, mpc_status_decal, D_MISC_LED0); +- mpc_update_label(_("NO MPD")); +- mpc_update_songname(""); ++ pthread_mutex_lock(&mpc_mutex); + return (TRUE); + } + +diff --git a/mpd.h b/mpd.h +index efcb9f6..c6942c4 100644 +--- a/mpd.h ++++ b/mpd.h +@@ -10,5 +10,6 @@ gboolean mpc_mpd_disconnect(); + gboolean mpc_mpd_do(gchar *); + GHashTable * mpc_mpd_get(gchar *); + GPtrArray * mpc_mpd_get_clumps(gchar *, gboolean); ++gboolean mpc_mpd_connected(); + + #endif diff --git a/media-plugins/gkrellmpc/files/gkrellmpc-0.1_beta9-mt.patch b/media-plugins/gkrellmpc/files/gkrellmpc-0.1_beta9-mt.patch new file mode 100644 index 000000000000..4de5688a2b5e --- /dev/null +++ b/media-plugins/gkrellmpc/files/gkrellmpc-0.1_beta9-mt.patch @@ -0,0 +1,152 @@ +diff -uNr gkrellmpc-0.1_beta9/gkrellmpc.c gkrellmpc-0.1_beta9.mine/gkrellmpc.c +--- gkrellmpc-0.1_beta9/gkrellmpc.c 2005-01-05 22:33:16.000000000 +0300 ++++ gkrellmpc-0.1_beta9.mine/gkrellmpc.c 2009-04-05 19:51:12.000000000 +0400 +@@ -132,7 +132,7 @@ + /* Create the status decal */ + mpc_status_decal = gkrellm_create_decal_pixmap(mpc_panel, gkrellm_decal_misc_pixmap(), gkrellm_decal_misc_mask(), N_MISC_DECALS, style, 0, t); + mpc_status_decal->x = w - mpc_status_decal->w; +- gkrellm_draw_decal_pixmap(mpc_panel, mpc_status_decal, (mpc_mpd ? D_MISC_LED1 : D_MISC_LED0)); ++ gkrellm_draw_decal_pixmap(mpc_panel, mpc_status_decal, (mpc_mpd_connected() ? D_MISC_LED1 : D_MISC_LED0)); + + /* Update t */ + t += mpc_label_decal->h > mpc_status_decal->h ? mpc_label_decal->h : mpc_status_decal->h; +@@ -254,7 +254,7 @@ + static gint x_scroll; + + /* Try to connect to mpd */ +- if (!mpc_mpd && mpc_ticker->ten_second_tick) { ++ if (!mpc_mpd_connected() && mpc_ticker->ten_second_tick) { + mpc_mpd_connect(); + } + +@@ -428,7 +428,7 @@ + status = mpc_mpd_get("status\n"); + currentsong = mpc_mpd_get("currentsong\n"); + +- if (!mpc_mpd) { ++ if (!mpc_mpd_connected()) { + mpc_update_label("NO MPD"); + mpc_update_songname(""); + } +diff -uNr gkrellmpc-0.1_beta9/mpd.c gkrellmpc-0.1_beta9.mine/mpd.c +--- gkrellmpc-0.1_beta9/mpd.c 2005-01-05 22:33:16.000000000 +0300 ++++ gkrellmpc-0.1_beta9.mine/mpd.c 2009-04-05 20:30:38.000000000 +0400 +@@ -12,18 +12,32 @@ + #include <sys/socket.h> + #include <netdb.h> + ++#include <errno.h> ++#include <pthread.h> ++ + GIOChannel * mpc_mpd = NULL; ++pthread_mutex_t mpc_mutex = { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, { 0 } } }; //PTHREAD_MUTEX_INITIALIZER; ++ ++gboolean mpc_mpd_connected() { ++ if(pthread_mutex_trylock(&mpc_mutex)){ ++ return (FALSE); ++ } ++ pthread_mutex_unlock(&mpc_mutex); ++ return (gboolean)mpc_mpd; ++} + + /* + * Connects to the MPD server, sets up the mpd object, sets the status decal to ON + */ +-gboolean mpc_mpd_connect() { ++void* mpc_mpd_connect_worker(void* arg) { + int sockfd; + struct hostent *server; + struct sockaddr_in serv_addr; + gchar * line; + gchar ** parts; + gboolean retval; ++ ++ pthread_mutex_lock(&mpc_mutex); + + if (mpc_mpd) { + /* +@@ -33,11 +47,11 @@ + } + + if (!mpc_conf_hostname || !mpc_conf_port) { +- return (FALSE); ++ goto err; + } + +- if ((sockfd = socket(PF_INET, SOCK_STREAM, 0)) == -1) return(FALSE); +- if (!(server = gethostbyname(mpc_conf_hostname))) return(FALSE); ++ if ((sockfd = socket(PF_INET, SOCK_STREAM, 0)) == -1) goto err; ++ if (!(server = gethostbyname(mpc_conf_hostname))) goto err; + + bzero((char *) &serv_addr, sizeof(serv_addr)); + serv_addr.sin_family = AF_INET; +@@ -46,7 +60,7 @@ + server->h_length); + serv_addr.sin_port = htons(mpc_conf_port); + +- if (connect(sockfd, (struct sockaddr*)&serv_addr, sizeof(serv_addr)) < 0) return(FALSE); ++ if (connect(sockfd, (struct sockaddr*)&serv_addr, sizeof(serv_addr)) < 0) goto err; + + /* Getup the mpd object */ + mpc_mpd = g_io_channel_unix_new(sockfd); +@@ -72,29 +86,40 @@ + retval = FALSE; + } + +- if (retval) { +- gkrellm_draw_decal_pixmap(mpc_panel, mpc_status_decal, D_MISC_LED1); +- mpc_update_label("MPD"); +- mpc_update_songname(""); +- } + +- return(retval); ++err: ++ pthread_mutex_unlock(&mpc_mutex); ++ return NULL; ++} ++ ++gboolean mpc_mpd_connect() { ++ pthread_attr_t attr; ++ pthread_t thread_id; ++ ++ if(pthread_mutex_trylock(&mpc_mutex)){ ++ return (FALSE); ++ } ++ ++ pthread_attr_init(&attr); ++ pthread_create(&thread_id, &attr, mpc_mpd_connect_worker, NULL); ++ ++ pthread_mutex_unlock(&mpc_mutex); ++ ++ return (FALSE); + } + + /* + * Disconnects from MPD, destroys the mpd object, sets the status decal to off + */ + gboolean mpc_mpd_disconnect() { +- ++ pthread_mutex_lock(&mpc_mutex); + if (mpc_mpd) { + g_io_channel_shutdown(mpc_mpd, FALSE, NULL); + free(mpc_mpd); + mpc_mpd = NULL; + } + +- gkrellm_draw_decal_pixmap(mpc_panel, mpc_status_decal, D_MISC_LED0); +- mpc_update_label("NO MPD"); +- mpc_update_songname(""); ++ pthread_mutex_unlock(&mpc_mutex); + return (TRUE); + } + +diff -uNr gkrellmpc-0.1_beta9/mpd.h gkrellmpc-0.1_beta9.mine/mpd.h +--- gkrellmpc-0.1_beta9/mpd.h 2005-01-05 22:33:16.000000000 +0300 ++++ gkrellmpc-0.1_beta9.mine/mpd.h 2009-04-05 19:51:25.000000000 +0400 +@@ -10,5 +10,6 @@ + gboolean mpc_mpd_do(gchar *); + GHashTable * mpc_mpd_get(gchar *); + GPtrArray * mpc_mpd_get_clumps(gchar *, gboolean); ++gboolean mpc_mpd_connected(); + + #endif diff --git a/media-plugins/gkrellmpc/gkrellmpc-0.1_beta10.ebuild b/media-plugins/gkrellmpc/gkrellmpc-0.1_beta10.ebuild new file mode 100644 index 000000000000..eec07ca39b31 --- /dev/null +++ b/media-plugins/gkrellmpc/gkrellmpc-0.1_beta10.ebuild @@ -0,0 +1,39 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=2 +inherit eutils gkrellm-plugin toolchain-funcs + +DESCRIPTION="A gkrellm plugin to control the MPD (Music Player Daemon)" +HOMEPAGE="http://mpd.wikia.com/wiki/Client:GKrellMPC" +SRC_URI="http://mina.naguib.ca/dist/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="threads" + +RDEPEND=">=app-admin/gkrellm-2[X] + net-misc/curl" +DEPEND="${RDEPEND}" + +# Will open gkrellm in X11 display +RESTRICT="test" + +src_prepare() { + sed -i -e 's:gkrellm2 -p:gkrellm -p:' Makefile || die + use threads && epatch "${FILESDIR}"/${P}-mt.patch +} + +src_compile() { + tc-export CC + emake || die +} + +pkg_postinst() { + if use threads; then + elog "If you can't connect MPD, please unset USE threads." + elog "See, http://bugs.gentoo.org/276970 for information." + fi +} diff --git a/media-plugins/gkrellmpc/gkrellmpc-0.1_beta9-r1.ebuild b/media-plugins/gkrellmpc/gkrellmpc-0.1_beta9-r1.ebuild new file mode 100644 index 000000000000..36f30dd96815 --- /dev/null +++ b/media-plugins/gkrellmpc/gkrellmpc-0.1_beta9-r1.ebuild @@ -0,0 +1,39 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=2 +inherit eutils gkrellm-plugin toolchain-funcs + +DESCRIPTION="A gkrellm plugin to control the MPD (Music Player Daemon)" +HOMEPAGE="http://mpd.wikicities.com/wiki/Client:GKrellMPC" +SRC_URI="http://www.topfx.com/dist/${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 x86" +IUSE="threads" + +RDEPEND=">=app-admin/gkrellm-2[X] + net-misc/curl" +DEPEND="${RDEPEND}" + +# Will open gkrellm in X11 display +RESTRICT="test" + +src_prepare() { + sed -i -e 's:gkrellm2 -p:gkrellm -p:' Makefile || die + use threads && epatch "${FILESDIR}"/${P}-mt.patch +} + +src_compile() { + tc-export CC + emake || die +} + +pkg_postinst() { + if use threads; then + elog "If you can't connect MPD, please unset USE threads." + elog "See, http://bugs.gentoo.org/276970 for information." + fi +} diff --git a/media-plugins/gkrellmpc/metadata.xml b/media-plugins/gkrellmpc/metadata.xml new file mode 100644 index 000000000000..15505756c200 --- /dev/null +++ b/media-plugins/gkrellmpc/metadata.xml @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>sound</herd> + <herd>desktop-dock</herd> + <use> + <flag name="threads">Use separate thread to init connection (unsafe)</flag> + </use> +</pkgmetadata> |