Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | DESCRIPTION = "LIRC is a package that allows you to decode and send infra-red signals of many commonly used remote controls." |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 2 | DESCRIPTION:append:lirc = " This package contains the lirc daemon, libraries and tools." |
| 3 | DESCRIPTION:append:lirc-exec = " This package contains a daemon that runs programs on IR signals." |
| 4 | DESCRIPTION:append:lirc-remotes = " This package contains some config files for remotes." |
| 5 | DESCRIPTION:append:lirc-nslu2example = " This package contains a working config for RC5 remotes and a modified NSLU2." |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 6 | HOMEPAGE = "http://www.lirc.org" |
| 7 | SECTION = "console/network" |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 8 | LICENSE = "GPL-2.0-only" |
Andrew Geissler | 7f40b71 | 2020-05-15 14:09:53 -0500 | [diff] [blame] | 9 | DEPENDS = "libxslt-native alsa-lib libftdi libusb1 libusb-compat jack portaudio-v19 python3-pyyaml python3-setuptools-native" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 10 | |
| 11 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" |
| 12 | |
| 13 | SRC_URI = "http://prdownloads.sourceforge.net/lirc/lirc-${PV}.tar.bz2 \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 14 | file://0001-Fix-build-on-32bit-arches-with-64bit-time_t.patch \ |
Andrew Geissler | 7f40b71 | 2020-05-15 14:09:53 -0500 | [diff] [blame] | 15 | file://fix_build_errors.patch \ |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 16 | file://0001-mplay-Fix-build-with-musl.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 17 | 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 Williams | 2194f50 | 2022-10-16 14:26:09 -0500 | [diff] [blame^] | 24 | SRC_URI[sha256sum] = "3d44ec8274881cf262f160805641f0827ffcc20ade0d85e7e6f3b90e0d3d222a" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 25 | |
| 26 | SYSTEMD_PACKAGES = "lirc lirc-exec" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 27 | SYSTEMD_SERVICE:${PN} = "lircd.service lircmd.service lircd-setup.service lircd-uinput.service" |
| 28 | SYSTEMD_SERVICE:${PN}-exec = "irexec.service" |
| 29 | SYSTEMD_AUTO_ENABLE:lirc = "enable" |
| 30 | SYSTEMD_AUTO_ENABLE:lirc-exec = "enable" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 31 | |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 32 | inherit autotools pkgconfig systemd python3native setuptools3-base |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 33 | |
| 34 | PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd" |
| 35 | PACKAGECONFIG[x11] = "--with-x,--with-x=no,libx11," |
| 36 | |
| 37 | PACKAGECONFIG ?= " \ |
| 38 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd', '', d)} \ |
| 39 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', ' x11', '', d)} \ |
| 40 | " |
| 41 | CACHED_CONFIGUREVARS = "HAVE_WORKING_POLL=yes" |
| 42 | |
| 43 | #EXTRA_OEMAKE = 'SUBDIRS="lib daemons tools"' |
Andrew Geissler | 7f40b71 | 2020-05-15 14:09:53 -0500 | [diff] [blame] | 44 | |
| 45 | # Ensure python-pkg/VERSION exists |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 46 | do_configure:append() { |
Andrew Geissler | 7f40b71 | 2020-05-15 14:09:53 -0500 | [diff] [blame] | 47 | cp ${S}/VERSION ${S}/python-pkg/ |
| 48 | } |
| 49 | |
| 50 | # Create PYTHON_TARBALL which LIRC needs for install-nodist_pkgdataDATA |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 51 | do_install:prepend() { |
Andrew Geissler | 7f40b71 | 2020-05-15 14:09:53 -0500 | [diff] [blame] | 52 | 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 Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 60 | do_install:append() { |
Andrew Geissler | 7f40b71 | 2020-05-15 14:09:53 -0500 | [diff] [blame] | 61 | 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 Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 69 | install -m 0755 -d ${D}${sysconfdir} |
| 70 | install -m 0755 -d ${D}${sysconfdir}/lirc |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 71 | install -m 0644 ${WORKDIR}/lircd.conf ${D}${sysconfdir}/lirc/ |
| 72 | install -m 0644 ${WORKDIR}/lirc_options.conf ${D}${sysconfdir}/lirc/ |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 73 | 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 Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 81 | 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 | |
| 86 | PACKAGES =+ "${PN}-contrib ${PN}-exec ${PN}-plugins ${PN}-python" |
| 87 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 88 | RDEPENDS:${PN} = "bash python3" |
| 89 | RDEPENDS:${PN}-exec = "${PN}" |
| 90 | RDEPENDS:${PN}-python = "python3-shell python3-pyyaml python3-datetime python3-netclient python3-stringold" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 91 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 92 | RRECOMMENDS:${PN} = "${PN}-exec ${PN}-plugins" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 93 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 94 | FILES:${PN}-plugins = "${libdir}/lirc/plugins/*.so ${datadir}/lirc/configs" |
| 95 | FILES:${PN}-contrib = "${datadir}/lirc/contrib" |
| 96 | FILES:${PN}-exec = "${bindir}/irexec ${sysconfdir}/lircexec ${systemd_unitdir}/system/irexec.service" |
| 97 | FILES:${PN} += "${systemd_unitdir}/system/lircexec.init" |
| 98 | FILES:${PN} += "${systemd_unitdir}/system/lircd.service" |
| 99 | FILES:${PN} += "${systemd_unitdir}/system/lircd.socket" |
| 100 | FILES:${PN} += "${libdir}/tmpfiles.d/lirc.conf" |
| 101 | FILES:${PN}-dbg += "${libdir}/lirc/plugins/.debug" |
| 102 | FILES:${PN}-python += "${bindir}/irdb-get ${bindir}/irtext2udp ${bindir}/lircd-setup ${bindir}/pronto2lirc ${libdir}/python*/site-packages" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 103 | |
| 104 | INITSCRIPT_PACKAGES = "lirc lirc-exec" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 105 | INITSCRIPT_NAME:lirc-exec = "lircexec" |
| 106 | INITSCRIPT_PARAMS:lirc-exec = "defaults 21" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 107 | |
| 108 | # this is for distributions that don't use udev |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 109 | pkg_postinst:${PN}:append() { |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 110 | if [ ! -c $D/dev/lirc -a ! -f /sbin/udevd ]; then mknod $D/dev/lirc c 61 0; fi |
| 111 | } |
| 112 | |
| 113 | SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}" |