From 18bb0929e1832163f536bc0fd54d59ea7b66b32b Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 10 Oct 2017 18:58:13 -0700 Subject: toybox: Switch building from git src_uri We need a patch e.g. https://github.com/landley/toybox/commit/78289203031afc23585035c362beec10db54958d to fix build on archlinux Signed-off-by: Khem Raj Signed-off-by: Martin Jansa --- meta-oe/recipes-core/toybox/toybox_0.7.4.bb | 72 --------------------------- meta-oe/recipes-core/toybox/toybox_git.bb | 75 +++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 72 deletions(-) delete mode 100644 meta-oe/recipes-core/toybox/toybox_0.7.4.bb create mode 100644 meta-oe/recipes-core/toybox/toybox_git.bb diff --git a/meta-oe/recipes-core/toybox/toybox_0.7.4.bb b/meta-oe/recipes-core/toybox/toybox_0.7.4.bb deleted file mode 100644 index 76a7af4595..0000000000 --- a/meta-oe/recipes-core/toybox/toybox_0.7.4.bb +++ /dev/null @@ -1,72 +0,0 @@ -SUMMARY = "Toybox combines common utilities together into a single executable." -HOMEPAGE = "http://www.landley.net/toybox/" -DEPENDS = "attr" - -SRC_URI = "http://www.landley.net/toybox/downloads/${BPN}-${PV}.tar.gz \ -" -SRC_URI[md5sum] = "55ea59a31c7da9510c8fabe70f4bc561" -SRC_URI[sha256sum] = "49d74ca897501e5c981516719870fe08581726f5c018abe35ef52c6f0de113e7" - -LICENSE = "BSD-0-Clause" -LIC_FILES_CHKSUM = "file://LICENSE;md5=f0b8b3dd6431bcaa245da0a08bd0d511" - -SECTION = "base" - -TOYBOX_BIN = "generated/unstripped/toybox" - -EXTRA_OEMAKE = 'HOSTCC="${BUILD_CC}" CPUS=${@oe.utils.cpu_count()}' - -do_configure() { - oe_runmake defconfig - - # Disable killall5 as it isn't managed by update-alternatives - sed -e 's/CONFIG_KILLALL5=y/# CONFIG_KILLALL5 is not set/' -i .config - - # Disable swapon as it doesn't handle the '-a' argument used during boot - sed -e 's/CONFIG_SWAPON=y/# CONFIG_SWAPON is not set/' -i .config -} - -do_compile() { - oe_runmake ${TOYBOX_BIN} - - # Create a list of links needed - ${BUILD_CC} -I . scripts/install.c -o generated/instlist - ./generated/instlist long | sed -e 's#^#/#' > toybox.links -} - -do_install() { - # Install manually instead of using 'make install' - install -d ${D}${base_bindir} - if grep -q "CONFIG_TOYBOX_SUID=y" ${B}/.config; then - install -m 4755 ${B}/${TOYBOX_BIN} ${D}${base_bindir}/toybox - else - install -m 0755 ${B}/${TOYBOX_BIN} ${D}${base_bindir}/toybox - fi - - install -d ${D}${sysconfdir} - install -m 0644 ${B}/toybox.links ${D}${sysconfdir} -} - -inherit update-alternatives - -# If you've chosen to install toybox you probably want it to take precedence -# over busybox where possible but not over other packages -ALTERNATIVE_PRIORITY = "60" - -python do_package_prepend () { - # Read links from /etc/toybox.links and create appropriate - # update-alternatives variables - - dvar = d.getVar('D') - pn = d.getVar('PN') - target = "/bin/toybox" - - f = open('%s/etc/toybox.links' % (dvar), 'r') - for alt_link_name in f: - alt_link_name = alt_link_name.strip() - alt_name = os.path.basename(alt_link_name) - d.appendVar('ALTERNATIVE_%s' % (pn), ' ' + alt_name) - d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link_name) - d.setVarFlag('ALTERNATIVE_TARGET', alt_name, target) - f.close() -} diff --git a/meta-oe/recipes-core/toybox/toybox_git.bb b/meta-oe/recipes-core/toybox/toybox_git.bb new file mode 100644 index 0000000000..08f9715737 --- /dev/null +++ b/meta-oe/recipes-core/toybox/toybox_git.bb @@ -0,0 +1,75 @@ +SUMMARY = "Toybox combines common utilities together into a single executable." +HOMEPAGE = "http://www.landley.net/toybox/" +DEPENDS = "attr" + +LICENSE = "BSD-0-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=f0b8b3dd6431bcaa245da0a08bd0d511" + +PV = "0.7.4+git${SRCPV}" + +SRCREV = "78289203031afc23585035c362beec10db54958d" +SRC_URI = "git://github.com/landley/toybox;protocol=https \ +" + +S = "${WORKDIR}/git" + +SECTION = "base" + +TOYBOX_BIN = "generated/unstripped/toybox" + +EXTRA_OEMAKE = 'HOSTCC="${BUILD_CC}" CPUS=${@oe.utils.cpu_count()}' + +do_configure() { + oe_runmake defconfig + + # Disable killall5 as it isn't managed by update-alternatives + sed -e 's/CONFIG_KILLALL5=y/# CONFIG_KILLALL5 is not set/' -i .config + + # Disable swapon as it doesn't handle the '-a' argument used during boot + sed -e 's/CONFIG_SWAPON=y/# CONFIG_SWAPON is not set/' -i .config +} + +do_compile() { + oe_runmake ${TOYBOX_BIN} + + # Create a list of links needed + ${BUILD_CC} -I . scripts/install.c -o generated/instlist + ./generated/instlist long | sed -e 's#^#/#' > toybox.links +} + +do_install() { + # Install manually instead of using 'make install' + install -d ${D}${base_bindir} + if grep -q "CONFIG_TOYBOX_SUID=y" ${B}/.config; then + install -m 4755 ${B}/${TOYBOX_BIN} ${D}${base_bindir}/toybox + else + install -m 0755 ${B}/${TOYBOX_BIN} ${D}${base_bindir}/toybox + fi + + install -d ${D}${sysconfdir} + install -m 0644 ${B}/toybox.links ${D}${sysconfdir} +} + +inherit update-alternatives + +# If you've chosen to install toybox you probably want it to take precedence +# over busybox where possible but not over other packages +ALTERNATIVE_PRIORITY = "60" + +python do_package_prepend () { + # Read links from /etc/toybox.links and create appropriate + # update-alternatives variables + + dvar = d.getVar('D') + pn = d.getVar('PN') + target = "/bin/toybox" + + f = open('%s/etc/toybox.links' % (dvar), 'r') + for alt_link_name in f: + alt_link_name = alt_link_name.strip() + alt_name = os.path.basename(alt_link_name) + d.appendVar('ALTERNATIVE_%s' % (pn), ' ' + alt_name) + d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link_name) + d.setVarFlag('ALTERNATIVE_TARGET', alt_name, target) + f.close() +} -- cgit 1.2.3-korg