[aur-general] Updated PKGBUILD for conky to show hwmon information after kernel upgrade

Partha Chowdhury kira.laucas at gmail.com
Mon Oct 12 08:24:30 EDT 2009


I am pasting/attaching updated PKGBUILD for conky with reference to this bug http://bugs.archlinux.org/task/16584


PKGBUILD:


# $Id: PKGBUILD 50303 2009-08-25 11:05:41Z giovanni $
# Maintainer: Giovanni Scafora <giovanni at archlinux.org>
# Contributor: James Rayner <james at archlinux.org>
# Contributor:  Partha Chowdhury <kira.laucas at gmail.com>

pkgname=conky
pkgver=1.7.2
pkgrel=2
pkgdesc="An advanced, highly configurable system monitor for X based on torsmo"
arch=('i686' 'x86_64')
url="http://conky.sourceforge.net/"
license=('custom')
replaces=('torsmo')
depends=('alsa-lib' 'libxml2' 'curl' 'wireless_tools' 'libxft' 'glib2' 'libxdamage' 'imlib2')
makedepends=('pkgconfig')
source=(http://downloads.sourceforge.net/project/${pkgname}/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.bz2
        
http://bazaar.launchpad.net/%7Enorsetto/%2Bjunk/conky/download/head%3A/fix_hwmon_for_2.6.31-20090924141754-jplrm0xubkw4xe8l-1/fix_hwmon_for_2.6.31.patch)

build() {
  cd ${srcdir}/${pkgname}-${pkgver}

#Apply patch to make conky look in right place in /sys/class/hwmon/

  patch -Np1 < ../../fix_hwmon_for_2.6.31.patch || return 1

  ./configure --prefix=/usr \
              --sysconfdir=/etc \
              --enable-wlan \
              --enable-rss \
              --enable-ibm \
              --enable-imlib2 \
              --disable-lua
  make || return 1
  make DESTDIR=${pkgdir} install
  install -D -m644 COPYING ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
}

md5sums=('cf6f5d45d42ad68c618c00271813b80d'
         'efb3e188cd3879fc7b5af51b59d553ec')
-------------- next part --------------
# $Id: PKGBUILD 50303 2009-08-25 11:05:41Z giovanni $
# Maintainer: Giovanni Scafora <giovanni at archlinux.org>
# Contributor: James Rayner <james at archlinux.org>
# Contributor:  Partha Chowdhury <kira.laucas at gmail.com>

pkgname=conky
pkgver=1.7.2
pkgrel=2
pkgdesc="An advanced, highly configurable system monitor for X based on torsmo"
arch=('i686' 'x86_64')
url="http://conky.sourceforge.net/"
license=('custom')
replaces=('torsmo')
depends=('alsa-lib' 'libxml2' 'curl' 'wireless_tools' 'libxft' 'glib2' 'libxdamage' 'imlib2')
makedepends=('pkgconfig')
source=(http://downloads.sourceforge.net/project/${pkgname}/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.bz2
        http://bazaar.launchpad.net/%7Enorsetto/%2Bjunk/conky/download/head%3A/fix_hwmon_for_2.6.31-20090924141754-jplrm0xubkw4xe8l-1/fix_hwmon_for_2.6.31.patch)

build() {
  cd ${srcdir}/${pkgname}-${pkgver}
  patch -Np1 < ../../fix_hwmon_for_2.6.31.patch || return 1
  ./configure --prefix=/usr \
              --sysconfdir=/etc \
              --enable-wlan \
	      --enable-rss \
	      --enable-ibm \
	      --enable-imlib2 \
	      --disable-lua
  make || return 1
  make DESTDIR=${pkgdir} install
  install -D -m644 COPYING ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
}

md5sums=('cf6f5d45d42ad68c618c00271813b80d'
         'efb3e188cd3879fc7b5af51b59d553ec')
-------------- next part --------------
Horrible hack to make conky JUST compatible with the karmic kernel (2.6.31).
See LP #435571.

Index: conky-1.7.2/src/linux.c
===================================================================
--- conky-1.7.2.orig/src/linux.c	2009-09-24 15:33:48.000000000 +0200
+++ conky-1.7.2/src/linux.c	2009-09-24 15:37:11.000000000 +0200
@@ -858,25 +858,14 @@
 	}
 
 	if (strcmp(dir, "/sys/class/hwmon/") == 0) {
-		if (*buf) {
-			/* buf holds result from get_first_file_in_a_directory() above,
-			 * e.g. "hwmon0" -- append "/device" */
-			strcat(buf, "/device");
-		} else {
+	  if (!(*buf)) {
 			/* dev holds device number N as a string,
-			 * e.g. "0", -- convert to "hwmon0/device" */
-			sprintf(buf, "hwmon%s/device", dev);
+			 * e.g. "0", -- convert to "hwmon0" */
+			sprintf(buf, "hwmon%s", dev);
 			dev = buf;
 		}
 	}
 
-	/* At least the acpitz hwmon doesn't have a 'device' subdir,
-	 * so check it's existence and strip it from buf otherwise. */
-	snprintf(path, 255, "%s%s", dir, dev);
-	if (stat(path, &st)) {
-		buf[strlen(buf) - 7] = 0;
-	}
-
 	/* change vol to in, tempf to temp */
 	if (strcmp(type, "vol") == 0) {
 		type = "in";


More information about the aur-general mailing list