summaryrefslogtreecommitdiff
path: root/x11-plugins/wmacpiload-ac
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /x11-plugins/wmacpiload-ac
reinit the tree, so we can have metadata
Diffstat (limited to 'x11-plugins/wmacpiload-ac')
-rw-r--r--x11-plugins/wmacpiload-ac/Manifest9
-rw-r--r--x11-plugins/wmacpiload-ac/files/wmacpiload-ac-acpi-fix-battery-unit.patch30
-rw-r--r--x11-plugins/wmacpiload-ac/files/wmacpiload-ac-acpi-segfault.patch22
-rw-r--r--x11-plugins/wmacpiload-ac/files/wmacpiload-ac-acpi-sys-temp-hwmon.patch121
-rw-r--r--x11-plugins/wmacpiload-ac/metadata.xml9
-rw-r--r--x11-plugins/wmacpiload-ac/wmacpiload-ac-0.2.0-r1.ebuild45
-rw-r--r--x11-plugins/wmacpiload-ac/wmacpiload-ac-0.2.0.ebuild31
7 files changed, 267 insertions, 0 deletions
diff --git a/x11-plugins/wmacpiload-ac/Manifest b/x11-plugins/wmacpiload-ac/Manifest
new file mode 100644
index 000000000000..7221e46b54c3
--- /dev/null
+++ b/x11-plugins/wmacpiload-ac/Manifest
@@ -0,0 +1,9 @@
+AUX wmacpiload-ac-acpi-fix-battery-unit.patch 1270 SHA256 cf286ff627e90ccbb23dbc65e7078509050de95d12e18ff4ce77cb457c104077 SHA512 46d5ab6cea2b7dd85bcec20ecf5f917f9025ae2c06f578c677c9defd1a8da3cc970f8158aacc87631d2f96b2c1017bc8c8d88271792200e809fd8623d24981f6 WHIRLPOOL d23e6849b935d9ebcf195dd3180e75556a51a17c5a87df8379db3b6e2cd785e28ab51b5fa205e1ee6dff4ace8a838d2580fcddb282a1b15bc523846b1463fbd2
+AUX wmacpiload-ac-acpi-segfault.patch 805 SHA256 c71226b455716edec0f74dc37c879b60282b8e46d671bcdd580297a0f252c94a SHA512 9903f06b95e0a372c980d9ca649fa5c11a47ffce709e98e03507303234fd8111cb0bd1e1204b69af332cfe0bb5293a6f758a7a593cc72244ee37547b579735d1 WHIRLPOOL 66f4365f1c1d63eb47bcda9aad4690f9a400b761e3dbc6788ac6e0f555196e0698afd23d7a77b4b701d4ad3b09caa59abf9feecb8577b758d10280b81305ce38
+AUX wmacpiload-ac-acpi-sys-temp-hwmon.patch 4320 SHA256 b77496aff08ed54a325a7a45de7363cd5a83f4667a6a9dbeb3f313b805db98c8 SHA512 fd7a08c6d7473c48c98d741827d33d6ccef592936379323d0c54ec588dde16b7131f2c6517ddac38e61350a122227818a51d4bf68da1121b71915d4bdb3c4467 WHIRLPOOL 7bb1d43770a82193b93a9184e98b2e3b00d3a09a2cb7bc4478a7e382799873472127e42dc0f05bfa1295af42f890f20305eaef477ec9a891c1f00f0556ad0c3d
+DIST wmacpiload-0.2.0.tar.bz2 112858 SHA256 c160db05fb968ec4d0f239ed7e35188de5ddce4e5a6ffcd3e3c496c279cd8808 SHA512 f0256ae313ad4ecbaf1604578321b45173912f250ba6fb7abf88edbcf6875dee30f8d2f7547cc207768c9229697dbfd48e77617c590e0ca27113b8c675e32714 WHIRLPOOL 83c2672eb6ef3610228a9d73fe9cb8652ec6278beb2d349eb59448d557563f0fbfadd129667759eeff384873707b18d254536ec0846dd807b55e286fa5c8b29c
+EBUILD wmacpiload-ac-0.2.0-r1.ebuild 1023 SHA256 d889a236c07f98eabec306fdeb43faf9334570b5eb780a2e597e932fef1a1b4c SHA512 8532695b4db45cfadf02c672287e5e4ad1d7afc5ce2f554b199c1cce5fb0eeb79104a03093b68105ee60c038117101edc24c07ee678d3097b6f68b854b94b64e WHIRLPOOL ad5c3413545ebfd478882423460bde990e7fee34e8fe68c04cc01894962939d230890fd313aba820f0b6d0ccfb007cf2baeaf4882ac63c77070eb1bb88d4a35d
+EBUILD wmacpiload-ac-0.2.0.ebuild 728 SHA256 e667b51044fad5e6b00c97a2e5cc0efcd70c56f700f02ae43fc21df669896ee5 SHA512 c178fd53b1f3b05ab1184a33af9b161204db623a9283edb9f1ecd3630b9c44ffe8ce121f724c7e034a06584eb9429434717925cbcfe8145b705ad3f7f4423044 WHIRLPOOL 643ac9c8dc6c89675ed1bc9e14f46091b70e617b585c1737176dc25b735e2f055a1e4e0a5b3d511d67b7910f089ec06401ff8a2bb1ee0bc75381a17a6e75fa6c
+MISC ChangeLog 3122 SHA256 b8ffc26ba6d05fc24abc6a0e14e3c553fe9024d358558306062fc6fc7bd52c52 SHA512 6310c65a1133ec64335102ba3fe44c8e85c3d02c4e75d1d28642f22006210fd07930d81a004cbde8d95b2f08a5bfb1f5fb1f41f6f8b14bb3c387c3506f9a7522 WHIRLPOOL 32dc08e527defaa49c6191e8d79894b784799d4239094b0db4cfa2a61df81d814a8d11dc47964fba9cb2f4aa2d7170ecf3f5945b2fc80800c1d77e05b6d86715
+MISC ChangeLog-2015 1647 SHA256 4755952ee1d79301e909abd1892b40d59d33e6a36c12047a1d3217baa9b02b0d SHA512 16f5e2e23e435a2c691a9e81d9e0ad3702a1e08fe116693e63af7c1ef77549f62cc1ccb90aee104a3ad23eed6e145ddf6d309566cd8907724c447d1793bf29ce WHIRLPOOL d8c84aefc9e455d03740394f7c9314500a229ac9650e99fc0968791d23733421733637dc2456fc8554acd3c3ef8e6370936029c79330e0a9271b2e0085fd632a
+MISC metadata.xml 249 SHA256 ab0de85cc2ebef9f9bca3773395bc5c909312efb834a8b3948806c1b00dee4e5 SHA512 1a1312bb0e9f74f1e3852218d8fd4817fbad3bc65633cecbe8735607bc33c1e05b414c2628ff3f6e24dfc4a3999de7191f6cdadd2161b03cf614d5b6f24fab8d WHIRLPOOL 3d7026fc5a045f5c90505dab413fe4534364d8c9a47c053ffbfaf3579478e55f77427eb00b05bd4c593a372c69eefae5ca93a2bab9398f52d20d374c2265fb2d
diff --git a/x11-plugins/wmacpiload-ac/files/wmacpiload-ac-acpi-fix-battery-unit.patch b/x11-plugins/wmacpiload-ac/files/wmacpiload-ac-acpi-fix-battery-unit.patch
new file mode 100644
index 000000000000..6bf6179e7fc6
--- /dev/null
+++ b/x11-plugins/wmacpiload-ac/files/wmacpiload-ac-acpi-fix-battery-unit.patch
@@ -0,0 +1,30 @@
+--- wmacpiload-0.2.0/src/battery.c 2012-10-18 15:42:04.000000000 +0200
++++ wmacpiload-0.2.0.new/src/battery.c 2012-10-18 15:43:33.000000000 +0200
+@@ -42,7 +42,8 @@
+ ************************************************************************/
+
+ /* used to parse the battery state file */
+-#define CAPACITY_UNIT " mAh"
++#define CAPACITY_UNIT1 " mAh"
++#define CAPACITY_UNIT2 " mWh"
+
+ /************************************************************************
+ * Global constants definitions
+@@ -164,7 +165,7 @@
+ char *endptr;
+
+ capacity = strtoul(buf, &endptr, 10);
+- if (strcmp(endptr, CAPACITY_UNIT) != 0) {
++ if (strcmp(endptr, CAPACITY_UNIT1) != 0 && strcmp(endptr, CAPACITY_UNIT2) != 0) {
+ fprintf(stderr,
+ "%s : Battery %s unplugged or unconsistent data\n",
+ PACKAGE, bat->name);
+@@ -238,7 +239,7 @@
+ char *endptr;
+
+ remain = strtol(buf, &endptr, 10);
+- if (strcmp(endptr, CAPACITY_UNIT) == 0)
++ if (strcmp(endptr, CAPACITY_UNIT1) == 0 || strcmp(endptr, CAPACITY_UNIT2) == 0)
+ bat->percentage = (int) ((remain * 100.0) / bat->capacity);
+ else
+ bat->percentage = -1; \ No newline at end of file
diff --git a/x11-plugins/wmacpiload-ac/files/wmacpiload-ac-acpi-segfault.patch b/x11-plugins/wmacpiload-ac/files/wmacpiload-ac-acpi-segfault.patch
new file mode 100644
index 000000000000..15f8e05579a2
--- /dev/null
+++ b/x11-plugins/wmacpiload-ac/files/wmacpiload-ac-acpi-segfault.patch
@@ -0,0 +1,22 @@
+diff -ru wmacpiload-0.2.0/include/lib_acpi.h wmacpiload-0.2.0.new//include/lib_acpi.h
+--- wmacpiload-0.2.0/include/lib_acpi.h 2005-07-21 21:33:19.000000000 -0400
++++ wmacpiload-0.2.0.new//include/lib_acpi.h 2011-06-20 19:53:30.458953984 -0400
+@@ -32,7 +32,7 @@
+ * Macros
+ ************************************************************************/
+
+-# define ACPIDEV "/proc/acpi/info"
++# define ACPIDEV "/proc/acpi/battery"
+
+ /* use ? */
+ # ifndef ACPI_32_BIT_SUPPORT
+diff -ru wmacpiload-0.2.0/src/dockapp.c wmacpiload-0.2.0.new//src/dockapp.c
+--- wmacpiload-0.2.0/src/dockapp.c 2005-08-16 18:38:36.000000000 -0400
++++ wmacpiload-0.2.0.new//src/dockapp.c 2011-06-20 19:44:20.022684448 -0400
+@@ -431,5 +431,6 @@
+ void
+ dockapp_cleanup(void)
+ {
++ if (display != NULL)
+ XCloseDisplay(display);
+ } \ No newline at end of file
diff --git a/x11-plugins/wmacpiload-ac/files/wmacpiload-ac-acpi-sys-temp-hwmon.patch b/x11-plugins/wmacpiload-ac/files/wmacpiload-ac-acpi-sys-temp-hwmon.patch
new file mode 100644
index 000000000000..69857717daeb
--- /dev/null
+++ b/x11-plugins/wmacpiload-ac/files/wmacpiload-ac-acpi-sys-temp-hwmon.patch
@@ -0,0 +1,121 @@
+diff -ru wmacpiload-0.2.0/src/lib_acpi.c wmacpiload-0.2.0.new//src/lib_acpi.c
+--- wmacpiload-0.2.0/src/lib_acpi.c 2005-07-21 21:41:31.000000000 -0400
++++ wmacpiload-0.2.0.new//src/lib_acpi.c 2011-06-28 23:37:50.148092904 -0400
+@@ -83,7 +83,7 @@
+ if (!k->ac)
+ fprintf(stderr, "%s : no AC adapter detected\n", PACKAGE);
+
+- n = snprintf(dir, FILENAME_MAX + 1, "%s%s", "/proc/acpi",
++ n = snprintf(dir, FILENAME_MAX + 1, "%s%s", "/sys/class",
+ thermal_zone_dir);
+ if (n > FILENAME_MAX) {
+ fprintf(stderr, "%s : file name too long, "
+@@ -322,10 +322,10 @@
+ n = strlen(searched);
+
+ if (dest != NULL && dest_size > 0
+- && n > 0 && n < (sizeof buffer) - 1
++ && n < (sizeof buffer) - 1
+ && file_name != NULL && (fd = fopen(file_name, "r")) != NULL) {
+ while (fgets(buffer, sizeof buffer, fd) != NULL)
+- if (strncmp(buffer, searched, n) == 0) {
++ if (n == 0 || strncmp(buffer, searched, n) == 0) {
+ char *src;
+ char *end;
+ size_t len;
+diff -ru wmacpiload-0.2.0/src/thermal.c wmacpiload-0.2.0.new//src/thermal.c
+--- wmacpiload-0.2.0/src/thermal.c 2005-09-29 19:32:46.000000000 -0400
++++ wmacpiload-0.2.0.new//src/thermal.c 2011-06-29 00:18:24.851904854 -0400
+@@ -30,12 +30,17 @@
+ #endif
+
+ #include <stdio.h>
++#include <errno.h>
++#include <limits.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <dirent.h>
+ #include "lib_acpi.h"
+ #include "wmacpiload.h"
+ #include "thermal.h"
++#include <unistd.h>
++#include <sys/types.h>
++#include <sys/stat.h>
+
+ /************************************************************************
+ * Macro definitions
+@@ -48,8 +53,10 @@
+ * Global constants definitions
+ ************************************************************************/
+
+-const char *const thermal_zone_dir = "/thermal_zone/";
+-const char *const thermal_zone_status_file = "/temperature";
++const char *const thermal_zone_dir = "/hwmon/";
++const char *const thermal_zone_status_file = "/temp1_input";
++const char *const thermal_zone_search[] = { "", "/device" };
++const int thermal_zone_MAX_SEARCH = 2;
+
+ /************************************************************************
+ * Function definitions
+@@ -86,9 +93,24 @@
+ }
+ strcpy(tz->name, fd->d_name);
+
+- tz->tempfile =
+- strcat4("/proc/acpi", thermal_zone_dir, tz->name,
+- thermal_zone_status_file);
++ int i;
++ for (i=0; i < thermal_zone_MAX_SEARCH ; i++) {
++ char device_name[MAXSTRLEN+1];
++ char *tempfile;
++ struct stat tempstat;
++ snprintf(device_name, MAXSTRLEN, "%s%s", tz->name, thermal_zone_search[i]);
++ tempfile =
++ strcat4("/sys/class", thermal_zone_dir, device_name,
++ thermal_zone_status_file);
++ if (stat(tempfile, &tempstat) == -1) {
++ if (verbose)
++ printf("Unable to read thermal zone '%s'\n", tempfile);
++ } else {
++ tz->tempfile = tempfile;
++ break;
++ }
++ }
++
+ if (!tz->tempfile) {
+ fprintf(stderr, "%s : could not allocate memory "
+ "for thermal zone tempfile concerning "
+@@ -127,16 +149,19 @@
+
+ if (tz != NULL) {
+ if (parse_file(tz->tempfile,
+- "temperature:", buf, sizeof buf) != NULL) {
++ "", buf, sizeof buf) != NULL) {
+ char *endptr;
+
+ temp = strtoul(buf, &endptr, 10);
+ /*
+- * The format is "temperature: xx C" where xx is the
+- * temperature in celcius degrees. So we check if we have the
+- * " C" left in the buffer to see if all went well.
++ * The format is "xxxxxx" where xx is the
++ * temperature in celcius degrees times 1000.
+ */
+- if (strcmp(endptr, TEMP_UNIT) != 0) {
++ errno = 0;
++ if ((errno == ERANGE && (temp == LONG_MAX || temp == LONG_MIN) ) ||
++ (errno != 0 && temp == 0) ||
++ endptr == buf) {
++ perror("strtol");
+ fprintf(stderr, "%s : Unconsistent temperature "
+ "about thermal zone %s\n", PACKAGE, tz->name);
+ temp = 0;
+@@ -144,7 +169,7 @@
+ } else {
+ temp = 0;
+ }
+- tz->temp = temp;
++ tz->temp = temp / 1000;
+ }
+ }
+ \ No newline at end of file
diff --git a/x11-plugins/wmacpiload-ac/metadata.xml b/x11-plugins/wmacpiload-ac/metadata.xml
new file mode 100644
index 000000000000..1d5e6504004e
--- /dev/null
+++ b/x11-plugins/wmacpiload-ac/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+ <email>voyageur@gentoo.org</email>
+ <name>Bernard Cafarelli</name>
+</maintainer>
+
+</pkgmetadata>
diff --git a/x11-plugins/wmacpiload-ac/wmacpiload-ac-0.2.0-r1.ebuild b/x11-plugins/wmacpiload-ac/wmacpiload-ac-0.2.0-r1.ebuild
new file mode 100644
index 000000000000..564f104c855d
--- /dev/null
+++ b/x11-plugins/wmacpiload-ac/wmacpiload-ac-0.2.0-r1.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="2"
+
+inherit eutils
+
+MY_P=${P/-ac}
+DESCRIPTION="WMACPILoad based dockapp to monitor CPU temp and battery time on ACPI kernels"
+HOMEPAGE="http://wmacpiload.tuxfamily.org/"
+SRC_URI="http://wmacpiload.tuxfamily.org/download/${MY_P}.tar.bz2"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug"
+
+RDEPEND="x11-libs/libX11
+ x11-libs/libXt
+ x11-libs/libXext
+ x11-libs/libXpm"
+
+DEPEND="${RDEPEND}
+ x11-proto/xextproto"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-acpi-segfault.patch" || die "epatch failed"
+ epatch "${FILESDIR}/${PN}-acpi-sys-temp-hwmon.patch" || die "epatch failed"
+ epatch "${FILESDIR}/${PN}-acpi-fix-battery-unit.patch" || die "epatch failed"
+}
+
+src_configure() {
+ econf $(use_enable debug)
+}
+
+src_compile() {
+ emake || die "compile failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "install failed"
+ dodoc AUTHORS ChangeLog NEWS README THANKS TODO
+}
diff --git a/x11-plugins/wmacpiload-ac/wmacpiload-ac-0.2.0.ebuild b/x11-plugins/wmacpiload-ac/wmacpiload-ac-0.2.0.ebuild
new file mode 100644
index 000000000000..629bb47cf961
--- /dev/null
+++ b/x11-plugins/wmacpiload-ac/wmacpiload-ac-0.2.0.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+MY_P=${P/-ac}
+DESCRIPTION="WMACPILoad based dockapp to monitor CPU temp and battery time on ACPI kernels"
+HOMEPAGE="http://wmacpiload.tuxfamily.org/"
+SRC_URI="http://wmacpiload.tuxfamily.org/download/${MY_P}.tar.bz2"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~amd64 x86"
+IUSE="debug"
+
+RDEPEND="x11-libs/libX11
+ x11-libs/libXt
+ x11-libs/libXext
+ x11-libs/libXpm"
+DEPEND="${RDEPEND}
+ x11-proto/xextproto"
+
+S="${WORKDIR}/${MY_P}"
+
+src_compile() {
+ econf $(use_enable debug)
+ emake || die "compile failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "install failed"
+ dodoc AUTHORS ChangeLog NEWS README THANKS TODO
+}