diff options
author | Daniel Pielmeier <billie@gentoo.org> | 2013-10-24 17:00:02 +0000 |
---|---|---|
committer | Daniel Pielmeier <billie@gentoo.org> | 2013-10-24 17:00:02 +0000 |
commit | 79b92ca6828cd25952a941f5a41398eb83812a71 (patch) | |
tree | 9d84ac152c4c606edadc5c4c0ae66e832f0470de /app-admin/conky | |
parent | Stable for HPPA (bug #488946). (diff) | |
download | gentoo-2-79b92ca6828cd25952a941f5a41398eb83812a71.tar.gz gentoo-2-79b92ca6828cd25952a941f5a41398eb83812a71.tar.bz2 gentoo-2-79b92ca6828cd25952a941f5a41398eb83812a71.zip |
Add patch from Debian to make apcupsd work again. This reverts the apcupsd code in conky back to version 1.8.1. Upstream is currently idle, so this is probably the best solution for the time being. This fixes bug #408893. Thanks to Upendra Ghandi for the report.
(Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key 215AD14D)
Diffstat (limited to 'app-admin/conky')
-rw-r--r-- | app-admin/conky/ChangeLog | 11 | ||||
-rw-r--r-- | app-admin/conky/conky-1.9.0-r3.ebuild | 140 | ||||
-rw-r--r-- | app-admin/conky/files/conky-1.9.0-apcupsd.patch | 106 |
3 files changed, 256 insertions, 1 deletions
diff --git a/app-admin/conky/ChangeLog b/app-admin/conky/ChangeLog index 3e58e5f85b83..6de88ef86cab 100644 --- a/app-admin/conky/ChangeLog +++ b/app-admin/conky/ChangeLog @@ -1,6 +1,15 @@ # ChangeLog for app-admin/conky # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/conky/ChangeLog,v 1.211 2013/09/28 09:35:46 billie Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-admin/conky/ChangeLog,v 1.212 2013/10/24 17:00:02 billie Exp $ + +*conky-1.9.0-r3 (24 Oct 2013) + + 24 Oct 2013; Daniel Pielmeier <billie@gentoo.org> +conky-1.9.0-r3.ebuild, + +files/conky-1.9.0-apcupsd.patch: + Add patch from Debian to make apcupsd work again. This reverts the apcupsd + code in conky back to version 1.8.1. Upstream is currently idle, so this is + probably the best solution for the time being. This fixes bug #408893. Thanks + to Upendra Ghandi for the report. 28 Sep 2013; Daniel Pielmeier <billie@gentoo.org> conky-1.9.0-r2.ebuild: Add epatch_user. This fixes bug #478482. diff --git a/app-admin/conky/conky-1.9.0-r3.ebuild b/app-admin/conky/conky-1.9.0-r3.ebuild new file mode 100644 index 000000000000..1ffe3f0894ff --- /dev/null +++ b/app-admin/conky/conky-1.9.0-r3.ebuild @@ -0,0 +1,140 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/conky/conky-1.9.0-r3.ebuild,v 1.1 2013/10/24 17:00:02 billie Exp $ + +EAPI=5 + +inherit autotools eutils libtool + +DESCRIPTION="An advanced, highly configurable system monitor for X" +HOMEPAGE="http://conky.sourceforge.net/" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2" + +LICENSE="GPL-3 BSD LGPL-2.1 MIT" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~ppc ~ppc64 ~sparc ~x86" +IUSE="apcupsd audacious curl debug eve hddtemp imlib iostats lua lua-cairo lua-imlib math moc mpd nano-syntax ncurses nvidia +portmon rss thinkpad truetype vim-syntax weather-metar weather-xoap wifi X xmms2" + +DEPEND_COMMON=" + X? ( + imlib? ( media-libs/imlib2 ) + lua-cairo? ( + >=dev-lua/toluapp-1.0.93 + >=dev-lang/lua-5.1.4-r8 + x11-libs/cairo[X] ) + lua-imlib? ( + >=dev-lua/toluapp-1.0.93 + >=dev-lang/lua-5.1.4-r8 + media-libs/imlib2 ) + nvidia? ( media-video/nvidia-settings ) + truetype? ( x11-libs/libXft >=media-libs/freetype-2 ) + x11-libs/libX11 + x11-libs/libXdamage + x11-libs/libXext + audacious? ( >=media-sound/audacious-1.5 dev-libs/glib ) + xmms2? ( media-sound/xmms2 ) + ) + curl? ( net-misc/curl ) + eve? ( net-misc/curl dev-libs/libxml2 ) + portmon? ( dev-libs/glib ) + lua? ( >=dev-lang/lua-5.1.4-r8 ) + ncurses? ( sys-libs/ncurses ) + rss? ( dev-libs/libxml2 net-misc/curl dev-libs/glib ) + wifi? ( net-wireless/wireless-tools ) + weather-metar? ( net-misc/curl ) + weather-xoap? ( dev-libs/libxml2 net-misc/curl ) + virtual/libiconv + " +RDEPEND=" + ${DEPEND_COMMON} + apcupsd? ( sys-power/apcupsd ) + hddtemp? ( app-admin/hddtemp ) + moc? ( media-sound/moc ) + nano-syntax? ( app-editors/nano ) + vim-syntax? ( || ( app-editors/vim app-editors/gvim ) ) + " +DEPEND=" + ${DEPEND_COMMON} + virtual/pkgconfig + " + +src_prepare() { + epatch "${FILESDIR}/${PN}-1.8.1-utf8-scroll.patch" \ + "${FILESDIR}/${P}-ncurses.patch" \ + "${FILESDIR}/${P}-lines-fix.patch" \ + "${FILESDIR}/${P}-update-when-message-count-decreases.patch" \ + "${FILESDIR}/${P}-apcupsd.patch" + + # Allow user patches #478482 + # Only run autotools if user patched something + epatch_user && eautoreconf || elibtoolize +} + +src_configure() { + local myconf + + if use X; then + myconf="--enable-x11 --enable-double-buffer --enable-xdamage" + myconf="${myconf} --enable-argb --enable-own-window" + myconf="${myconf} $(use_enable imlib imlib2) $(use_enable lua-cairo)" + myconf="${myconf} $(use_enable lua-imlib lua-imlib2)" + myconf="${myconf} $(use_enable nvidia) $(use_enable truetype xft)" + myconf="${myconf} $(use_enable audacious) $(use_enable xmms2)" + else + myconf="--disable-x11 --disable-own-window --disable-argb" + myconf="${myconf} --disable-lua-cairo --disable-nvidia --disable-xft" + myconf="${myconf} --disable-audacious --disable-xmms2" + fi + + econf \ + ${myconf} \ + $(use_enable apcupsd) \ + $(use_enable curl) \ + $(use_enable debug) \ + $(use_enable eve) \ + $(use_enable hddtemp) \ + $(use_enable iostats) \ + $(use_enable lua) \ + $(use_enable thinkpad ibm) \ + $(use_enable math) \ + $(use_enable moc) \ + $(use_enable mpd) \ + $(use_enable ncurses) \ + $(use_enable portmon) \ + $(use_enable rss) \ + $(use_enable weather-metar) \ + $(use_enable weather-xoap) \ + $(use_enable wifi wlan) +} + +src_install() { + default + + dohtml doc/*.html + + if use vim-syntax; then + insinto /usr/share/vim/vimfiles/ftdetect + doins "${S}"/extras/vim/ftdetect/conkyrc.vim + + insinto /usr/share/vim/vimfiles/syntax + doins "${S}"/extras/vim/syntax/conkyrc.vim + fi + + if use nano-syntax; then + insinto /usr/share/nano/ + doins "${S}"/extras/nano/conky.nanorc + fi +} + +pkg_postinst() { + if [[ -z "${REPLACING_VERSIONS}" ]]; then + elog "You can find sample configurations at ${ROOT%/}/etc/conky." + elog "To customize, copy to ~/.conkyrc and edit it to your liking." + elog + elog "There are pretty html docs available at the conky homepage" + elog "or in ${ROOT%/}/usr/share/doc/${PF}/html." + elog + elog "Also see http://www.gentoo.org/doc/en/conky-howto.xml" + elog + fi +} diff --git a/app-admin/conky/files/conky-1.9.0-apcupsd.patch b/app-admin/conky/files/conky-1.9.0-apcupsd.patch new file mode 100644 index 000000000000..9161fbcc5ebb --- /dev/null +++ b/app-admin/conky/files/conky-1.9.0-apcupsd.patch @@ -0,0 +1,106 @@ +Description: Fix broken apcupsd support in Conky 1.8.1 + Revert apcupsd-related code to Conky 1.8.0 in order to fix broken apcupsd + support. This is a workaround until upstream properly addresses this issue. +From: Brian Derr <bderrly@gmail.com> +Forwarded: http://sourceforge.net/support/tracker.php?aid=3083859 +Bug-Ubuntu: https://bugs.launchpad.net/bugs/897495 +Last-Update: 2011-12-02 + +--- a/src/apcupsd.c ++++ b/src/apcupsd.c +@@ -154,7 +154,7 @@ + // + // Conky update function for apcupsd data + // +-int update_apcupsd(void) { ++void update_apcupsd(void) { + + int i; + APCUPSD_S apc; +@@ -164,41 +164,44 @@ + memcpy(apc.items[i], "N/A", 4); // including \0 + + do { +- struct addrinfo hints; +- struct addrinfo *ai, *rp; +- int res; ++ struct hostent* he = 0; ++ struct sockaddr_in addr; + short sz = 0; +- char portbuf[8]; ++#ifdef HAVE_GETHOSTBYNAME_R ++ struct hostent he_mem; ++ int he_errno; ++ char hostbuff[2048]; ++#endif + // + // connect to apcupsd daemon + // +- memset(&hints, 0, sizeof(struct addrinfo)); +- hints.ai_family = AF_UNSPEC; +- hints.ai_socktype = SOCK_STREAM; +- hints.ai_flags = 0; +- hints.ai_protocol = 0; +- snprintf(portbuf, 8, "%d", info.apcupsd.port); +- res = getaddrinfo(info.apcupsd.host, portbuf, &hints, &ai); +- if (res != 0) { +- NORM_ERR("APCUPSD getaddrinfo: %s", gai_strerror(res)); ++ sock = socket(AF_INET, SOCK_STREAM, 0); ++ if (sock < 0) { ++ perror("socket"); + break; + } +- for (rp = ai; rp != NULL; rp = rp->ai_next) { +- sock = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); +- if (sock == -1) { +- continue; +- } +- if (connect(sock, rp->ai_addr, rp->ai_addrlen) != -1) { +- break; +- } +- close(sock); ++#ifdef HAVE_GETHOSTBYNAME_R ++ if (gethostbyname_r(info.apcupsd.host, &he_mem, hostbuff, sizeof(hostbuff), &he, &he_errno) || !he ) { ++ NORM_ERR("APCUPSD gethostbyname_r: %s", hstrerror(h_errno)); ++ break; ++ } ++#else /* HAVE_GETHOSTBYNAME_R */ ++ he = gethostbyname(info.apcupsd.host); ++ if (!he) { ++ herror("gethostbyname"); ++ break; + } +- freeaddrinfo(ai); +- if (rp == NULL) { ++#endif /* HAVE_GETHOSTBYNAME_R */ ++ ++ memset(&addr, 0, sizeof(addr)); ++ addr.sin_family = AF_INET; ++ addr.sin_port = info.apcupsd.port; ++ memcpy(&addr.sin_addr, he->h_addr, he->h_length); ++ if (connect(sock, (struct sockaddr*)&addr, sizeof(struct sockaddr)) < 0) { + // no error reporting, the daemon is probably not running + break; + } +- ++ + // + // send status request - "status" - 6B + // +@@ -222,5 +225,5 @@ + // "atomically" copy the data into working set + // + memcpy(info.apcupsd.items, apc.items, sizeof(info.apcupsd.items)); +- return 0; ++ return; + } +--- a/src/apcupsd.h ++++ b/src/apcupsd.h +@@ -49,6 +49,6 @@ + } APCUPSD_S, *PAPCUPSD_S; + + /* Service routine for the conky main thread */ +-int update_apcupsd(void); ++void update_apcupsd(void); + + #endif /*APCUPSD_H_*/ |