From 60541fc7a4c73bc3b7a907ddbc63695e71df33c6 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Wed, 3 Jul 2019 11:55:04 +0200 Subject: [PATCH 1/4] lirc: fix disable-python patch The patch accidentally dropped installation of pkgconfig files which lead to libirman not detecting lirc Signed-off-by: Matthias Reichl --- .../patches/lirc-0100-disable-python.patch | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/packages/sysutils/lirc/patches/lirc-0100-disable-python.patch b/packages/sysutils/lirc/patches/lirc-0100-disable-python.patch index a71e042c24..d91175f116 100644 --- a/packages/sysutils/lirc/patches/lirc-0100-disable-python.patch +++ b/packages/sysutils/lirc/patches/lirc-0100-disable-python.patch @@ -1,5 +1,5 @@ diff --git a/Makefile.am b/Makefile.am -index aafb4e8c..f33a0c19 100644 +index 9f3dd143..9619a6eb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,7 +5,9 @@ ACLOCAL_AMFLAGS = -I m4 @@ -31,15 +31,25 @@ index aafb4e8c..f33a0c19 100644 if INSTALL_ETC -@@ -61,6 +67,7 @@ endif +@@ -61,7 +67,9 @@ endif dist_doc_DATA = VERSION +if HAVE_PYTHON nodist_pkgdata_DATA = $(PYTHON_TARBALL) ++endif pkgconfigdir = $(libdir)/pkgconfig -@@ -134,6 +141,8 @@ all-local: + dist_pkgconfig_DATA = lirc.pc lirc-driver.pc +@@ -71,6 +79,7 @@ nobase_header_HEADERS = include/media/lirc.h \ + include/linux/input-event-codes.h + header_HEADERS = drivers/irpipe/irpipe.h + ++if HAVE_PYTHON + py_pkgdir = $(pkgdatadir)/python-pkg + dist_py_pkg_DATA = python-pkg/setup.py \ + python-pkg/README.rst +@@ -134,6 +143,8 @@ all-local: $(if $(VERBOSE),,-q) build endif @@ -48,7 +58,7 @@ index aafb4e8c..f33a0c19 100644 install-data-hook: $(SED) -i -e '/^plugindir/s|/usr/lib|$(libdir)|' \ $(DESTDIR)$(lirc_confdir)/lirc_options.conf -@@ -167,6 +176,7 @@ fix-version: .phony +@@ -170,6 +181,7 @@ fix-version: .phony $(SED) -i '/DATE/s/=.*/="$(GIT_DATE)"/' $(distdir)/VERSION $(SED) -i '/REFS/s|=.*|="$(GIT_REFS)"|' $(distdir)/VERSION @@ -56,7 +66,7 @@ index aafb4e8c..f33a0c19 100644 $(abs_builddir)/python-pkg/setup.py: cp -ar $(top_srcdir)/python-pkg $(abs_builddir) chmod -R u+w python-pkg -@@ -190,6 +200,7 @@ python-pkg/lirc/config.py: Makefile $(abs_builddir)/python-pkg/setup.py +@@ -193,6 +205,7 @@ python-pkg/lirc/config.py: Makefile $(abs_builddir)/python-pkg/setup.py @echo 'DOCDIR = "$(docdir)"' >>$@ @echo 'MODINFO = "$(MODINFO)"' >>$@ @echo 'VERSION = "$(VERSION)"' >>$@ @@ -65,7 +75,7 @@ index aafb4e8c..f33a0c19 100644 paths.h: Makefile @echo "#ifndef PATHS_H" >paths.h diff --git a/configure.ac b/configure.ac -index 321a61f7..016813c1 100644 +index 58347d88..48ce5629 100644 --- a/configure.ac +++ b/configure.ac @@ -43,7 +43,8 @@ AC_CHECK_PROG([DOXYGEN],[doxygen],[yes],[no]) @@ -78,7 +88,7 @@ index 321a61f7..016813c1 100644 PKG_CHECK_MODULES([PYTHON],[python-${PYTHON_VERSION}m],,[true]) test -z "$PYTHON_LIBS" && \ PKG_CHECK_MODULES([PYTHON], [python-$PYTHON_VERSION],,[true]) -@@ -577,6 +578,7 @@ AX_REPORT_CONDITIONAL([DEVEL]) +@@ -580,6 +581,7 @@ AX_REPORT_CONDITIONAL([DEVEL]) AX_REPORT_CONDITIONAL([LINUX_KERNEL]) AX_REPORT_CONDITIONAL([HAVE_DEVINPUT]) AX_REPORT_CONDITIONAL([WITH_SYSTEMDSYSTEMUNITDIR]) From f999f5818e5de6944e1fb726cf75f089d2378026 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Wed, 3 Jul 2019 12:15:38 +0200 Subject: [PATCH 2/4] lirc: add patches from Debian Buster Signed-off-by: Matthias Reichl --- ...on-t-use-broken-LOG_CONS-syslog-flag.patch | 24 +++++++++++ ...Fix-connect-option-parsing-error-343.patch | 22 ++++++++++ ...Notify-systemd-on-successful-startup.patch | 43 +++++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 packages/sysutils/lirc/patches/lirc-0003-logging-Don-t-use-broken-LOG_CONS-syslog-flag.patch create mode 100644 packages/sysutils/lirc/patches/lirc-0004-lircd-Fix-connect-option-parsing-error-343.patch create mode 100644 packages/sysutils/lirc/patches/lirc-0005-systemd-support-Notify-systemd-on-successful-startup.patch diff --git a/packages/sysutils/lirc/patches/lirc-0003-logging-Don-t-use-broken-LOG_CONS-syslog-flag.patch b/packages/sysutils/lirc/patches/lirc-0003-logging-Don-t-use-broken-LOG_CONS-syslog-flag.patch new file mode 100644 index 0000000000..5cf3e2a647 --- /dev/null +++ b/packages/sysutils/lirc/patches/lirc-0003-logging-Don-t-use-broken-LOG_CONS-syslog-flag.patch @@ -0,0 +1,24 @@ +From: Alec Leamas +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/packages/sysutils/lirc/patches/lirc-0004-lircd-Fix-connect-option-parsing-error-343.patch b/packages/sysutils/lirc/patches/lirc-0004-lircd-Fix-connect-option-parsing-error-343.patch new file mode 100644 index 0000000000..e498661f99 --- /dev/null +++ b/packages/sysutils/lirc/patches/lirc-0004-lircd-Fix-connect-option-parsing-error-343.patch @@ -0,0 +1,22 @@ +From: Alec Leamas +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/packages/sysutils/lirc/patches/lirc-0005-systemd-support-Notify-systemd-on-successful-startup.patch b/packages/sysutils/lirc/patches/lirc-0005-systemd-support-Notify-systemd-on-successful-startup.patch new file mode 100644 index 0000000000..ffe479817d --- /dev/null +++ b/packages/sysutils/lirc/patches/lirc-0005-systemd-support-Notify-systemd-on-successful-startup.patch @@ -0,0 +1,43 @@ +From: William Manley +Date: Thu, 9 Aug 2018 18:26:44 +0100 +Subject: [PATCH] systemd support: Notify systemd on successful startup + +This allows systemd to detect the case where we've failed to startup +due to a failure to parse our config files. + +Origin: upstream, https://sourceforge.net/p/lirc/git/ci/b78df9b2950cf4 +Applied-Upstream: 0.11.0 +--- + daemons/lircd.cpp | 5 +++++ + systemd/lircd.service | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/daemons/lircd.cpp b/daemons/lircd.cpp +index ad8dde9..f559b62 100644 +--- a/daemons/lircd.cpp ++++ b/daemons/lircd.cpp +@@ -2469,6 +2469,11 @@ int main(int argc, char** argv) + if (!nodaemon) + daemonize(); + ++#ifdef HAVE_SYSTEMD ++ /* Tell systemd that we started up correctly */ ++ sd_notify(0, "READY=1"); ++#endif ++ + loop(); + + /* never reached */ +diff --git a/systemd/lircd.service b/systemd/lircd.service +index 7f75805..6af049b 100644 +--- a/systemd/lircd.service ++++ b/systemd/lircd.service +@@ -6,7 +6,7 @@ Wants=lircd-setup.service + After=network.target lircd-setup.service + + [Service] +-Type=simple ++Type=notify + ExecStart=/usr/sbin/lircd --nodaemon + ; User=lirc + ; Group=lirc From fad82f0e523c9d91c4e4612d9568b1a727c9495e Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Wed, 3 Jul 2019 15:29:53 +0200 Subject: [PATCH 3/4] libirman: rebuild after lirc changes Signed-off-by: Matthias Reichl --- packages/devel/libirman/package.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/devel/libirman/package.mk b/packages/devel/libirman/package.mk index 6316e76d8b..fcded6cd36 100644 --- a/packages/devel/libirman/package.mk +++ b/packages/devel/libirman/package.mk @@ -8,6 +8,7 @@ PKG_LICENSE="GPL" PKG_SITE="http://sourceforge.net/projects/lirc" PKG_URL="http://downloads.sourceforge.net/project/libirman/$PKG_VERSION/$PKG_NAME-$PKG_VERSION.tar.gz" PKG_DEPENDS_TARGET="toolchain systemd lirc" +PKG_NEED_UNPACK="$(get_pkg_directory lirc)" PKG_LONGDESC="libirman library for lircd" PKG_TOOLCHAIN="autotools" PKG_BUILD_FLAGS="+pic" From 15cf6edcda15e81372b9b419a6b85542aea769a9 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Wed, 3 Jul 2019 16:55:10 +0200 Subject: [PATCH 4/4] lirc: add --enable-uinput configure option Don't rely on autodetection as this will fail, eg when building in a chroot without /dev/uinput, and result in lircd-uinput missing Signed-off-by: Matthias Reichl --- packages/sysutils/lirc/package.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/sysutils/lirc/package.mk b/packages/sysutils/lirc/package.mk index 9b29d91193..95d595b6b3 100644 --- a/packages/sysutils/lirc/package.mk +++ b/packages/sysutils/lirc/package.mk @@ -17,6 +17,7 @@ PKG_PYTHON_WANTED=Python2 PKG_CONFIGURE_OPTS_TARGET="ac_cv_header_alsa_asoundlib_h=no \ ac_cv_lib_asound_snd_async_del_handler=no \ --enable-devinput \ + --enable-uinput \ --with-gnu-ld \ --without-x \ --runstatedir=/run"