Skip to content

Commit

Permalink
Install OpenSSH headers/lib for hiba usage
Browse files Browse the repository at this point in the history
The installed files will be populated to hiba's sysroot automatically
and used for builds.
  • Loading branch information
wltu committed Aug 25, 2022
1 parent 7b8af96 commit 9e915cd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 deletions.
28 changes: 12 additions & 16 deletions meta-oe/recipes-connectivity/hiba/hiba_git.bb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
14 changes: 14 additions & 0 deletions meta-oe/recipes-connectivity/openssh/openssh_%.bbappend
Original file line number Diff line number Diff line change
@@ -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/
}

0 comments on commit 9e915cd

Please sign in to comment.