From 83da7e94cfb9e1deb78233246916b471ad1d5da6 Mon Sep 17 00:00:00 2001 From: Linus Wallgren Date: Thu, 18 Feb 2021 15:00:05 +0100 Subject: [PATCH 01/13] Upgrade layer to thud No changes seems to be needed after going through the migration steps https://docs.yoctoproject.org/ref-manual/migration-2.6.html --- conf/layer.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/layer.conf b/conf/layer.conf index b399f76..7f4ac42 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -3,7 +3,7 @@ BBFILES := "${BBFILES} ${LAYERDIR}/recipes-*/*/*/*.bb ${LAYERDIR}/recipes-*/*/*/ BBFILE_COLLECTIONS += "bc" BBFILE_PATTERN_bc := "^${LAYERDIR}/" BBFILE_PRIORITY_bc := "5" -LAYERSERIES_COMPAT_bc = "sumo" +LAYERSERIES_COMPAT_bc = "thud" LICENSE_FLAGS_WHITELIST="commercial_libav" From 3a27d4210cdf83d853e851e1a39edfd8cbea77e0 Mon Sep 17 00:00:00 2001 From: Linus Wallgren Date: Thu, 18 Feb 2021 15:49:06 +0100 Subject: [PATCH 02/13] Upgrade to warrior No changes from the migration guide seemed to be relevant https://docs.yoctoproject.org/ref-manual/migration-2.7.html --- conf/layer.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/layer.conf b/conf/layer.conf index 7f4ac42..c5e9de5 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -3,7 +3,7 @@ BBFILES := "${BBFILES} ${LAYERDIR}/recipes-*/*/*/*.bb ${LAYERDIR}/recipes-*/*/*/ BBFILE_COLLECTIONS += "bc" BBFILE_PATTERN_bc := "^${LAYERDIR}/" BBFILE_PRIORITY_bc := "5" -LAYERSERIES_COMPAT_bc = "thud" +LAYERSERIES_COMPAT_bc = "warrior" LICENSE_FLAGS_WHITELIST="commercial_libav" From 3d250e5e5e0865e8f7ac7be11abbe18e278355f6 Mon Sep 17 00:00:00 2001 From: Linus Wallgren Date: Thu, 18 Feb 2021 16:00:09 +0100 Subject: [PATCH 03/13] Upgrade to zeus This release removes support for lsb. Otherwise no changes seems to affect this layer https://docs.yoctoproject.org/ref-manual/migration-3.0.html --- conf/layer.conf | 2 +- recipes-bc/flexisip/flexisip/flexisip.inc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/layer.conf b/conf/layer.conf index c5e9de5..7d9f894 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -3,7 +3,7 @@ BBFILES := "${BBFILES} ${LAYERDIR}/recipes-*/*/*/*.bb ${LAYERDIR}/recipes-*/*/*/ BBFILE_COLLECTIONS += "bc" BBFILE_PATTERN_bc := "^${LAYERDIR}/" BBFILE_PRIORITY_bc := "5" -LAYERSERIES_COMPAT_bc = "warrior" +LAYERSERIES_COMPAT_bc = "zeus" LICENSE_FLAGS_WHITELIST="commercial_libav" diff --git a/recipes-bc/flexisip/flexisip/flexisip.inc b/recipes-bc/flexisip/flexisip/flexisip.inc index 51e2cf1..feb6623 100644 --- a/recipes-bc/flexisip/flexisip/flexisip.inc +++ b/recipes-bc/flexisip/flexisip/flexisip.inc @@ -8,7 +8,7 @@ INC_PR = "r0" PROVIDES = "flexisip flexisip-proxy flexisip-presence flexisip-conference" DEPENDS = "libsofia-sip-ua-bc linphone-sdk mariadb redis" -RDEPENDS_${PN} = "lsb" +# RDEPENDS_${PN} = "lsb" # Removed in yocto 3.0 S = "${WORKDIR}/git" inherit cmake systemd From 25ebee5c304c6208ffcda88ff7b86e09b681a0bd Mon Sep 17 00:00:00 2001 From: Linus Wallgren Date: Wed, 24 Feb 2021 10:42:25 +0100 Subject: [PATCH 04/13] Change layer compatibility to dunfell --- conf/layer.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/layer.conf b/conf/layer.conf index 7d9f894..88aae3a 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -3,7 +3,7 @@ BBFILES := "${BBFILES} ${LAYERDIR}/recipes-*/*/*/*.bb ${LAYERDIR}/recipes-*/*/*/ BBFILE_COLLECTIONS += "bc" BBFILE_PATTERN_bc := "^${LAYERDIR}/" BBFILE_PRIORITY_bc := "5" -LAYERSERIES_COMPAT_bc = "zeus" +LAYERSERIES_COMPAT_bc = "dunfell" LICENSE_FLAGS_WHITELIST="commercial_libav" From 52ed9fa5cea92c9e51b7e7f44e224b540e4348bb Mon Sep 17 00:00:00 2001 From: Linus Wallgren Date: Wed, 24 Feb 2021 10:42:40 +0100 Subject: [PATCH 05/13] Simplify Dockerfile to make it easier to develop .. changes to the recipe --- docker/Dockerfile | 50 ++++++++++++----------------------------------- 1 file changed, 12 insertions(+), 38 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 54d1c44..496e87b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,7 +1,4 @@ -FROM debian:9 - -ARG YOCTO_VERSION=sumo -ARG BITBAKE_TARGET=linphone-sdk +FROM debian:buster ENV DEBIAN_FRONTEND noninteractive @@ -9,19 +6,17 @@ RUN apt-get update && apt-get -y upgrade # Required Packages for the Host Development System # http://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#required-packages-for-the-host-development-system -RUN apt-get install -y gawk wget git-core diffstat unzip texinfo gcc-multilib g++-multilib \ - build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \ - apt-utils tmux xz-utils debianutils iputils-ping libncurses5-dev devscripts +# RUN apt-get install -y gawk wget git-core diffstat unzip texinfo gcc-multilib g++-multilib \ +# build-essential chrpath socat cpio python python3 python3-pip python3-pexpect \ +# apt-utils tmux xz-utils debianutils iputils-ping libncurses5-dev devscripts + +# https://docs.yoctoproject.org/ref-manual/system-requirements.html#ubuntu-and-debian +RUN apt-get install -y gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint3 xterm python3-subunit mesa-common-dev # Additional host packages required by poky/scripts/wic RUN apt-get install -y curl dosfstools mtools parted syslinux tree zip -# Create a non-root user that will perform the actual build -RUN id build 2>/dev/null || useradd --uid 30000 --create-home build -RUN apt-get install -y sudo -RUN echo "build ALL=(ALL) NOPASSWD: ALL" | tee -a /etc/sudoers - # Fix error "Please use a locale setting which supports utf-8." # See https://wiki.yoctoproject.org/wiki/TipsAndTricks/ResolvingLocaleIssues RUN apt-get install -y locales @@ -34,33 +29,12 @@ ENV LC_ALL en_US.UTF-8 ENV LANG en_US.UTF-8 ENV LANGUAGE en_US.UTF-8 +# Create a non-root user that will perform the actual build +RUN id build 2>/dev/null || useradd --uid 1000 --create-home build +RUN apt-get install -y sudo +RUN echo "build ALL=(ALL) NOPASSWD: ALL" | tee -a /etc/sudoers + USER build WORKDIR /home/build -RUN git clone -b "${YOCTO_VERSION}" git://git.yoctoproject.org/poky - -WORKDIR poky - -RUN git clone -b "${YOCTO_VERSION}" git://git.openembedded.org/meta-openembedded - -RUN git clone -b "yocto-${YOCTO_VERSION}" https://gitlab.linphone.org/BC/public/meta-bc.git - -RUN git clone -b "${YOCTO_VERSION}" git://git.yoctoproject.org/meta-raspberrypi - -#Add here additional clone of custom/BSP layers - -WORKDIR /home/build/poky - -RUN mkdir -p /home/build/poky/build - -RUN mkdir -p /home/build/poky/build/conf - -COPY --chown=build local.conf /home/build/poky/build/conf/ - -COPY --chown=build bblayers.conf /home/build/poky/build/conf/ - -RUN chown -R build:build /home/build/poky/build - -#CMD "source oe-init-build-env && bitbake ${BITBAKE_TARGET}" - CMD bash From 04837ac58e8f3bbc7df359688a097d017eb63d8f Mon Sep 17 00:00:00 2001 From: Linus Wallgren Date: Wed, 24 Feb 2021 10:37:29 +0100 Subject: [PATCH 06/13] Replace cmakebuilder.bbclass with dunfell version This commit mainly exist to clearly mark the patch applied to it for the future. So basically if you are trying to port this patch to a newer version, check the subsequent commits to this file. --- classes/cmakebuilder.bbclass | 121 ++++++++++++++++++++++++----------- 1 file changed, 84 insertions(+), 37 deletions(-) diff --git a/classes/cmakebuilder.bbclass b/classes/cmakebuilder.bbclass index 99b6b3f..8243f7c 100644 --- a/classes/cmakebuilder.bbclass +++ b/classes/cmakebuilder.bbclass @@ -4,29 +4,41 @@ OECMAKE_SOURCEPATH ??= "${S}" DEPENDS_prepend = "cmake-native " B = "${WORKDIR}/build" -# We need to unset CCACHE otherwise cmake gets too confused -CCACHE = "" - # What CMake generator to use. # The supported options are "Unix Makefiles" or "Ninja". OECMAKE_GENERATOR ?= "Ninja" python() { generator = d.getVar("OECMAKE_GENERATOR") - if generator == "Unix Makefiles": - args = "-G 'Unix Makefiles' -DCMAKE_MAKE_PROGRAM=" + d.getVar("MAKE") + if "Unix Makefiles" in generator: + args = "-G '" + generator + "' -DCMAKE_MAKE_PROGRAM=" + d.getVar("MAKE") d.setVar("OECMAKE_GENERATOR_ARGS", args) d.setVarFlag("do_compile", "progress", "percent") - elif generator == "Ninja": + elif "Ninja" in generator: + args = "-G '" + generator + "' -DCMAKE_MAKE_PROGRAM=ninja" d.appendVar("DEPENDS", " ninja-native") - d.setVar("OECMAKE_GENERATOR_ARGS", "-G Ninja -DCMAKE_MAKE_PROGRAM=ninja") - d.setVarFlag("do_compile", "progress", "outof:^\[(\d+)/(\d+)\]\s+") + d.setVar("OECMAKE_GENERATOR_ARGS", args) + d.setVarFlag("do_compile", "progress", r"outof:^\[(\d+)/(\d+)\]\s+") else: bb.fatal("Unknown CMake Generator %s" % generator) + + # C/C++ Compiler (without cpu arch/tune arguments) + if not d.getVar('OECMAKE_C_COMPILER'): + cc_list = d.getVar('CC').split() + if cc_list[0] == 'ccache': + d.setVar('OECMAKE_C_COMPILER_LAUNCHER', cc_list[0]) + d.setVar('OECMAKE_C_COMPILER', cc_list[1]) + else: + d.setVar('OECMAKE_C_COMPILER', cc_list[0]) + + if not d.getVar('OECMAKE_CXX_COMPILER'): + cxx_list = d.getVar('CXX').split() + if cxx_list[0] == 'ccache': + d.setVar('OECMAKE_CXX_COMPILER_LAUNCHER', cxx_list[0]) + d.setVar('OECMAKE_CXX_COMPILER', cxx_list[1]) + else: + d.setVar('OECMAKE_CXX_COMPILER', cxx_list[0]) } -# C/C++ Compiler (without cpu arch/tune arguments) -OECMAKE_C_COMPILER ?= "`echo ${CC} | sed 's/^\([^ ]*\).*/\1/'`" -OECMAKE_CXX_COMPILER ?= "`echo ${CXX} | sed 's/^\([^ ]*\).*/\1/'`" OECMAKE_AR ?= "${AR}" # Compiler flags @@ -39,6 +51,9 @@ OECMAKE_CXX_LINK_FLAGS ?= "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} ${CXXFLAGS} ${LD CXXFLAGS += "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS}" CFLAGS += "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS}" +OECMAKE_C_COMPILER_LAUNCHER ?= "" +OECMAKE_CXX_COMPILER_LAUNCHER ?= "" + OECMAKE_RPATH ?= "" OECMAKE_PERLNATIVE_DIR ??= "" OECMAKE_EXTRA_ROOT_PATH ?= "" @@ -48,25 +63,31 @@ OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-native = "BOTH" EXTRA_OECMAKE_append = " ${PACKAGECONFIG_CONFARGS}" -EXTRA_OECMAKE_BUILD_prepend_task-compile = "${PARALLEL_MAKE} " -EXTRA_OECMAKE_BUILD_prepend_task-install = "${PARALLEL_MAKEINST} " +export CMAKE_BUILD_PARALLEL_LEVEL +CMAKE_BUILD_PARALLEL_LEVEL_task-compile = "${@oe.utils.parallel_make(d, False)}" +CMAKE_BUILD_PARALLEL_LEVEL_task-install = "${@oe.utils.parallel_make(d, True)}" OECMAKE_TARGET_COMPILE ?= "all" OECMAKE_TARGET_INSTALL ?= "install" -FILES_${PN}-dev += "${libdir}/cmake ${datadir}/cmake" +def map_host_os_to_system_name(host_os): + if host_os.startswith('mingw'): + return 'Windows' + if host_os.startswith('linux'): + return 'Linux' + return host_os # CMake expects target architectures in the format of uname(2), # which do not always match TARGET_ARCH, so all the necessary # conversions should happen here. -def map_target_arch_to_uname_arch(target_arch): - if target_arch == "powerpc": +def map_host_arch_to_uname_arch(host_arch): + if host_arch == "powerpc": return "ppc" - if target_arch == "powerpc64": + if host_arch == "powerpc64": return "ppc64" - return target_arch + return host_arch -cmakebuilder_do_generate_toolchain_file() { +cmake_do_generate_toolchain_file() { if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then cmake_crosscompiling="set( CMAKE_CROSSCOMPILING FALSE )" fi @@ -74,10 +95,12 @@ cmakebuilder_do_generate_toolchain_file() { # CMake system name must be something like "Linux". # This is important for cross-compiling. $cmake_crosscompiling -set( CMAKE_SYSTEM_NAME `echo ${TARGET_OS} | sed -e 's/^./\u&/' -e 's/^\(Linux\).*/\1/'` ) -set( CMAKE_SYSTEM_PROCESSOR ${@map_target_arch_to_uname_arch(d.getVar('TARGET_ARCH'))} ) +set( CMAKE_SYSTEM_NAME ${@map_host_os_to_system_name(d.getVar('HOST_OS'))} ) +set( CMAKE_SYSTEM_PROCESSOR ${@map_host_arch_to_uname_arch(d.getVar('HOST_ARCH'))} ) set( CMAKE_C_COMPILER ${OECMAKE_C_COMPILER} ) set( CMAKE_CXX_COMPILER ${OECMAKE_CXX_COMPILER} ) +set( CMAKE_C_COMPILER_LAUNCHER ${OECMAKE_C_COMPILER_LAUNCHER} ) +set( CMAKE_CXX_COMPILER_LAUNCHER ${OECMAKE_CXX_COMPILER_LAUNCHER} ) set( CMAKE_ASM_COMPILER ${OECMAKE_C_COMPILER} ) set( CMAKE_AR ${OECMAKE_AR} CACHE FILEPATH "Archiver" ) set( CMAKE_C_FLAGS "${OECMAKE_C_FLAGS}" CACHE STRING "CFLAGS" ) @@ -91,12 +114,12 @@ set( CMAKE_CXX_LINK_FLAGS "${OECMAKE_CXX_LINK_FLAGS}" CACHE STRING "LDFLAGS" ) # only search in the paths provided so cmake doesnt pick # up libraries and tools from the native build machine -# BC modify: it makes more sense to put OECMAKE_EXTRA_ROOT_PATH first in the list order matters for cmake, and we should prefer custom paths for libraries/executables/includes search. -set( CMAKE_FIND_ROOT_PATH ${OECMAKE_EXTRA_ROOT_PATH} ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${EXTERNAL_TOOLCHAIN}) +set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN} ${HOSTTOOLS_DIR}) set( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY ) set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ${OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM} ) set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY ) +set( CMAKE_PROGRAM_PATH "/" ) # Use qt.conf settings set( ENV{QT_CONF_PATH} ${WORKDIR}/qt.conf ) @@ -105,12 +128,19 @@ set( ENV{QT_CONF_PATH} ${WORKDIR}/qt.conf ) # directory as rpath by default set( CMAKE_INSTALL_RPATH ${OECMAKE_RPATH} ) -# Use native cmake modules +# Use RPATHs relative to build directory for reproducibility +set( CMAKE_BUILD_RPATH_USE_ORIGIN ON ) + +# Use our cmake modules list(APPEND CMAKE_MODULE_PATH "${STAGING_DATADIR}/cmake/Modules/") # add for non /usr/lib libdir, e.g. /usr/lib64 set( CMAKE_LIBRARY_PATH ${libdir} ${base_libdir}) +# add include dir to implicit includes in case it differs from /usr/include +list(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES ${includedir}) +list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES ${includedir}) + EOF } @@ -118,10 +148,11 @@ addtask generate_toolchain_file after do_patch before do_configure CONFIGURE_FILES = "CMakeLists.txt" -cmakebuilder_do_configure() { +cmake_do_configure() { if [ "${OECMAKE_BUILDPATH}" ]; then bbnote "cmake.bbclass no longer uses OECMAKE_BUILDPATH. The default behaviour is now out-of-tree builds with B=WORKDIR/build." fi + if [ "${S}" != "${B}" ]; then rm -rf ${B} mkdir -p ${B} @@ -142,30 +173,46 @@ cmakebuilder_do_configure() { $oecmake_sitefile \ ${OECMAKE_SOURCEPATH} \ -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \ - -DCMAKE_INSTALL_BINDIR:PATH=${@os.path.relpath(d.getVar('bindir'), d.getVar('prefix'))} \ - -DCMAKE_INSTALL_SBINDIR:PATH=${@os.path.relpath(d.getVar('sbindir'), d.getVar('prefix'))} \ - -DCMAKE_INSTALL_LIBEXECDIR:PATH=${@os.path.relpath(d.getVar('libexecdir'), d.getVar('prefix'))} \ + -DCMAKE_INSTALL_BINDIR:PATH=${@os.path.relpath(d.getVar('bindir'), d.getVar('prefix') + '/')} \ + -DCMAKE_INSTALL_SBINDIR:PATH=${@os.path.relpath(d.getVar('sbindir'), d.getVar('prefix') + '/')} \ + -DCMAKE_INSTALL_LIBEXECDIR:PATH=${@os.path.relpath(d.getVar('libexecdir'), d.getVar('prefix') + '/')} \ -DCMAKE_INSTALL_SYSCONFDIR:PATH=${sysconfdir} \ - -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=${@os.path.relpath(d.getVar('sharedstatedir'), d. getVar('prefix'))} \ + -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=${@os.path.relpath(d.getVar('sharedstatedir'), d. getVar('prefix') + '/')} \ -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=${localstatedir} \ - -DCMAKE_INSTALL_LIBDIR:PATH=${@os.path.relpath(d.getVar('libdir'), d.getVar('prefix'))} \ - -DCMAKE_INSTALL_INCLUDEDIR:PATH=${@os.path.relpath(d.getVar('includedir'), d.getVar('prefix'))} \ - -DCMAKE_INSTALL_DATAROOTDIR:PATH=${@os.path.relpath(d.getVar('datadir'), d.getVar('prefix'))} \ + -DCMAKE_INSTALL_LIBDIR:PATH=${@os.path.relpath(d.getVar('libdir'), d.getVar('prefix') + '/')} \ + -DCMAKE_INSTALL_INCLUDEDIR:PATH=${@os.path.relpath(d.getVar('includedir'), d.getVar('prefix') + '/')} \ + -DCMAKE_INSTALL_DATAROOTDIR:PATH=${@os.path.relpath(d.getVar('datadir'), d.getVar('prefix') + '/')} \ + -DPYTHON_EXECUTABLE:PATH=${PYTHON} \ + -DPython_EXECUTABLE:PATH=${PYTHON} \ + -DPython3_EXECUTABLE:PATH=${PYTHON} \ + -DLIB_SUFFIX=${@d.getVar('baselib').replace('lib', '')} \ -DCMAKE_INSTALL_SO_NO_EXE=0 \ -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \ - -DCMAKE_VERBOSE_MAKEFILE=1 \ -DCMAKE_NO_SYSTEM_FROM_IMPORTED=1 \ ${EXTRA_OECMAKE} \ -Wno-dev } +# To disable verbose cmake logs for a given recipe or globally config metadata e.g. local.conf +# add following +# +# CMAKE_VERBOSE = "" +# + +CMAKE_VERBOSE ??= "VERBOSE=1" + +# Then run do_compile again cmake_runcmake_build() { - bbnote ${DESTDIR:+DESTDIR=${DESTDIR} }VERBOSE=1 cmake --build '${B}' "$@" -- ${EXTRA_OECMAKE_BUILD} - eval ${DESTDIR:+DESTDIR=${DESTDIR} }VERBOSE=1 cmake --build '${B}' "$@" -- ${EXTRA_OECMAKE_BUILD} + bbnote ${DESTDIR:+DESTDIR=${DESTDIR} }${CMAKE_VERBOSE} cmake --build '${B}' "$@" -- ${EXTRA_OECMAKE_BUILD} + eval ${DESTDIR:+DESTDIR=${DESTDIR} }${CMAKE_VERBOSE} cmake --build '${B}' "$@" -- ${EXTRA_OECMAKE_BUILD} } -cmakebuilder_do_compile() { +cmake_do_compile() { cmake_runcmake_build --target ${OECMAKE_TARGET_COMPILE} } -EXPORT_FUNCTIONS do_configure do_compile do_generate_toolchain_file +cmake_do_install() { + DESTDIR='${D}' cmake_runcmake_build --target ${OECMAKE_TARGET_INSTALL} +} + +EXPORT_FUNCTIONS do_configure do_compile do_install do_generate_toolchain_file From 82184778544a22aa8e5a5393f277dded10fc7563 Mon Sep 17 00:00:00 2001 From: Linus Wallgren Date: Wed, 24 Feb 2021 10:35:47 +0100 Subject: [PATCH 07/13] cmakebuilder: Apply patch from meta-bc This ports the patch introduced in e27c739c097cbb69ad90b4bcfa108a5b3dd80f50 onto the dunfell version of cmake.bbclass --- classes/cmakebuilder.bbclass | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/classes/cmakebuilder.bbclass b/classes/cmakebuilder.bbclass index 8243f7c..3eb6982 100644 --- a/classes/cmakebuilder.bbclass +++ b/classes/cmakebuilder.bbclass @@ -87,7 +87,7 @@ def map_host_arch_to_uname_arch(host_arch): return "ppc64" return host_arch -cmake_do_generate_toolchain_file() { +cmakebuilder_do_generate_toolchain_file() { if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then cmake_crosscompiling="set( CMAKE_CROSSCOMPILING FALSE )" fi @@ -114,7 +114,8 @@ set( CMAKE_CXX_LINK_FLAGS "${OECMAKE_CXX_LINK_FLAGS}" CACHE STRING "LDFLAGS" ) # only search in the paths provided so cmake doesnt pick # up libraries and tools from the native build machine -set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN} ${HOSTTOOLS_DIR}) +# BC modify: it makes more sense to put OECMAKE_EXTRA_ROOT_PATH first in the list order matters for cmake, and we should prefer custom paths for libraries/executables/includes search. +set( CMAKE_FIND_ROOT_PATH ${OECMAKE_EXTRA_ROOT_PATH} ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${EXTERNAL_TOOLCHAIN} ${HOSTTOOLS_DIR}) set( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY ) set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ${OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM} ) set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) @@ -148,7 +149,7 @@ addtask generate_toolchain_file after do_patch before do_configure CONFIGURE_FILES = "CMakeLists.txt" -cmake_do_configure() { +cmakebuilder_do_configure() { if [ "${OECMAKE_BUILDPATH}" ]; then bbnote "cmake.bbclass no longer uses OECMAKE_BUILDPATH. The default behaviour is now out-of-tree builds with B=WORKDIR/build." fi @@ -207,12 +208,12 @@ cmake_runcmake_build() { eval ${DESTDIR:+DESTDIR=${DESTDIR} }${CMAKE_VERBOSE} cmake --build '${B}' "$@" -- ${EXTRA_OECMAKE_BUILD} } -cmake_do_compile() { +cmakebuilder_do_compile() { cmake_runcmake_build --target ${OECMAKE_TARGET_COMPILE} } -cmake_do_install() { - DESTDIR='${D}' cmake_runcmake_build --target ${OECMAKE_TARGET_INSTALL} -} +# cmakebuilder_do_install() { +# DESTDIR='${D}' cmake_runcmake_build --target ${OECMAKE_TARGET_INSTALL} +# } -EXPORT_FUNCTIONS do_configure do_compile do_install do_generate_toolchain_file +EXPORT_FUNCTIONS do_configure do_compile do_generate_toolchain_file From ca99ee44935cbfd38855ef89dd55d07ee299f8ab Mon Sep 17 00:00:00 2001 From: Hedvig Kamp Date: Thu, 21 Oct 2021 11:25:00 +0200 Subject: [PATCH 08/13] Add linphone-sdk_4.4.x.bb * linphone-sdk.bb has been removed upstream so this new file is added to keep information about what commit was used for version 4.4 --- .../linphone-sdk/linphone-sdk_4.4.x.bb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk_4.4.x.bb diff --git a/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk_4.4.x.bb b/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk_4.4.x.bb new file mode 100644 index 0000000..8e64272 --- /dev/null +++ b/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk_4.4.x.bb @@ -0,0 +1,16 @@ +# Used on the release 4.5 branch, for a stable version please use the "latest" recipe +VERSION_DEPENDENT_DEPENDS="python3-native python3-pystache-native python3-six-native" +VERSION_DEPENDENT_INHERIT="python3native" + +# The default commit sha used if LINPHONE_SDK_REV is not set and LATEST_REVISIONS disabled +# 4.5.14 +DEFAULT_COMMIT="d4d6356a615e2eec7ea1a957ec40f6fd143f6006" + +require linphone-sdk.inc + +inherit gitpkgv + +PR = "${INC_PR}.0" +PV = "4.5.x" +PKGV = "${GITPKGVTAG}" + From 662c6c688639e98ee6c1caf14d98287f6f8e163b Mon Sep 17 00:00:00 2001 From: Linus Wallgren Date: Wed, 24 Feb 2021 10:43:09 +0100 Subject: [PATCH 09/13] Migrate to use python3 instead of python2 python2 is no longer supported by dunfell --- recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk.inc b/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk.inc index 8cf66cb..a2fd423 100644 --- a/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk.inc +++ b/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk.inc @@ -6,7 +6,7 @@ SECTION_linphonec = "console/network" INC_PR = "r0" -DEPENDS = "git-native doxygen-native mariadb pulseaudio alsa-lib virtual/gettext sqlite3 mariadb zlib perl-native ${VERSION_DEPENDENT_DEPENDS}" +DEPENDS = "git-native doxygen-native python3native python3-pystache-native python3-six-native mariadb pulseaudio alsa-lib virtual/gettext sqlite3 mariadb zlib perl-native" PROVIDES = "linphone-sdk" From a5ae9352b13b5b49d2fabe588ecf790386362244 Mon Sep 17 00:00:00 2001 From: Linus Wallgren Date: Thu, 25 Feb 2021 15:38:11 +0100 Subject: [PATCH 10/13] Switch to sqlite3 per default --- recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk.inc b/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk.inc index a2fd423..1e0530d 100644 --- a/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk.inc +++ b/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk.inc @@ -6,7 +6,7 @@ SECTION_linphonec = "console/network" INC_PR = "r0" -DEPENDS = "git-native doxygen-native python3native python3-pystache-native python3-six-native mariadb pulseaudio alsa-lib virtual/gettext sqlite3 mariadb zlib perl-native" +DEPENDS = "git-native doxygen-native python3-native python3-pystache-native python3-six-native pulseaudio alsa-lib virtual/gettext sqlite3 zlib perl-native" PROVIDES = "linphone-sdk" @@ -51,7 +51,7 @@ PACKAGECONFIG[bzrtp]= " -DENABLE_BZRTP=YES, -DENABLE_BZRTP=NO" PACKAGECONFIG[mdns]= "-DENABLE_MDNS=YES,-DENABLE_MDNS=NO" EXTRA_OECMAKE ??= " " -EXTRA_OECMAKE += " -DENABLE_CONSOLE_UI=NO -DENABLE_GTK_UI=NO -DENABLE_CXX_WRAPPER=YES -DENABLE_VCARD=YES -DENABLE_VPX=NO -DENABLE_XML2=NO -DENABLE_SQLITE=NO -DENABLE_ZLIB=NO -DENABLE_SOCI_MYSQL=YES -DENABLE_LDAP=NO" +EXTRA_OECMAKE += " -DENABLE_CONSOLE_UI=NO -DENABLE_GTK_UI=NO -DENABLE_CXX_WRAPPER=YES -DENABLE_VCARD=YES -DENABLE_VPX=NO -DENABLE_XML2=NO -DENABLE_SQLITE=YES -DENABLE_ZLIB=NO -DENABLE_SOCI_MYSQL=NO" EXTRA_OECMAKE += " -DENABLE_UNIT_TESTS=YES -DENABLE_TESTS=YES" From 6516b4810c93edd49ba2aef250cdd88f088d3893 Mon Sep 17 00:00:00 2001 From: Hedvig Kamp Date: Thu, 21 Oct 2021 13:18:56 +0200 Subject: [PATCH 11/13] Upgrade to linphone 5 * Upgrade linphone-sdk to version 5 * This required disabling LDAP and enabling the DAEMON Due to rebasing on upstream yocto-sumo where linphone-sdk.bb had been removed, it was required to add linphone-sdk_5.0.x.bb to upgrade to linphone version 5. --- .../linphone-sdk/linphone-sdk/linphone-sdk.inc | 2 +- .../linphone-sdk/linphone-sdk_4.4.x.bb | 2 +- .../linphone-sdk/linphone-sdk_5.0.x.bb | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk_5.0.x.bb diff --git a/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk.inc b/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk.inc index 1e0530d..27c1327 100644 --- a/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk.inc +++ b/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk.inc @@ -51,7 +51,7 @@ PACKAGECONFIG[bzrtp]= " -DENABLE_BZRTP=YES, -DENABLE_BZRTP=NO" PACKAGECONFIG[mdns]= "-DENABLE_MDNS=YES,-DENABLE_MDNS=NO" EXTRA_OECMAKE ??= " " -EXTRA_OECMAKE += " -DENABLE_CONSOLE_UI=NO -DENABLE_GTK_UI=NO -DENABLE_CXX_WRAPPER=YES -DENABLE_VCARD=YES -DENABLE_VPX=NO -DENABLE_XML2=NO -DENABLE_SQLITE=YES -DENABLE_ZLIB=NO -DENABLE_SOCI_MYSQL=NO" +EXTRA_OECMAKE += " -DENABLE_CONSOLE_UI=NO -DENABLE_GTK_UI=NO -DENABLE_CXX_WRAPPER=YES -DENABLE_VCARD=YES -DENABLE_VPX=NO -DENABLE_XML2=NO -DENABLE_SQLITE=YES -DENABLE_ZLIB=NO -DENABLE_SOCI_MYSQL=NO -DENABLE_LDAP=NO -DENABLE_DAEMON=YES" EXTRA_OECMAKE += " -DENABLE_UNIT_TESTS=YES -DENABLE_TESTS=YES" diff --git a/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk_4.4.x.bb b/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk_4.4.x.bb index 8e64272..e0cc544 100644 --- a/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk_4.4.x.bb +++ b/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk_4.4.x.bb @@ -11,6 +11,6 @@ require linphone-sdk.inc inherit gitpkgv PR = "${INC_PR}.0" -PV = "4.5.x" +PV = "4.4.x" PKGV = "${GITPKGVTAG}" diff --git a/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk_5.0.x.bb b/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk_5.0.x.bb new file mode 100644 index 0000000..e1d3eb6 --- /dev/null +++ b/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk_5.0.x.bb @@ -0,0 +1,16 @@ +# Used on the release 4.5 branch, for a stable version please use the "latest" recipe +VERSION_DEPENDENT_DEPENDS="python3-native python3-pystache-native python3-six-native" +VERSION_DEPENDENT_INHERIT="python3native" + +# The default commit sha used if LINPHONE_SDK_REV is not set and LATEST_REVISIONS disabled +# 5.0.27 +DEFAULT_COMMIT="9e732013075c578fa4d54b4e535757af196212d7" + +require linphone-sdk.inc + +inherit gitpkgv + +PR = "${INC_PR}.0" +PV = "5.0.x" +PKGV = "${GITPKGVTAG}" + From 2b8868f46a97766104522ae4d17fd39ceb0a9a0c Mon Sep 17 00:00:00 2001 From: Hedvig Kamp Date: Thu, 21 Oct 2021 13:40:43 +0200 Subject: [PATCH 12/13] Set release branch 5.0 explicitely for linphone-sdk --- recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk.inc b/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk.inc index 27c1327..3fa5cd8 100644 --- a/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk.inc +++ b/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk.inc @@ -40,7 +40,7 @@ python () { print(d.getVar('SRCREV', True)) } -SRC_URI = "gitsm://gitlab.linphone.org/BC/public/linphone-sdk.git;protocol=https;branch=${LINPHONE_SDK_BRANCH};" +SRC_URI = "gitsm://gitlab.linphone.org/BC/public/linphone-sdk.git;protocol=https;branch=release/5.0;" LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=ff3103b5db8ba4e2c66c511b7a73e407" PACKAGECONFIG ??= "sqlite zlib bzrtp ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'video', '', d)}" From e45b35555c4b728943917c093c61a43b690de864 Mon Sep 17 00:00:00 2001 From: Hedvig Kamp Date: Tue, 26 Oct 2021 09:29:21 +0200 Subject: [PATCH 13/13] remove linphone-sdk_latest.bb --- .../linphone-sdk/linphone-sdk_latest.bb | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk_latest.bb diff --git a/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk_latest.bb b/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk_latest.bb deleted file mode 100644 index 80802b8..0000000 --- a/recipes-bc/linphone-sdk/linphone-sdk/linphone-sdk_latest.bb +++ /dev/null @@ -1,16 +0,0 @@ -# Same as the "4.5.x" recipe for the moment, this recipe must always evolve to -# work with the last stable linphone-sdk version. -VERSION_DEPENDENT_DEPENDS="python3-native python3-pystache-native python3-six-native" -VERSION_DEPENDENT_INHERIT="python3native" - -# The default commit sha used if LINPHONE_SDK_REV is not set and LATEST_REVISIONS disabled -# 5.0.0-alpha -DEFAULT_COMMIT="7320211a738ff5004fbe21e5bf37fb72181cc1f9" - -require linphone-sdk.inc - -inherit gitpkgv - -PR = "${INC_PR}.0" -PV = "latest" -PKGV = "${GITPKGVTAG}" \ No newline at end of file