added community/psensor

This commit is contained in:
Kevin Mihelich 2018-04-29 22:01:41 +00:00
parent d6242e703f
commit ec365ac7a4
2 changed files with 67 additions and 0 deletions

View file

@ -0,0 +1,41 @@
# Maintainer: Robin Broda <robin@broda.me>
# Contributor: X0rg
# Contributor: marlock <marlock87@hotmail.com>
# Contributor: Diogo Leal <estranho@diogoleal.com>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - remove depend on libxnvctrl
pkgname=psensor
pkgver=1.2.0
pkgrel=3
pkgdesc='A graphical hardware temperature monitor for Linux'
arch=('x86_64')
url='https://wpitchoune.net/psensor'
license=('GPL2')
depends=('lm_sensors' 'dconf' 'gtk3' 'udisks2' 'curl' 'libgtop' 'libnotify'
'libappindicator3' 'json-c' 'libmicrohttpd')
makedepends=('help2man')
source=("https://wpitchoune.net/${pkgname}/files/${pkgname}-${pkgver}.tar.gz"
'is_error.patch')
md5sums=('0d8ac0a1312e96f2101ecc7c684e2863'
'04c45b3527e6cc4012fe60491751a0ac')
prepare() {
cd "${pkgname}-${pkgver}"
patch -Np1 -i "${srcdir}/is_error.patch"
}
build() {
cd "${pkgname}-${pkgver}"
./configure --prefix=/usr
make
}
package() {
cd "${pkgname}-${pkgver}"
make DESTDIR="${pkgdir}/" install
}

View file

@ -0,0 +1,26 @@
--- a/src/rsensor.c 2016-12-20 00:39:54.000000000 +0100
+++ b/src/rsensor.c 2018-01-05 19:30:09.089759050 +0100
@@ -133,7 +133,7 @@
obj = get_json_object(url);
- if (obj && !is_error(obj)) {
+ if (obj && (obj != NULL)) {
n = json_object_array_length(obj);
sensors = malloc((n + 1) * sizeof(struct psensor *));
@@ -168,12 +168,12 @@
obj = get_json_object(get_url(s));
- if (obj && !is_error(obj)) {
+ if (obj && (obj != NULL)) {
json_object *om;
json_object_object_get_ex(obj, "last_measure", &om);
- if (!is_error(obj)) {
+ if (obj != NULL) {
json_object *ov, *ot;
struct timeval tv;