diff options
author | Cían Hughes <Ci@nHugh.es> | 2020-10-04 20:43:53 +0000 |
---|---|---|
committer | Leo <thinkabit.ukim@gmail.com> | 2020-10-08 15:05:12 +0000 |
commit | 3f7ecc6fb65fe530999fadfd594ffacd455d21a8 (patch) | |
tree | 45758dfe86a2081b66deab5935a8eb85067d37e5 | |
parent | fccd0c91fd2c8c3c81211944bdfa79d907e7e715 (diff) | |
download | aports-3f7ecc6fb65fe530999fadfd594ffacd455d21a8.tar.gz aports-3f7ecc6fb65fe530999fadfd594ffacd455d21a8.tar.bz2 aports-3f7ecc6fb65fe530999fadfd594ffacd455d21a8.tar.xz |
testing/lirc: new aport
http://lirc.org
Infrared signal receiver and sender
8 files changed, 459 insertions, 0 deletions
diff --git a/testing/lirc/0001-lirc.org-Remove-non-free-advertising.patch b/testing/lirc/0001-lirc.org-Remove-non-free-advertising.patch new file mode 100644 index 0000000000..35d7853760 --- /dev/null +++ b/testing/lirc/0001-lirc.org-Remove-non-free-advertising.patch @@ -0,0 +1,111 @@ +From: Alec Leamas <leamas@nowhere.net> +Date: Tue, 6 Oct 2015 01:56:21 +0200 +Subject: lirc.org: Remove non-free advertising. + +--- + doc/lirc.org/index.html | 14 -------------- + doc/lirc.org/parallel.html | 14 -------------- + doc/lirc.org/receivers.html | 14 -------------- + doc/lirc.org/transmitters.html | 14 -------------- + 4 files changed, 56 deletions(-) + +diff --git a/doc/lirc.org/index.html b/doc/lirc.org/index.html +index caa8ae9..0dd9619 100644 +--- a/doc/lirc.org/index.html ++++ b/doc/lirc.org/index.html +@@ -435,20 +435,6 @@ + the complete list in the left pane. + </p> + <HR WIDTH="50%"><BR> +- <!-- AD --><BR> +- <script type="text/javascript"><!-- +- google_ad_client = "pub-3628312733106047"; +- google_ad_width = 468; +- google_ad_height = 60; +- google_ad_format = "468x60_as"; +- google_color_bg = "ffffff"; +- google_color_url = "666666"; +- google_color_border = "6060c0"; +- google_color_text = "333333"; +- google_color_link = "7070e0"; +- //--></script> +- <!-- AD --><center><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></center> +- <!-- AD --><BR> + <BR> + <!-- News --> + <HR WIDTH="70%"> +diff --git a/doc/lirc.org/parallel.html b/doc/lirc.org/parallel.html +index f4695f8..27a75fb 100644 +--- a/doc/lirc.org/parallel.html ++++ b/doc/lirc.org/parallel.html +@@ -32,20 +32,6 @@ + <TR> + <TD WIDTH="15%" VALIGN="top"> +   +- <script type="text/javascript"><!-- +- google_ad_client = "pub-3628312733106047"; +- google_ad_width = 120; +- google_ad_height = 240; +- google_ad_format = "120x240_as"; +- google_ad_type = "text"; +- google_ad_channel =""; +- google_color_border = "6060C0"; +- google_color_bg = "FFFFFF"; +- google_color_link = "7070E0"; +- google_color_url = "666666"; +- google_color_text = "333333"; +- //--></script> +- <!-- AD --><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> + </TD> + <TD WIDTH="70%"> + <P> +diff --git a/doc/lirc.org/receivers.html b/doc/lirc.org/receivers.html +index 9dced54..c3a4134 100644 +--- a/doc/lirc.org/receivers.html ++++ b/doc/lirc.org/receivers.html +@@ -34,20 +34,6 @@ + <TR> + <TD WIDTH="15%" VALIGN="top"> +   +- <script type="text/javascript"><!-- +- google_ad_client = "pub-3628312733106047"; +- google_ad_width = 120; +- google_ad_height = 240; +- google_ad_format = "120x240_as"; +- google_ad_type = "text"; +- google_ad_channel =""; +- google_color_border = "6060C0"; +- google_color_bg = "FFFFFF"; +- google_color_link = "7070E0"; +- google_color_url = "666666"; +- google_color_text = "333333"; +- //--></script> +- <!-- AD --><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> + </TD> + <TD WIDTH="70%"> + <P> +diff --git a/doc/lirc.org/transmitters.html b/doc/lirc.org/transmitters.html +index 4810f2c..60e886e 100644 +--- a/doc/lirc.org/transmitters.html ++++ b/doc/lirc.org/transmitters.html +@@ -31,20 +31,6 @@ + <TR> + <TD WIDTH="15%" VALIGN="top"> +   +- <script type="text/javascript"><!-- +- google_ad_client = "pub-3628312733106047"; +- google_ad_width = 120; +- google_ad_height = 240; +- google_ad_format = "120x240_as"; +- google_ad_type = "text"; +- google_ad_channel =""; +- google_color_border = "6060C0"; +- google_color_bg = "FFFFFF"; +- google_color_link = "7070E0"; +- google_color_url = "666666"; +- google_color_text = "333333"; +- //--></script> +- <!-- AD --><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> + </TD> + <TD WIDTH="70%"> + <P> diff --git a/testing/lirc/0002-lirc-setup-Fix-crash-on-start-on-missing-lirc.config.patch b/testing/lirc/0002-lirc-setup-Fix-crash-on-start-on-missing-lirc.config.patch new file mode 100644 index 0000000000..c7e7275391 --- /dev/null +++ b/testing/lirc/0002-lirc-setup-Fix-crash-on-start-on-missing-lirc.config.patch @@ -0,0 +1,20 @@ +From: Alec Leamas <leamas.alec@gmail.com> +Date: Fri, 12 Oct 2018 20:49:58 +0200 +Subject: [PATCH] lirc-setup: Fix crash on start on missing lirc.config. + +--- + Makefile.am | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Makefile.am b/Makefile.am +index 9f3dd14..7eeb1cf 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -80,6 +80,7 @@ py_PYTHON = python-pkg/lirc/__init__.py \ + python-pkg/lirc/database.py \ + python-pkg/lirc/paths.py + ++nodist_py_PYTHON = python-pkg/lirc/config.py + nodist_py_pkg_PYTHON = python-pkg/lirc/config.py + + if HAVE_PYTHON35 diff --git a/testing/lirc/0003-logging-Don-t-use-broken-LOG_CONS-syslog-flag.patch b/testing/lirc/0003-logging-Don-t-use-broken-LOG_CONS-syslog-flag.patch new file mode 100644 index 0000000000..5cf3e2a647 --- /dev/null +++ b/testing/lirc/0003-logging-Don-t-use-broken-LOG_CONS-syslog-flag.patch @@ -0,0 +1,24 @@ +From: Alec Leamas <leamas.alec@gmail.com> +Date: Fri, 23 Nov 2018 23:04:35 -0500 +Subject: [PATCH] logging: Don't use broken LOG_CONS syslog flag. + +--- + lib/lirc_log.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/lirc_log.c b/lib/lirc_log.c +index bea357b..900beb3 100644 +--- a/lib/lirc_log.c ++++ b/lib/lirc_log.c +@@ -102,9 +102,9 @@ int lirc_log_open(const char* _progname, int _nodaemon, loglevel_t level) + + if (use_syslog) { + if (nodaemon) +- openlog(syslogident, LOG_CONS | LOG_PID | LOG_PERROR, LOG_LOCAL0); ++ openlog(syslogident, LOG_PID | LOG_PERROR, LOG_LOCAL0); + else +- openlog(syslogident, LOG_CONS | LOG_PID, LOG_LOCAL0); ++ openlog(syslogident, LOG_PID, LOG_LOCAL0); + } else { + lf = fopen(logfile, "a"); + if (lf == NULL) { diff --git a/testing/lirc/0004-lircd-Fix-connect-option-parsing-error-343.patch b/testing/lirc/0004-lircd-Fix-connect-option-parsing-error-343.patch new file mode 100644 index 0000000000..e498661f99 --- /dev/null +++ b/testing/lirc/0004-lircd-Fix-connect-option-parsing-error-343.patch @@ -0,0 +1,22 @@ +From: Alec Leamas <leamas.alec@gmail.com> +Date: Sun, 30 Dec 2018 21:26:15 +0100 +Subject: [PATCH] lircd: Fix --connect option parsing error (#343). + +Bug: https://sourceforge.net/p/lirc/tickets/343/ +--- + daemons/lircd.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/daemons/lircd.cpp b/daemons/lircd.cpp +index d5be708..ad8dde9 100644 +--- a/daemons/lircd.cpp ++++ b/daemons/lircd.cpp +@@ -790,7 +790,7 @@ int add_peer_connection(const char* server_arg) + struct servent* service; + char server[strlen(server_arg) + 1]; + +- strncpy(server, server_arg, sizeof(server) - 1); ++ strncpy(server, server_arg, sizeof(server)); + + if (peern < MAX_PEERS) { + peers[peern] = (struct peer_connection*) malloc(sizeof( diff --git a/testing/lirc/0006-lirc-gpio-ir-0.10.patch b/testing/lirc/0006-lirc-gpio-ir-0.10.patch new file mode 100644 index 0000000000..44cab9d0b1 --- /dev/null +++ b/testing/lirc/0006-lirc-gpio-ir-0.10.patch @@ -0,0 +1,178 @@ +Origin: https://github.com/neuralassembly/raspi/blob/master/lirc-gpio-ir-0.10.patch +Bug-Debian: bugs.debian.org/931078 + +diff -ruN lirc-0.10.1.orig/lib/config_file.c lirc-0.10.1/lib/config_file.c +--- lirc-0.10.1.orig/lib/config_file.c 2017-09-10 17:52:19.000000000 +0900 ++++ lirc-0.10.1/lib/config_file.c 2019-06-26 00:39:45.734320696 +0900 +@@ -71,7 +71,7 @@ + typedef void* (*array_guest_func)(void* item, void* arg); + + +-#define LINE_LEN 1024 ++#define LINE_LEN 4096 + #define MAX_INCLUDES 10 + + const char* whitespace = " \t"; +diff -ruN lirc-0.10.1.orig/lib/ir_remote.h lirc-0.10.1/lib/ir_remote.h +--- lirc-0.10.1.orig/lib/ir_remote.h 2017-09-10 17:52:19.000000000 +0900 ++++ lirc-0.10.1/lib/ir_remote.h 2019-06-26 00:39:45.714321224 +0900 +@@ -110,12 +110,17 @@ + + static inline int is_pulse(lirc_t data) + { +- return data & PULSE_BIT ? 1 : 0; ++ return ((data & LIRC_MODE2_MASK)==LIRC_MODE2_PULSE) ? 1 : 0; + } + + static inline int is_space(lirc_t data) + { +- return !is_pulse(data); ++ return ((data & LIRC_MODE2_MASK)==LIRC_MODE2_SPACE) ? 1 : 0; ++} ++ ++static inline int is_timeout(lirc_t data) ++{ ++ return ((data & LIRC_MODE2_MASK)==LIRC_MODE2_TIMEOUT) ? 1 : 0; + } + + static inline int has_repeat(const struct ir_remote* remote) +diff -ruN lirc-0.10.1.orig/lib/irrecord.c lirc-0.10.1/lib/irrecord.c +--- lirc-0.10.1.orig/lib/irrecord.c 2017-09-10 17:52:19.000000000 +0900 ++++ lirc-0.10.1/lib/irrecord.c 2019-06-26 00:39:45.724320960 +0900 +@@ -1398,9 +1398,16 @@ + state->retval = 0; + return STS_LEN_TIMEOUT; + } ++ if (is_timeout(state->data)) { ++ return STS_LEN_AGAIN; ++ } + state->count++; + if (state->mode == MODE_GET_GAP) { +- state->sum += state->data & PULSE_MASK; ++ if (state->sum != 0 || is_pulse(state->data)) { ++ state->sum += state->data & PULSE_MASK; ++ }else{ ++ return STS_LEN_AGAIN; ++ } + if (state->average == 0 && is_space(state->data)) { + if (state->data > 100000) { + state->sum = 0; +@@ -1472,6 +1479,10 @@ + state->keypresses = lastmaxcount; + return STS_LEN_AGAIN; + } else if (state->mode == MODE_HAVE_GAP) { ++ if (state->count==1 && is_space(state->data)) { ++ state->count = 0; ++ return STS_LEN_AGAIN; ++ } + if (state->count <= MAX_SIGNALS) { + signals[state->count - 1] = state->data & PULSE_MASK; + } else { +@@ -1510,7 +1521,7 @@ + /* such long pulses may appear with + * crappy hardware (receiver? / remote?) + */ +- else { ++ else if(is_pulse(state->data)) { + remote->gap = 0; + return STS_LEN_NO_GAP_FOUND; + } +@@ -1811,22 +1822,24 @@ + + static int raw_data_ok(struct button_state* btn_state) + { +- int r; ++ int r = 0; + int ref; + +- if (!is_space(btn_state->data)) { ++ if (is_pulse(btn_state->data)) { + r = 0; +- } else if (is_const(&remote)) { +- if (remote.gap > btn_state->sum) { +- ref = (remote.gap - btn_state->sum); +- ref *= (100 - remote.eps); +- ref /= 100; ++ } else if (is_space(btn_state->data)) { ++ if (is_const(&remote)) { ++ if (remote.gap > btn_state->sum) { ++ ref = (remote.gap - btn_state->sum); ++ ref *= (100 - remote.eps); ++ ref /= 100; ++ } else { ++ ref = 0; ++ } ++ r = btn_state->data > ref; + } else { +- ref = 0; ++ r = btn_state->data > (remote.gap * (100 - remote.eps)) / 100; + } +- r = btn_state->data > ref; +- } else { +- r = btn_state->data > (remote.gap * (100 - remote.eps)) / 100; + } + return r; + } +@@ -1970,7 +1983,7 @@ + btn_state->data = remote.gap; + } + if (btn_state->count == 0) { +- if (!is_space(btn_state->data) ++ if (is_pulse(btn_state->data) + || btn_state->data < + remote.gap - remote.gap * remote.eps / + 100) { +diff -ruN lirc-0.10.1.orig/lib/lirc/ir_remote.h lirc-0.10.1/lib/lirc/ir_remote.h +--- lirc-0.10.1.orig/lib/lirc/ir_remote.h 2017-09-10 17:52:58.000000000 +0900 ++++ lirc-0.10.1/lib/lirc/ir_remote.h 2019-06-26 00:39:45.724320960 +0900 +@@ -110,12 +110,17 @@ + + static inline int is_pulse(lirc_t data) + { +- return data & PULSE_BIT ? 1 : 0; ++ return ((data & LIRC_MODE2_MASK)==LIRC_MODE2_PULSE) ? 1 : 0; + } + + static inline int is_space(lirc_t data) + { +- return !is_pulse(data); ++ return ((data & LIRC_MODE2_MASK)==LIRC_MODE2_SPACE) ? 1 : 0; ++} ++ ++static inline int is_timeout(lirc_t data) ++{ ++ return ((data & LIRC_MODE2_MASK)==LIRC_MODE2_TIMEOUT) ? 1 : 0; + } + + static inline int has_repeat(const struct ir_remote* remote) +diff -ruN lirc-0.10.1.orig/tools/mode2.cpp lirc-0.10.1/tools/mode2.cpp +--- lirc-0.10.1.orig/tools/mode2.cpp 2017-09-10 17:52:19.000000000 +0900 ++++ lirc-0.10.1/tools/mode2.cpp 2019-06-26 00:45:38.840404976 +0900 +@@ -326,12 +326,24 @@ + void print_mode2_data(unsigned int data) + { + static int bitno = 1; ++ static bool leading_space = true; ++ unsigned int msg = data & LIRC_MODE2_MASK; + + switch (opt_dmode) { + case 0: +- printf("%s %u\n", ( +- data & PULSE_BIT) ? "pulse" : "space", +- (uint32_t)(data & PULSE_MASK)); ++ if (leading_space && msg == LIRC_MODE2_SPACE ) { ++ break; ++ } else { ++ leading_space = false; ++ } ++ if (msg == LIRC_MODE2_PULSE) { ++ printf("pulse %u\n", (__u32)(data & PULSE_MASK)); ++ } else if (msg == LIRC_MODE2_SPACE) { ++ printf("space %u\n", (__u32)(data & PULSE_MASK)); ++ } else if (msg == LIRC_MODE2_TIMEOUT) { ++ printf("timeout %u\n", (__u32)(data & PULSE_MASK)); ++ leading_space = true; ++ } + break; + case 1: { + /* print output like irrecord raw config file data */ diff --git a/testing/lirc/0007-dont-build-python-module.patch b/testing/lirc/0007-dont-build-python-module.patch new file mode 100644 index 0000000000..357e269ab0 --- /dev/null +++ b/testing/lirc/0007-dont-build-python-module.patch @@ -0,0 +1,33 @@ +#In the spirit of building a light aport for Alpine this port does not depend on Py3 +#Including the patch suggested for embedded use here: https://sourceforge.net/p/lirc/mailman/lirc-list/thread/88ec0311-2049-b262-f67a-d047dc30813b%40gmail.com/#msg36015796 + +--- a/Makefile.am ++++ b/Makefile.am +@@ -106,6 +106,7 @@ dist_py_pkg_doc_DATA = python-pkg/doc/Doxyfile \ + + libpython = $(libdir)/python$(PYTHON_VERSION) + pydir = $(libpython)/site-packages/lirc ++if HAVE_PYTHON35 + py_LTLIBRARIES = python-pkg/lib/_client.la + python_pkg_lib__client_la_SOURCES = \ + python-pkg/lirc/_client.c +@@ -118,6 +119,7 @@ python_pkg_lib__client_la_LDFLAGS = \ + $(PYTHON_LIBS) + python_pkg_lib__client_la_LIBADD = \ + lib/liblirc_client.la ++endif + + pylint: .phony + $(MAKE) -C tools pylint +diff --git a/configure.ac b/configure.ac +index 4882931689ff..dcf9703c3530 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -51,7 +51,8 @@ test -z "$PYTHON_LIBS" && \ + test -n "$PYTHON_LIBS" || \ + AC_MSG_WARN([No python package found (missing devel package?)]) + python_version_nodots=$(echo $PYTHON_VERSION | tr -d '.') +-AM_CONDITIONAL(HAVE_PYTHON35, [test $python_version_nodots -ge 35]) ++AM_CONDITIONAL(HAVE_PYTHON35, [test -n "$PYTHON_LIBS" && \ ++ test $python_version_nodots -ge 35]) + CFLAGS="$CFLAGS $PYTHON_CFLAGS" diff --git a/testing/lirc/0008-fix-event-time-on-32bit.patch b/testing/lirc/0008-fix-event-time-on-32bit.patch new file mode 100644 index 0000000000..74ac7dad36 --- /dev/null +++ b/testing/lirc/0008-fix-event-time-on-32bit.patch @@ -0,0 +1,17 @@ +# The struct input_event is not y2038 safe. +# Update the struct according to the kernel patch: +# https://lkml.org/lkml/2018/1/6/324 + +--- lirc-0.10.1/plugins/devinput.c ++++ lirc-0.10.1.new/plugins/devinput.c +@@ -459,8 +459,8 @@ + return 0; + } + +- log_trace("time %ld.%06ld type %d code %d value %d", event.time.tv_sec, event.time.tv_usec, event.type, +- event.code, event.value); ++ log_trace("time %ld.%06ld type %d code %d value %d", event.input_event_sec, event.input_event_usec, ++ event.type, event.code, event.value); + + value = (unsigned)event.value; + #ifdef EV_SW diff --git a/testing/lirc/APKBUILD b/testing/lirc/APKBUILD new file mode 100644 index 0000000000..13d70321ef --- /dev/null +++ b/testing/lirc/APKBUILD @@ -0,0 +1,54 @@ +# Contributor: Cian Hughes <Ci@nHugh.es> +# Maintainer: Cian Hughes <Ci@nHugh.es> +pkgname=lirc +pkgver=0.10.1 +pkgrel=0 +pkgdesc="Infrared signal receiver and sender" +options="!check" # no tests +arch="all" +url="https://lirc.org" +license="GPL-2.0-only" +makedepends="linux-headers bash python3 py3-yaml py3-setuptools libtool + autoconf automake libxslt" +subpackages="$pkgname-dev $pkgname-doc $pkgname-python" +source="https://master.dl.sourceforge.net/project/lirc/LIRC/$pkgver/lirc-$pkgver.tar.gz + 0001-lirc.org-Remove-non-free-advertising.patch + 0002-lirc-setup-Fix-crash-on-start-on-missing-lirc.config.patch + 0003-logging-Don-t-use-broken-LOG_CONS-syslog-flag.patch + 0004-lircd-Fix-connect-option-parsing-error-343.patch + 0006-lirc-gpio-ir-0.10.patch + 0007-dont-build-python-module.patch + 0008-fix-event-time-on-32bit.patch" + +prepare() { + default_prepare + ./autogen.sh +} + +build() { + ./configure \ + --prefix=/usr \ + --localstatedir=/var \ + --enable-devinput \ + --enable-uinput + make +} + +package() { + make DESTDIR="$pkgdir" install +} + +python() { + pkgdesc="Python3 bindings for lirc" + depends="" + amove usr/lib/python3* +} + +sha512sums="33d9bd55bccf726ea39625f124d429cd13b64a8427b890a6210752c6307727439b25a04f00d8d26aee84003ed9e2eeb259da81a7d26913f1aa7210fd1fa26a55 lirc-0.10.1.tar.gz +12ad8a6ad5d600ac9ebe65e3eb8d05b77745b1e8c4cc51924d8135994b9e0419765f3a16d692eeca5c1c525672be69975e6145be714b5b05a6f8b61677d3fbbf 0001-lirc.org-Remove-non-free-advertising.patch +9379c9c43fea67f67de59b64596e1c6937656bff74f9b5c4fe5de407eeeaf02552ea50fcbd85656899f268dc9b6c1d5de944b928bb8db303032442409dc5c2f4 0002-lirc-setup-Fix-crash-on-start-on-missing-lirc.config.patch +a5a328269cb0d72f0d495da92c1726b18fce9549395ccaaa3d8697ed9d12e7025186d4f2a01dce2c58eda05e1d86934eef80700c51de79342d33f51e579031af 0003-logging-Don-t-use-broken-LOG_CONS-syslog-flag.patch +255ecae987ea0225b9d1d4d277b54a1c7103c7f7d2c9742e2197972381d8823353816674f888779bdf53b538f2bc8f9525452469fb73453299a3006aec7ceb93 0004-lircd-Fix-connect-option-parsing-error-343.patch +387fbf736473ce225737ba2937ded89d4b10953ce4e072a120397c949e7e7b43389855bc4e18cfb960069df3ed10fdc20314893019bdad464bae9557e47b0227 0006-lirc-gpio-ir-0.10.patch +3a018cacfb1a1f0c0c288cb3916d235569337d57e93c5b78a17e7cdf08e13ab4e1fce40e4e9ece647ea94dcc175d48a6bdd8fcf60a08891fbf0737ef4224b93b 0007-dont-build-python-module.patch +7e8d5e32d05b3cede9d4a0ab9e6873ef69f49dd325c6dc1522c72fb8aeb05bd370b4588723321346808e52b48e8422b8eb67930baeb28e0d58dbe18449dabfc7 0008-fix-event-time-on-32bit.patch" |