blob: 234d347af74546f95493587dae52c323f0d38167 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001DESCRIPTION = "LIRC is a package that allows you to decode and send infra-red signals of many commonly used remote controls."
Patrick Williams213cb262021-08-07 19:21:33 -05002DESCRIPTION:append:lirc = " This package contains the lirc daemon, libraries and tools."
3DESCRIPTION:append:lirc-exec = " This package contains a daemon that runs programs on IR signals."
4DESCRIPTION:append:lirc-remotes = " This package contains some config files for remotes."
5DESCRIPTION:append:lirc-nslu2example = " This package contains a working config for RC5 remotes and a modified NSLU2."
Andrew Geissler82c905d2020-04-13 13:39:40 -05006HOMEPAGE = "http://www.lirc.org"
7SECTION = "console/network"
Andrew Geissler9aee5002022-03-30 16:27:02 +00008LICENSE = "GPL-2.0-only"
Andrew Geissler7f40b712020-05-15 14:09:53 -05009DEPENDS = "libxslt-native alsa-lib libftdi libusb1 libusb-compat jack portaudio-v19 python3-pyyaml python3-setuptools-native"
Andrew Geissler82c905d2020-04-13 13:39:40 -050010
11LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
12
13SRC_URI = "http://prdownloads.sourceforge.net/lirc/lirc-${PV}.tar.bz2 \
Andrew Geissler82c905d2020-04-13 13:39:40 -050014 file://0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch \
Andrew Geissler7f40b712020-05-15 14:09:53 -050015 file://fix_build_errors.patch \
Patrick Williams92b42cb2022-09-03 06:53:57 -050016 file://0001-mplay-Fix-build-with-musl.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050017 file://lircd.service \
18 file://lircd.init \
19 file://lircexec.init \
20 file://lircd.conf \
21 file://lirc_options.conf \
22 file://lirc.tmpfiles \
23"
Patrick Williams2194f502022-10-16 14:26:09 -050024SRC_URI[sha256sum] = "3d44ec8274881cf262f160805641f0827ffcc20ade0d85e7e6f3b90e0d3d222a"
Andrew Geissler82c905d2020-04-13 13:39:40 -050025
26SYSTEMD_PACKAGES = "lirc lirc-exec"
Patrick Williams213cb262021-08-07 19:21:33 -050027SYSTEMD_SERVICE:${PN} = "lircd.service lircmd.service lircd-setup.service lircd-uinput.service"
28SYSTEMD_SERVICE:${PN}-exec = "irexec.service"
29SYSTEMD_AUTO_ENABLE:lirc = "enable"
30SYSTEMD_AUTO_ENABLE:lirc-exec = "enable"
Andrew Geissler82c905d2020-04-13 13:39:40 -050031
Andrew Geissler595f6302022-01-24 19:11:47 +000032inherit autotools pkgconfig systemd python3native setuptools3-base
Andrew Geissler82c905d2020-04-13 13:39:40 -050033
34PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd"
35PACKAGECONFIG[x11] = "--with-x,--with-x=no,libx11,"
36
37PACKAGECONFIG ?= " \
38 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd', '', d)} \
39 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', ' x11', '', d)} \
40"
41CACHED_CONFIGUREVARS = "HAVE_WORKING_POLL=yes"
42
43#EXTRA_OEMAKE = 'SUBDIRS="lib daemons tools"'
Andrew Geissler7f40b712020-05-15 14:09:53 -050044
45# Ensure python-pkg/VERSION exists
Patrick Williams213cb262021-08-07 19:21:33 -050046do_configure:append() {
Andrew Geissler7f40b712020-05-15 14:09:53 -050047 cp ${S}/VERSION ${S}/python-pkg/
48}
49
50# Create PYTHON_TARBALL which LIRC needs for install-nodist_pkgdataDATA
Patrick Williams213cb262021-08-07 19:21:33 -050051do_install:prepend() {
Andrew Geissler7f40b712020-05-15 14:09:53 -050052 rm -rf ${WORKDIR}/${PN}-${PV}/python-pkg/dist/
53 mkdir ${WORKDIR}/${PN}-${PV}/python-pkg/dist/
54 tar --exclude='${WORKDIR}/${PN}-${PV}/python-pkg/*' -czf ${WORKDIR}/${PN}-${PV}/python-pkg/dist/${PN}-${PV}.tar.gz ${S}
55}
56
57# In code, path to python is a variable that is replaced with path to native version of it
58# during the configure stage, e.g ../recipe-sysroot-native/usr/bin/python3-native/python3.
59# Replace it with #!/usr/bin/env python3
Patrick Williams213cb262021-08-07 19:21:33 -050060do_install:append() {
Andrew Geissler7f40b712020-05-15 14:09:53 -050061 sed -i '1c#!/usr/bin/env python3' ${D}${bindir}/lirc-setup \
62 ${D}${PYTHON_SITEPACKAGES_DIR}/lirc-setup/lirc-setup \
63 ${D}${bindir}/irtext2udp \
64 ${D}${bindir}/lirc-init-db \
65 ${D}${bindir}/irdb-get \
66 ${D}${bindir}/pronto2lirc \
67 ${D}${sbindir}/lircd-setup
68
Andrew Geissler82c905d2020-04-13 13:39:40 -050069 install -m 0755 -d ${D}${sysconfdir}
70 install -m 0755 -d ${D}${sysconfdir}/lirc
Andrew Geissler82c905d2020-04-13 13:39:40 -050071 install -m 0644 ${WORKDIR}/lircd.conf ${D}${sysconfdir}/lirc/
72 install -m 0644 ${WORKDIR}/lirc_options.conf ${D}${sysconfdir}/lirc/
Patrick Williams03907ee2022-05-01 06:28:52 -050073 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
74 install -m 0755 -d ${D}${systemd_unitdir}/system ${D}${libdir}/tmpfiles.d
75 install -m 0644 ${WORKDIR}/lircd.service ${D}${systemd_unitdir}/system/
76 install -m 0755 ${WORKDIR}/lircexec.init ${D}${systemd_unitdir}/system/
77 install -m 0644 ${WORKDIR}/lirc.tmpfiles ${D}${libdir}/tmpfiles.d/lirc.conf
78 else
79 rm -rf ${D}/lib
80 fi
Andrew Geissler82c905d2020-04-13 13:39:40 -050081 rm -rf ${D}${libdir}/lirc/plugins/*.la
82 rmdir ${D}/var/run/lirc ${D}/var/run
83 chown -R root:root ${D}${datadir}/lirc/contrib
84}
85
86PACKAGES =+ "${PN}-contrib ${PN}-exec ${PN}-plugins ${PN}-python"
87
Patrick Williams213cb262021-08-07 19:21:33 -050088RDEPENDS:${PN} = "bash python3"
89RDEPENDS:${PN}-exec = "${PN}"
90RDEPENDS:${PN}-python = "python3-shell python3-pyyaml python3-datetime python3-netclient python3-stringold"
Andrew Geissler82c905d2020-04-13 13:39:40 -050091
Patrick Williams213cb262021-08-07 19:21:33 -050092RRECOMMENDS:${PN} = "${PN}-exec ${PN}-plugins"
Andrew Geissler82c905d2020-04-13 13:39:40 -050093
Patrick Williams213cb262021-08-07 19:21:33 -050094FILES:${PN}-plugins = "${libdir}/lirc/plugins/*.so ${datadir}/lirc/configs"
95FILES:${PN}-contrib = "${datadir}/lirc/contrib"
96FILES:${PN}-exec = "${bindir}/irexec ${sysconfdir}/lircexec ${systemd_unitdir}/system/irexec.service"
97FILES:${PN} += "${systemd_unitdir}/system/lircexec.init"
98FILES:${PN} += "${systemd_unitdir}/system/lircd.service"
99FILES:${PN} += "${systemd_unitdir}/system/lircd.socket"
100FILES:${PN} += "${libdir}/tmpfiles.d/lirc.conf"
101FILES:${PN}-dbg += "${libdir}/lirc/plugins/.debug"
102FILES:${PN}-python += "${bindir}/irdb-get ${bindir}/irtext2udp ${bindir}/lircd-setup ${bindir}/pronto2lirc ${libdir}/python*/site-packages"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500103
104INITSCRIPT_PACKAGES = "lirc lirc-exec"
Patrick Williams213cb262021-08-07 19:21:33 -0500105INITSCRIPT_NAME:lirc-exec = "lircexec"
106INITSCRIPT_PARAMS:lirc-exec = "defaults 21"
Andrew Geissler82c905d2020-04-13 13:39:40 -0500107
108# this is for distributions that don't use udev
Patrick Williams213cb262021-08-07 19:21:33 -0500109pkg_postinst:${PN}:append() {
Andrew Geissler82c905d2020-04-13 13:39:40 -0500110 if [ ! -c $D/dev/lirc -a ! -f /sbin/udevd ]; then mknod $D/dev/lirc c 61 0; fi
111}
112
113SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"