From 9e915cdf0a55ad00888c9d7bc3dde05faf7445eb Mon Sep 17 00:00:00 2001 From: Willy Tu Date: Thu, 25 Aug 2022 15:45:50 +0000 Subject: [PATCH] Install OpenSSH headers/lib for hiba usage The installed files will be populated to hiba's sysroot automatically and used for builds. --- meta-oe/recipes-connectivity/hiba/hiba_git.bb | 28 ++++++++----------- .../openssh/openssh_%.bbappend | 14 ++++++++++ 2 files changed, 26 insertions(+), 16 deletions(-) create mode 100644 meta-oe/recipes-connectivity/openssh/openssh_%.bbappend diff --git a/meta-oe/recipes-connectivity/hiba/hiba_git.bb b/meta-oe/recipes-connectivity/hiba/hiba_git.bb index d05d754027d..3ac1adf3803 100644 --- a/meta-oe/recipes-connectivity/hiba/hiba_git.bb +++ b/meta-oe/recipes-connectivity/hiba/hiba_git.bb @@ -17,26 +17,22 @@ PV = "1.0+git${SRCPV}" inherit autotools DEPENDS = "openssl openssh zlib" -RDEPENDS:${PN} = "bash" -def get_oeconf(d): - import glob - workdir = d.getVar("WORKDIR") - openssh_paths = glob.glob("{}/../../openssh/*/openssh-*".format(workdir)) - - if len(openssh_paths) != 1: - # Cannot fail here since this will cause failure on other recipes - # if openssh is not installed - return "" - - return "--prefix=/usr/ --with-opensshdir={}".format(openssh_paths[0]) - -EXTRA_OECONF = "${@get_oeconf(d)}" +EXTRA_OECONF = " \ + --with-opensshdir=${PKG_CONFIG_SYSROOT_DIR}/usr/include/ssh \ + --prefix=/usr/ \ +" # Make sure that MACHINE_FEATURES includes hiba before continuing do_configure:prepend(){ - if ${@bb.utils.contains("MACHINE_FEATURES", "hiba", "false", "true", d)} ; then - echo "MACHINE_FEATURES does not support hiba" + if ${@bb.utils.contains("DISTRO_FEATURES", "hiba", "false", "true", d)} ; then + echo "DISTRO_FEATURES does not support hiba. Skip the configuration" exit 1 fi } + +PACKAGES =+ "${PN}-tools" + +FILES:${PN}-tools = "${sbindir}/hiba-ca.sh ${sbindir}/hiba-grl ${sbindir}/hiba-gen" + +RDEPENDS:${PN}-tools = "${PN} bash" diff --git a/meta-oe/recipes-connectivity/openssh/openssh_%.bbappend b/meta-oe/recipes-connectivity/openssh/openssh_%.bbappend new file mode 100644 index 00000000000..789d3e25371 --- /dev/null +++ b/meta-oe/recipes-connectivity/openssh/openssh_%.bbappend @@ -0,0 +1,14 @@ +do_install:append () { + if ${@bb.utils.contains("DISTRO_FEATURES", "hiba", "false", "true", d)} ; then + echo "DISTRO_FEATURES does not support hiba. Skip the installations" + exit 0 + fi + + install -d ${D}/usr/include/ssh + install -d ${D}/usr/include/ssh/openbsd-compat + install -d ${D}/usr/lib/ + install -m0644 ${S}/*.h ${D}/usr/include/ssh + install -m0644 ${S}/libssh* ${D}/usr/lib/ + install -m0644 ${S}/openbsd-compat/*.h ${D}/usr/include/ssh/openbsd-compat + install -m0644 ${S}/openbsd-compat/libopenbsd-compat* ${D}/usr/lib/ +}