mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-01-11 15:11:26 +00:00
During the compile step, CMake will attempt to generate a test certificate with openssl-native using a hard-coded path to the openssl config: openssl req -config /etc/ssl/openssl.cnf ... Thus using the build host's openssl config. If the build host's openssl is configured with options that openssl-native does not understand or accept, the test certificate will not be generated: [log.do_configure on openSUSE 16.0] Searching for OpenSSL executable and dlls OpenSSL executable: .../build/tmp/work/cortexa53-crypto-oe-linux/libwebsockets/4.5.2/recipe-sysroot-native/usr/bin/openssl GENCERTS = 1 Generating SSL Certificates for the test-server... Error configuring OpenSSL modules 4037413D467F0000:error:030000A9:digital envelope routines:alg_module_init:unknown option:../sources/openssl-3.5.4/crypto/evp/evp_cnf.c:61:name=rh-allow-sha1-signatures, value=yes 4037413D467F0000:error:0700006D:configuration file routines:module_run:module initialization error:../sources/openssl-3.5.4/crypto/conf/conf_mod.c:288:module=alg_section, value=evp_properties retcode=-1 CMake Warning at lib/tls/CMakeLists.txt:528 (message): !!! Failed to generate SSL certificate for Test Server!!!: OpenSSL return code = 1 and the subsequent do_install() step will fail: | CMake Error at test-apps/cmake_install.cmake:126 (file): | file INSTALL cannot find | ".../build/tmp/work/cortexa53-crypto-oe-linux/libwebsockets/4.5.2/build/libwebsockets-test-server.key.pem": | No such file or directory. ERROR: Task (.../layers/meta-openembedded/meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.5.2.bb:do_install) failed with exit code '1' Fix the location where CMake looks for the openssl.cnf file in order to use the one that comes with the openssl-native that will be used to generate the certificate. Thus ensuring that they are in step in terms of which configuration options will be acceptable. Signed-off-by: Trevor Woerner <twoerner@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
72 lines
3.7 KiB
BlitzBasic
72 lines
3.7 KiB
BlitzBasic
SUMMARY = "Canonical libwebsockets.org websocket library"
|
|
HOMEPAGE = "https://libwebsockets.org/"
|
|
LICENSE = "MIT & Zlib & BSD-3-Clause & Apache-2.0 & OFL-1.1"
|
|
LIC_FILES_CHKSUM = "file://LICENSE;md5=b5d391cc7929bcba238f9ba6805f7574"
|
|
|
|
DEPENDS = "zlib"
|
|
DEPENDS:append:class-native = " libcap-native"
|
|
|
|
SRCREV = "85c6f7959fd40d8aaf7a50be3c9b75f08389a01c"
|
|
SRC_URI = "git://github.com/warmcat/libwebsockets.git;protocol=https;branch=v4.5-stable;tag=v${PV}"
|
|
|
|
UPSTREAM_CHECK_URI = "https://github.com/warmcat/${BPN}/releases"
|
|
UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
|
|
|
|
inherit cmake pkgconfig
|
|
|
|
PACKAGECONFIG ?= "libuv client server http2 ssl ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
|
|
PACKAGECONFIG[client] = "-DLWS_WITHOUT_CLIENT=OFF,-DLWS_WITHOUT_CLIENT=ON,"
|
|
PACKAGECONFIG[http2] = "-DLWS_WITH_HTTP2=ON,-DLWS_WITH_HTTP2=OFF,"
|
|
PACKAGECONFIG[ipv6] = "-DLWS_IPV6=ON,-DLWS_IPV6=OFF,"
|
|
PACKAGECONFIG[libevent] = "-DLWS_WITH_LIBEVENT=ON,-DLWS_WITH_LIBEVENT=OFF,libevent"
|
|
PACKAGECONFIG[libev] = "-DLWS_WITH_LIBEV=ON,-DLWS_WITH_LIBEV=OFF,libev"
|
|
PACKAGECONFIG[libuv] = "-DLWS_WITH_LIBUV=ON,-DLWS_WITH_LIBUV=OFF,libuv"
|
|
PACKAGECONFIG[server] = "-DLWS_WITHOUT_SERVER=OFF,-DLWS_WITHOUT_SERVER=ON,"
|
|
PACKAGECONFIG[ssl] = "-DLWS_WITH_SSL=ON,-DLWS_WITH_SSL=OFF,openssl"
|
|
PACKAGECONFIG[static] = "-DLWS_WITH_STATIC=ON,-DLWS_WITH_STATIC=OFF -DLWS_LINK_TESTAPPS_DYNAMIC=ON,"
|
|
PACKAGECONFIG[systemd] = "-DLWS_WITH_SDEVENT=ON,-DLWS_WITH_SDEVENT=OFF,systemd"
|
|
PACKAGECONFIG[examples] = "-DLWS_WITH_MINIMAL_EXAMPLES=ON,-DLWS_WITH_MINIMAL_EXAMPLES=OFF"
|
|
|
|
python __anonymous() {
|
|
if bb.utils.contains('PACKAGECONFIG', 'systemd', True, False, d) and not bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
|
|
bb.fatal("PACKAGECONFIG contains systemd but DISTRO_FEATURES doesn't")
|
|
}
|
|
|
|
EXTRA_OECMAKE += " \
|
|
-DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \
|
|
"
|
|
|
|
do_compile:prepend() {
|
|
sed -i -e 's|/etc/ssl|${RECIPE_SYSROOT_NATIVE}/etc/ssl|g' ${S}/lib/tls/CMakeLists.txt
|
|
}
|
|
|
|
do_install:append() {
|
|
sed -i -e 's|${STAGING_LIBDIR}/libcrypto.so|crypto|g' ${D}${libdir}/cmake/libwebsockets/LibwebsocketsTargets.cmake
|
|
sed -i -e 's|${STAGING_LIBDIR}/libssl.so|ssl|g' ${D}${libdir}/cmake/libwebsockets/LibwebsocketsTargets.cmake
|
|
sed -i -e 's|${STAGING_LIBDIR}/libuv.so|uv|g' ${D}${libdir}/cmake/libwebsockets/LibwebsocketsTargets.cmake
|
|
sed -i -e 's|${STAGING_INCDIR}||g' ${D}${libdir}/cmake/libwebsockets/LibwebsocketsTargets.cmake \
|
|
${D}${libdir}/cmake/libwebsockets/libwebsockets-config.cmake
|
|
sed -i -e 's|${STAGING_LIBDIR}/||g' ${D}${libdir}/cmake/libwebsockets/LibwebsocketsTargets.cmake \
|
|
${D}${libdir}/cmake/libwebsockets/libwebsockets-config.cmake
|
|
}
|
|
|
|
PACKAGES =+ "${PN}-testapps ${PN}-evlib-event ${PN}-evlib-uv ${PN}-evlib-ev ${PN}-evlib-sd"
|
|
|
|
FILES:${PN}-testapps += "${datadir}/libwebsockets-test-server/* ${bindir}/libwebsockets-test-*"
|
|
FILES:${PN}-evlib-event += "${libdir}/libwebsockets-evlib_event.so"
|
|
FILES:${PN}-evlib-uv += "${libdir}/libwebsockets-evlib_uv.so"
|
|
FILES:${PN}-evlib-ev += "${libdir}/libwebsockets-evlib_ev.so"
|
|
FILES:${PN}-evlib-sd += "${libdir}/libwebsockets-evlib_sd.so"
|
|
|
|
RDEPENDS:${PN} += " ${@bb.utils.contains('PACKAGECONFIG', 'libevent', '${PN}-evlib-event', '', d)}"
|
|
RDEPENDS:${PN} += " ${@bb.utils.contains('PACKAGECONFIG', 'libuv', '${PN}-evlib-uv', '', d)}"
|
|
RDEPENDS:${PN} += " ${@bb.utils.contains('PACKAGECONFIG', 'libev', '${PN}-evlib-ev', '', d)}"
|
|
RDEPENDS:${PN} += " ${@bb.utils.contains('PACKAGECONFIG', 'systemd', '${PN}-evlib-sd', '', d)}"
|
|
|
|
RDEPENDS:${PN}-dev += " ${@bb.utils.contains('PACKAGECONFIG', 'static', '${PN}-staticdev', '', d)}"
|
|
|
|
# Avoid absolute paths to end up in the sysroot.
|
|
SSTATE_SCAN_FILES += "*.cmake"
|
|
|
|
BBCLASSEXTEND = "native"
|