Clight: Update to 4.2
This update **requires** Clightd >= 5.0. Removed patch has been merged upstream.
This commit is contained in:
parent
fc9a558abc
commit
1ee4125513
2 changed files with 10 additions and 84 deletions
|
@ -1,81 +0,0 @@
|
|||
diff --git src/modules/bus.c src/modules/bus.c
|
||||
index 00f49cf..7e65fef 100644
|
||||
--- src/modules/bus.c
|
||||
+++ src/modules/bus.c
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
#define GET_BUS(a) sd_bus *tmp = a->bus; if (!tmp) { tmp = a->type == USER_BUS ? userbus : sysbus; } if (!tmp) { return -1; }
|
||||
|
||||
-static int _call(const bus_args *a, const char *signature, va_list args_va, const void **args_ptr, bool expect_reply);
|
||||
static void free_bus_structs(sd_bus_error *err, sd_bus_message *m, sd_bus_message *reply);
|
||||
static int check_err(int *r, sd_bus_error *err, const char *caller);
|
||||
|
||||
@@ -66,7 +65,10 @@ static void receive(const msg_t *const msg, UNUSED const void* userdata) {
|
||||
}
|
||||
}
|
||||
|
||||
-static int _call(const bus_args *a, const char *signature, va_list args_va, const void **args_ptr, bool expect_reply) {
|
||||
+/*
|
||||
+ * Call a method on bus and store its result of type userptr_type in userptr.
|
||||
+ */
|
||||
+int call(const bus_args *a, const char *signature, ...) {
|
||||
sd_bus_error error = SD_BUS_ERROR_NULL;
|
||||
sd_bus_message *m = NULL, *reply = NULL;
|
||||
GET_BUS(a);
|
||||
@@ -76,26 +78,20 @@ static int _call(const bus_args *a, const char *signature, va_list args_va, cons
|
||||
goto finish;
|
||||
}
|
||||
|
||||
- r = sd_bus_message_set_expect_reply(m, expect_reply);
|
||||
+ r = sd_bus_message_set_expect_reply(m, a->reply_cb != NULL);
|
||||
if (check_err(&r, &error, a->caller)) {
|
||||
goto finish;
|
||||
}
|
||||
|
||||
- if (args_va) {
|
||||
- sd_bus_message_appendv(m, signature, args_va);
|
||||
- } else if (args_ptr) {
|
||||
- int len = strlen(signature);
|
||||
- if (len == 1) {
|
||||
- sd_bus_message_append_basic(m, signature[0], args_ptr);
|
||||
- } else {
|
||||
- for (int i = 0; i < len; i++) {
|
||||
- sd_bus_message_append_basic(m, signature[i], args_ptr[i]);
|
||||
- }
|
||||
- }
|
||||
+ if (signature && strlen(signature)) {
|
||||
+ va_list args;
|
||||
+ va_start(args, signature);
|
||||
+ sd_bus_message_appendv(m, signature, args);
|
||||
+ va_end(args);
|
||||
}
|
||||
|
||||
/* Check if we need to wait for a response message */
|
||||
- if (expect_reply) {
|
||||
+ if (a->reply_cb != NULL) {
|
||||
r = sd_bus_call(tmp, m, 0, &error, &reply);
|
||||
if (check_err(&r, &error, a->caller)) {
|
||||
goto finish;
|
||||
@@ -111,22 +107,6 @@ finish:
|
||||
return r;
|
||||
}
|
||||
|
||||
-/*
|
||||
- * Call a method on bus and store its result of type userptr_type in userptr.
|
||||
- */
|
||||
-int call(const bus_args *a, const char *signature, ...) {
|
||||
- int r = 0;
|
||||
- if (signature) {
|
||||
- va_list args;
|
||||
- va_start(args, signature);
|
||||
- r = _call(a, signature, args, NULL, a->reply_cb != NULL);
|
||||
- va_end(args);
|
||||
- } else {
|
||||
- r = _call(a, signature, NULL, NULL, a->reply_cb != NULL);
|
||||
- }
|
||||
- return r;
|
||||
-}
|
||||
-
|
||||
/*
|
||||
* Add a match on bus on certain signal for cb callback
|
||||
*/
|
|
@ -1,15 +1,22 @@
|
|||
# Template file for 'Clight'
|
||||
pkgname=Clight
|
||||
version=4.1
|
||||
version=4.2
|
||||
revision=1
|
||||
build_style=cmake
|
||||
hostmakedepends="pkg-config"
|
||||
makedepends="popt-devel gsl-devel libconfig-devel elogind-devel bash-completion
|
||||
dbus-devel libmodule-devel"
|
||||
depends="Clightd"
|
||||
depends="Clightd>=5.0"
|
||||
short_desc="Use your webcam as a light sensor to adjust screen backlight"
|
||||
maintainer="Dominic Monroe <monroef4@googlemail.com>"
|
||||
license="GPL-3.0-or-later"
|
||||
homepage="https://github.com/FedeDP/Clight"
|
||||
distfiles="https://github.com/FedeDP/Clight/archive/${version}.tar.gz"
|
||||
checksum=84156f3dfd9ab863be25d3efc8b5d6d6043ba4a0b44259c2a1cee1367b3c97aa
|
||||
checksum=fc3c4952c755bad5f4274f69f5cc17142abb51d88d7c615873e3058edc1c1137
|
||||
|
||||
post_install() {
|
||||
vcompletion Extra/_clight zsh
|
||||
vcompletion Extra/clight bash
|
||||
|
||||
vinstall Extra/desktop/clight.desktop 644 usr/share/applications
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue