diff options
author | Daniel Black <dragonheart@gentoo.org> | 2005-06-06 11:58:36 +0000 |
---|---|---|
committer | Daniel Black <dragonheart@gentoo.org> | 2005-06-06 11:58:36 +0000 |
commit | b1f039c78c60b7ff3c59d623335704e0b0c80ae8 (patch) | |
tree | f74c2bca5f9e48914c26a79048e6742dbe065c4a /app-admin/torsmo | |
parent | Package-Manager: portage-2.0.51.19 (diff) | |
download | historical-b1f039c78c60b7ff3c59d623335704e0b0c80ae8.tar.gz historical-b1f039c78c60b7ff3c59d623335704e0b0c80ae8.tar.bz2 historical-b1f039c78c60b7ff3c59d623335704e0b0c80ae8.zip |
i2c patch as per bug 95114
Package-Manager: portage-2.0.51.22-r1
Diffstat (limited to 'app-admin/torsmo')
-rw-r--r-- | app-admin/torsmo/ChangeLog | 9 | ||||
-rw-r--r-- | app-admin/torsmo/Manifest | 10 | ||||
-rw-r--r-- | app-admin/torsmo/files/digest-torsmo-0.18-r4 | 1 | ||||
-rw-r--r-- | app-admin/torsmo/files/torsmo-0.18.i2c.patch | 168 | ||||
-rw-r--r-- | app-admin/torsmo/torsmo-0.18-r4.ebuild | 63 |
5 files changed, 250 insertions, 1 deletions
diff --git a/app-admin/torsmo/ChangeLog b/app-admin/torsmo/ChangeLog index ef3ac7fcca63..df8c0ed1490e 100644 --- a/app-admin/torsmo/ChangeLog +++ b/app-admin/torsmo/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for app-admin/torsmo # Copyright 2000-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/torsmo/ChangeLog,v 1.32 2005/05/24 00:48:30 weeve Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-admin/torsmo/ChangeLog,v 1.33 2005/06/06 11:58:36 dragonheart Exp $ + +*torsmo-0.18-r4 (06 Jun 2005) + + 06 Jun 2005; Daniel Black <dragonheart@gentoo.org> + +files/torsmo-0.18.i2c.patch, +torsmo-0.18-r4.ebuild: + i2c patch as per bug 95114 thanks to mrbelh. Patch thanks to Bartosz + Zapalowski 24 May 2005; Jason Wever <weeve@gentoo.org> torsmo-0.18-r3.ebuild: Stable on SPARC wrt bug #93343. diff --git a/app-admin/torsmo/Manifest b/app-admin/torsmo/Manifest index 09436dd00965..ff0aee1c265c 100644 --- a/app-admin/torsmo/Manifest +++ b/app-admin/torsmo/Manifest @@ -1,3 +1,6 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + MD5 6711f1971229aeb76f130e1ea519ed69 ChangeLog 5991 MD5 e62755aeb2fcd53a4426e99d3af550ed metadata.xml 549 MD5 002239c582893089c2347704fc6ed564 torsmo-0.18-r4.ebuild 1702 @@ -9,3 +12,10 @@ MD5 19932267a722d71554454bb3779a9ae0 files/digest-torsmo-0.18-r4 62 MD5 3345892556d2bc8fddf510c86d3c70f0 files/torsmo-0.18.xwin.patch 575 MD5 665c68fb6d053d92d013ba44a84f394c files/torsmo-0.18.noswap.patch 524 MD5 19932267a722d71554454bb3779a9ae0 files/digest-torsmo-0.18-r3 62 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.1 (GNU/Linux) + +iD8DBQFCpDqEmdTrptrqvGERAku/AJwIfgK4FhbXzlW61Ag1T6N4rdUTUQCfX+3E +8Ge5qAieV+cbCgKR1u3sMZ4= +=ko5x +-----END PGP SIGNATURE----- diff --git a/app-admin/torsmo/files/digest-torsmo-0.18-r4 b/app-admin/torsmo/files/digest-torsmo-0.18-r4 new file mode 100644 index 000000000000..f2c1092e434d --- /dev/null +++ b/app-admin/torsmo/files/digest-torsmo-0.18-r4 @@ -0,0 +1 @@ +MD5 88bd8f627637d785a1d681f4f15f00b6 torsmo-0.18.tar.gz 84020 diff --git a/app-admin/torsmo/files/torsmo-0.18.i2c.patch b/app-admin/torsmo/files/torsmo-0.18.i2c.patch new file mode 100644 index 000000000000..8ddeb28688a3 --- /dev/null +++ b/app-admin/torsmo/files/torsmo-0.18.i2c.patch @@ -0,0 +1,168 @@ +diff -ruN torsmo-0.18/freebsd.c torsmo-0.18.new/freebsd.c +--- torsmo-0.18/freebsd.c 2004-08-25 18:24:24.000000000 +0200 ++++ torsmo-0.18.new/freebsd.c 2005-04-19 11:17:18.000000000 +0200 +@@ -278,7 +278,7 @@ + oldtotal = total; + } + +-double get_i2c_info(int fd, int div) { ++double get_i2c_info(int *fd, int div, char *devtype) { + return 0; + } + +@@ -314,7 +314,7 @@ + snprintf(buf, n, "Battery is charging"); + } + +-int open_i2c_sensor(const char *dev, const char *type, int n, int *div) ++int open_i2c_sensor(const char *dev, const char *type, int n, int *div, char *devtype) + { + return 0; + } +diff -ruN torsmo-0.18/linux.c torsmo-0.18.new/linux.c +--- torsmo-0.18/linux.c 2004-12-21 22:20:07.000000000 +0100 ++++ torsmo-0.18.new/linux.c 2005-04-19 11:16:26.000000000 +0200 +@@ -300,7 +300,7 @@ + + #define I2C_DIR "/sys/bus/i2c/devices/" + +-int open_i2c_sensor(const char *dev, const char *type, int n, int *div) { ++int open_i2c_sensor(const char *dev, const char *type, int n, int *div, char *devtype) { + char path[256]; + char buf[64]; + int fd; +@@ -319,6 +319,7 @@ + type = "in"; + + snprintf(path, 255, I2C_DIR "%s/%s%d_input", dev, type, n); ++ strcpy (devtype, path); + + /* open file */ + fd = open(path, O_RDONLY); +@@ -329,6 +330,10 @@ + else + *div = 0; + ++ /* fan does not use *_div as a read divisor */ ++ if (strcmp ("fan", type) == 0) ++ return fd; ++ + /* test if *_div file exist, open it and use it as divisor */ + snprintf(path, 255, I2C_DIR "%s/%s%d_div", dev, type, n); + +@@ -349,24 +354,29 @@ + return fd; + } + +-double get_i2c_info(int fd, int div) { ++double get_i2c_info(int *fd, int div, char *devtype) { + int val = 0; + +- if (fd <= 0) return 0; ++ if (*fd <= 0) return 0; + +- lseek(fd, 0, SEEK_SET); ++ lseek(*fd, 0, SEEK_SET); + + /* read integer */ + { + char buf[64]; + unsigned int n; +- n = read(fd, buf, 63); ++ n = read(*fd, buf, 63); + /* should read until n == 0 but I doubt that kernel will give these + * in multiple pieces. :) */ + buf[n] = '\0'; + val = atoi(buf); + } + ++ close (*fd); ++ /* open file */ ++ *fd = open(devtype, O_RDONLY); ++ if (*fd < 0) ERR("can't open '%s': %s", devtype, strerror(errno)); ++ + /* divide voltage and temperature by 1000 */ + /* or if any other divisor is given, use that */ + if (div > 1) +diff -ruN torsmo-0.18/netbsd.c torsmo-0.18.new/netbsd.c +--- torsmo-0.18/netbsd.c 2004-08-25 19:55:57.000000000 +0200 ++++ torsmo-0.18.new/netbsd.c 2005-04-19 11:17:42.000000000 +0200 +@@ -301,7 +301,7 @@ + + } + +-double get_i2c_info(int fd, int div) { ++double get_i2c_info(int *fd, int div, char *devtype) { + return -1; + } + +@@ -321,7 +321,7 @@ + void get_battery_stuff(char *buf, unsigned int n, const char *bat) { + } + +-int open_i2c_sensor(const char *dev, const char *type, int n, int *div) ++int open_i2c_sensor(const char *dev, const char *type, int n, int *div, char *devtype) + { + return -1; + } +diff -ruN torsmo-0.18/torsmo.c torsmo-0.18.new/torsmo.c +--- torsmo-0.18/torsmo.c 2004-12-21 23:14:46.000000000 +0100 ++++ torsmo-0.18.new/torsmo.c 2005-04-19 11:29:50.000000000 +0200 +@@ -377,6 +377,7 @@ + struct { + int fd; + int arg; ++ char devtype[256]; + } i2c; /* 2 */ + + struct { +@@ -606,10 +607,10 @@ + /* if scanf couldn't read three values, read type and num and use + * default device */ + sscanf(arg, "%63s %d", buf2, &n); +- obj->data.i2c.fd = open_i2c_sensor(0, buf2, n, &obj->data.i2c.arg); ++ obj->data.i2c.fd = open_i2c_sensor(0, buf2, n, &obj->data.i2c.arg, obj->data.i2c.devtype); + } + else { +- obj->data.i2c.fd = open_i2c_sensor(buf1, buf2, n, &obj->data.i2c.arg); ++ obj->data.i2c.fd = open_i2c_sensor(buf1, buf2, n, &obj->data.i2c.arg, obj->data.i2c.devtype); + } + END + OBJ(loadavg, INFO_LOADAVG) +@@ -705,11 +706,11 @@ + END + OBJ(temp1, INFO_I2C) + obj->type = OBJ_i2c; +- obj->data.i2c.fd = open_i2c_sensor(0, "temp", 1, &obj->data.i2c.arg); ++ obj->data.i2c.fd = open_i2c_sensor(0, "temp", 1, &obj->data.i2c.arg, obj->data.i2c.devtype); + END + OBJ(temp2, INFO_I2C) + obj->type = OBJ_i2c; +- obj->data.i2c.fd = open_i2c_sensor(0, "temp", 2, &obj->data.i2c.arg); ++ obj->data.i2c.fd = open_i2c_sensor(0, "temp", 2, &obj->data.i2c.arg, obj->data.i2c.devtype); + END + OBJ(time, 0) + obj->data.s = strdup(arg ? arg : "%F %T"); +@@ -1032,7 +1033,7 @@ + OBJ(i2c) { + double r; + +- r = get_i2c_info(obj->data.i2c.fd, obj->data.i2c.arg); ++ r = get_i2c_info(&obj->data.i2c.fd, obj->data.i2c.arg, obj->data.i2c.devtype); + + if (r >= 100.0 || r == 0) + snprintf(p, n, "%d", (int) r); +diff -ruN torsmo-0.18/torsmo.h torsmo-0.18.new/torsmo.h +--- torsmo-0.18/torsmo.h 2004-12-21 22:49:17.000000000 +0100 ++++ torsmo-0.18.new/torsmo.h 2005-04-19 11:16:42.000000000 +0200 +@@ -172,8 +172,8 @@ + void update_running_processes(void); + char* get_freq(); + void update_load_average(); +-int open_i2c_sensor(const char *dev, const char *type, int n, int *div); +-double get_i2c_info(int fd, int arg); ++int open_i2c_sensor(const char *dev, const char *type, int n, int *div, char *devtype); ++double get_i2c_info(int *fd, int arg, char *devtype); + + char* get_adt746x_cpu(void); + char* get_adt746x_fan(void); diff --git a/app-admin/torsmo/torsmo-0.18-r4.ebuild b/app-admin/torsmo/torsmo-0.18-r4.ebuild new file mode 100644 index 000000000000..0a99d9b7fe1b --- /dev/null +++ b/app-admin/torsmo/torsmo-0.18-r4.ebuild @@ -0,0 +1,63 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-admin/torsmo/torsmo-0.18-r4.ebuild,v 1.1 2005/06/06 11:58:36 dragonheart Exp $ + +inherit eutils + +DESCRIPTION="minimalist system monitor for X" +HOMEPAGE="http://torsmo.sourceforge.net/" +SRC_URI="mirror://sourceforge/torsmo/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~sparc ~x86" +IUSE="truetype seti" + +RDEPEND="virtual/libc + virtual/x11 + truetype? ( >=media-libs/freetype-2 ) + seti? ( sci-astronomy/setiathome )" + +DEPEND="truetype? ( >=media-libs/freetype-2 ) + virtual/x11 + >=sys-devel/automake-1.4 + sys-devel/autoconf + sys-apps/grep + sys-apps/sed + sys-devel/gcc" + +src_unpack() { + unpack ${A} + cd ${S} + epatch ${FILESDIR}/${P}.xwin.patch + epatch ${FILESDIR}/${P}.noswap.patch + epatch ${FILESDIR}/${P}.i2c.patch +} + +src_compile() { + econf \ + `use_enable truetype xft` \ + `use_enable seti` \ + --x-libraries=/usr/X11R6/lib/ || die "econf failed" + emake || die "compile failed" +} + +src_install() { + emake DESTDIR=${D} install || die "make install failed" + dodoc ChangeLog AUTHORS README torsmorc.sample +} + +pkg_postinst() { + einfo 'default configuration file is "~/.torsmorc"' + einfo "you can find a sample configuration file in" + einfo "/usr/share/doc/${PF}/torsmorc.sample.gz" + einfo + einfo "Comment out temperature info lines if you have no kernel" + einfo "support for it." + einfo + ewarn "Torsmo doesn't work with window managers that" + ewarn "take control over root window such as Gnome's nautilus." + einfo + ewarn "Please note that >=0.18 contains mozilla support without" + ewarn "patching, thus the mozilla USE flag has been dropped" +} |