summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorPellegrino Prevete2021-08-10 19:54:52 +0200
committerPellegrino Prevete2021-08-10 19:54:52 +0200
commit1b02d3377025228c0e85573ebb87b08a034cc4e3 (patch)
treea3e08cb47411bdc523b133f2667cdb68d8820014
downloadaur-1b02d3377025228c0e85573ebb87b08a034cc4e3.tar.gz
aur/mce: new package
-rw-r--r--.SRCINFO17
-rw-r--r--PKGBUILD30
-rw-r--r--fix-build.patch99
-rw-r--r--makefile.patch11
4 files changed, 157 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..b76651ac0f4a
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,17 @@
+pkgbase = mce
+ pkgdesc = mce with support for tap-to-wake and tilt-to-wake.
+ pkgver = 0_git20200916
+ pkgrel = 1
+ url = https://github.com/AsteroidOS/mce
+ arch = any
+ groups = mer
+ license = GPL
+ depends = libiphb
+ source = https://github.com/AsteroidOS/mce/archive/4b7cb5348b3edafb6712c97a2be5f34f8401c68f/mce-4b7cb5348b3edafb6712c97a2be5f34f8401c68f.tar.gz
+ source = fix-build.patch
+ source = makefile.patch
+ sha256sums = SKIP
+ sha256sums = dc5e2b15f886611787fa62fd60a7bc76bc4b703a08ae51833482b9a7484f7768
+ sha256sums = a61f5d49dcfffc8cc0643812b2b393274e81e05d17c8300aec235c712d1a9133
+
+pkgname = mce
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..31ea8a628909
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,30 @@
+# Maintainer: Pellegrino Prevete <cGVsbGVncmlub3ByZXZldGVAZ21haWwuY29tCg== | base -d>
+
+pkgname=mce
+pkgver=0_git20200916
+_commit="4b7cb5348b3edafb6712c97a2be5f34f8401c68f"
+pkgrel=1
+pkgdesc="mce with support for tap-to-wake and tilt-to-wake."
+url="https://github.com/AsteroidOS/mce"
+arch=(any)
+license=(GPL)
+depends=(libiphb)
+makedepends=()
+checkdepends=()
+groups=(mer)
+source=("https://github.com/AsteroidOS/mce/archive/$_commit/mce-$_commit.tar.gz"
+ "fix-build.patch"
+ "makefile.patch")
+sha256sums=('SKIP'
+ 'dc5e2b15f886611787fa62fd60a7bc76bc4b703a08ae51833482b9a7484f7768'
+ 'a61f5d49dcfffc8cc0643812b2b393274e81e05d17c8300aec235c712d1a9133')
+
+ build() {
+ cd $pkgname-$_commit
+ PREFIX=/usr make
+ }
+
+package() {
+ cd $pkgname-$_commit
+ make DESTDIR=$pkgdir PREFIX=/usr install
+}
diff --git a/fix-build.patch b/fix-build.patch
new file mode 100644
index 000000000000..4df308e773c1
--- /dev/null
+++ b/fix-build.patch
@@ -0,0 +1,99 @@
+diff --git a/event-input.c b/event-input.c
+index 9d9d4c7..16a3e09 100644
+--- a/event-input.c
++++ b/event-input.c
+@@ -1908,7 +1908,7 @@ evin_iomon_generate_activity(struct input_event *ev, bool cooked, bool raw)
+ if( !ev )
+ goto EXIT;
+
+- time_t t = ev->time.tv_sec;
++ time_t t = ev->input_event_sec;
+
+ /* Actual, never synthetized user activity */
+ if( raw ) {
+diff --git a/libwakelock.h b/libwakelock.h
+index d87f4cd..ec4be44 100644
+--- a/libwakelock.h
++++ b/libwakelock.h
+@@ -7,6 +7,8 @@
+ #ifndef LIBWAKELOCK_H_
+ # define LIBWAKELOCK_H_
+
++#include "musl-compatibility.h"
++
+ # ifdef __cplusplus
+ extern "C" {
+ # elif 0
+diff --git a/mce-hybris.c b/mce-hybris.c
+index 10f9117..3aafb91 100644
+--- a/mce-hybris.c
++++ b/mce-hybris.c
+@@ -328,7 +328,11 @@ static void *mce_hybris_lookup_function(const char *name)
+ else if( access(path, F_OK) == -1 && errno == ENOENT ) {
+ mce_log(LL_NOTICE, "%s: not installed", path);
+ }
++#if defined(RTLD_DEEPBIND)
+ else if( !(base = dlopen(path, RTLD_NOW|RTLD_LOCAL|RTLD_DEEPBIND)) ) {
++#else
++ else if( !(base = dlopen(path, RTLD_NOW|RTLD_LOCAL)) ) {
++#endif
+ mce_log(LL_WARN, "%s: failed to load: %s", path, dlerror());
+ }
+ else {
+diff --git a/mce.h b/mce.h
+index b113d06..1a98555 100644
+--- a/mce.h
++++ b/mce.h
+@@ -26,6 +26,7 @@
+ #ifndef _MCE_H_
+ #define _MCE_H_
+
++#include "musl-compatibility.h"
+ #include "datapipe.h"
+
+ /** Indicate enabled (sub)mode */
+diff --git a/multitouch.c b/multitouch.c
+index 0e6fe41..93aa15d 100644
+--- a/multitouch.c
++++ b/multitouch.c
+@@ -431,7 +431,8 @@ mt_state_handle_event_b(mt_state_t *self, const struct input_event *ev)
+ void
+ mt_state_handle_event(mt_state_t *self, const struct input_event *ev)
+ {
+- self->mts_event_time = ev->time;
++ self->mts_event_time.tv_sec = ev->input_event_sec;
++ self->mts_event_time.tv_usec = ev->input_event_usec;
+
+ self->mts_event_handler_cb(self, ev);
+
+diff --git a/musl-compatibility.h b/musl-compatibility.h
+new file mode 100644
+index 0000000..56cff68
+--- /dev/null
++++ b/musl-compatibility.h
+@@ -0,0 +1,10 @@
++/* Used to retry syscalls that can return EINTR. Taken from bionic unistd.h */
++#ifndef TEMP_FAILURE_RETRY
++#define TEMP_FAILURE_RETRY(exp) ({ \
++ __typeof__(exp) _rc; \
++ do { \
++ _rc = (exp); \
++ } while (_rc == -1 && errno == EINTR); \
++ _rc; })
++#endif
++
+diff --git a/tools/evdev_trace.c b/tools/evdev_trace.c
+index 8cac5b8..b4f944b 100644
+--- a/tools/evdev_trace.c
++++ b/tools/evdev_trace.c
+@@ -88,8 +88,8 @@ process_events(int fd, const char *title)
+ if( emit_event_time )
+ {
+ snprintf(toe, sizeof toe, "%ld.%03ld - ",
+- (long)e->time.tv_sec,
+- (long)e->time.tv_usec / 1000);
++ (long)e->input_event_sec,
++ (long)e->input_event_usec / 1000);
+ }
+
+ printf("%s: %s%s0x%02x/%s - 0x%03x/%s - %d\n",
diff --git a/makefile.patch b/makefile.patch
new file mode 100644
index 000000000000..b619b35fe1c4
--- /dev/null
+++ b/makefile.patch
@@ -0,0 +1,11 @@
+--- src/mce-4b7cb5348b3edafb6712c97a2be5f34f8401c68f/Makefile 2020-09-16 14:11:51.000000000 +0200
++++ Makefile.new 2021-08-10 19:51:25.777027233 +0200
+@@ -125,7 +125,7 @@
+ _INFODIR ?= $(_DATADIR)/info# # /usr/share/info
+ _DEFAULTDOCDIR ?= $(_DATADIR)/doc# # /usr/share/doc
+ _LOCALSTATEDIR ?= /var# # /var
+-_UNITDIR ?= /lib/systemd/system#
++_UNITDIR ?= /usr/lib/systemd/system#
+ _TESTSDIR ?= /opt/tests# # /opt/tests
+
+ # Install directories within DESTDIR