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." |
| 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." |
| 6 | HOMEPAGE = "http://www.lirc.org" |
| 7 | SECTION = "console/network" |
| 8 | LICENSE = "GPLv2" |
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 \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 16 | file://lircd.service \ |
| 17 | file://lircd.init \ |
| 18 | file://lircexec.init \ |
| 19 | file://lircd.conf \ |
| 20 | file://lirc_options.conf \ |
| 21 | file://lirc.tmpfiles \ |
| 22 | " |
Andrew Geissler | 7f40b71 | 2020-05-15 14:09:53 -0500 | [diff] [blame] | 23 | SRC_URI[md5sum] = "86c3f8e4efaba10571addb8313d1e040" |
| 24 | SRC_URI[sha256sum] = "8b753c60df2a7f5dcda2db72c38e448ca300c3b4f6000c1501fcb0bd5df414f2" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 25 | |
| 26 | SYSTEMD_PACKAGES = "lirc lirc-exec" |
| 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" |
| 31 | |
Andrew Geissler | d221e03 | 2020-07-10 16:13:21 -0500 | [diff] [blame] | 32 | inherit autotools pkgconfig systemd python3native distutils-common-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 |
| 46 | do_configure_append() { |
| 47 | cp ${S}/VERSION ${S}/python-pkg/ |
| 48 | } |
| 49 | |
| 50 | # Create PYTHON_TARBALL which LIRC needs for install-nodist_pkgdataDATA |
| 51 | do_install_prepend() { |
| 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 |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -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 |
| 71 | install -m 0755 -d ${D}${systemd_unitdir}/system |
| 72 | install -m 0755 -d ${D}${libdir}/tmpfiles.d |
| 73 | install -m 0644 ${WORKDIR}/lircd.conf ${D}${sysconfdir}/lirc/ |
| 74 | install -m 0644 ${WORKDIR}/lirc_options.conf ${D}${sysconfdir}/lirc/ |
| 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 | rm -rf ${D}${libdir}/lirc/plugins/*.la |
| 79 | rmdir ${D}/var/run/lirc ${D}/var/run |
| 80 | chown -R root:root ${D}${datadir}/lirc/contrib |
| 81 | } |
| 82 | |
| 83 | PACKAGES =+ "${PN}-contrib ${PN}-exec ${PN}-plugins ${PN}-python" |
| 84 | |
Andrew Geissler | c87764f | 2020-06-27 00:16:32 -0500 | [diff] [blame] | 85 | RDEPENDS_${PN} = "bash python3" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 86 | RDEPENDS_${PN}-exec = "${PN}" |
| 87 | RDEPENDS_${PN}-python = "python3-shell python3-pyyaml python3-datetime python3-netclient python3-stringold" |
| 88 | |
| 89 | RRECOMMENDS_${PN} = "${PN}-exec ${PN}-plugins" |
| 90 | |
| 91 | FILES_${PN}-plugins = "${libdir}/lirc/plugins/*.so ${datadir}/lirc/configs" |
| 92 | FILES_${PN}-contrib = "${datadir}/lirc/contrib" |
| 93 | FILES_${PN}-exec = "${bindir}/irexec ${sysconfdir}/lircexec ${systemd_unitdir}/system/irexec.service" |
| 94 | FILES_${PN} += "${systemd_unitdir}/system/lircexec.init" |
| 95 | FILES_${PN} += "${systemd_unitdir}/system/lircd.service" |
| 96 | FILES_${PN} += "${systemd_unitdir}/system/lircd.socket" |
| 97 | FILES_${PN} += "${libdir}/tmpfiles.d/lirc.conf" |
| 98 | FILES_${PN}-dbg += "${libdir}/lirc/plugins/.debug" |
| 99 | FILES_${PN}-python += "${bindir}/irdb-get ${bindir}/irtext2udp ${bindir}/lircd-setup ${bindir}/pronto2lirc ${libdir}/python*/site-packages" |
| 100 | |
| 101 | INITSCRIPT_PACKAGES = "lirc lirc-exec" |
| 102 | INITSCRIPT_NAME_lirc-exec = "lircexec" |
| 103 | INITSCRIPT_PARAMS_lirc-exec = "defaults 21" |
| 104 | |
| 105 | # this is for distributions that don't use udev |
| 106 | pkg_postinst_${PN}_append() { |
| 107 | if [ ! -c $D/dev/lirc -a ! -f /sbin/udevd ]; then mknod $D/dev/lirc c 61 0; fi |
| 108 | } |
| 109 | |
| 110 | SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}" |