From b8a03be4099bc0c8283c653fc700b1586646d26e Mon Sep 17 00:00:00 2001 From: Herb Kuta Date: Mon, 15 Apr 2019 11:11:28 -0700 Subject: [PATCH] DRAFT Add ros-distro/ros-distro.conf --- conf/ros-distro/include/empty.inc | 3 + conf/ros-distro/ros-distro.conf | 108 ++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+) create mode 100644 conf/ros-distro/include/empty.inc create mode 100644 conf/ros-distro/ros-distro.conf diff --git a/conf/ros-distro/include/empty.inc b/conf/ros-distro/include/empty.inc new file mode 100644 index 0000000..73ccfbb --- /dev/null +++ b/conf/ros-distro/include/empty.inc @@ -0,0 +1,3 @@ +# Empty file to satisfy "require" in ros-distro.conf when ROS_DISTRO == ROS1_COMPONENTS_BASELINE_DISTRO. +# +# Copyright (c) 2019 LG Electronics, Inc. diff --git a/conf/ros-distro/ros-distro.conf b/conf/ros-distro/ros-distro.conf new file mode 100644 index 0000000..dd172cc --- /dev/null +++ b/conf/ros-distro/ros-distro.conf @@ -0,0 +1,108 @@ +# Copyright (c) 2019 LG Electronics, Inc. +# +# Configuration settings common to all ROS_DISTRO-s. + +# All generated recipes have this set to "1" because they inherit ros_superflore_generated. +ROS_SUPERFLORE_GENERATED ??= "0" + +# Ensure that this always has a value when it's used to form DISTROOVERRIDES -- it's only explicitly set in generated recipes. +ROS_COMPONENT_TYPE ??= "unset" + +# Ensure that this always has a value -- it's only explicitly set in generated recipes. +ROS_BUILD_TYPE ??= "unset" + +# This is used to form the paths to the .inc files in the generated recipes. +ROS_LAYERDIR := "${LAYERDIR}" + +# ROS_DISTRO_COMPAT contains the list of ROS_DISTRO-s with which this branch of meta-ros is compatible (based on the versions of +# the platform packages provided by it and the branches of the upstream OE layers used). +ROS_DISTRO_COMPAT = "crystal" + + +# "1" or "2" +ROS_DISTRO_METADATA_VERSION_MAJOR = "${ROS_VERSION}" + +# Could covert the first letter to an integer, but everyone knows the ROS distro-s by their names, so just use it. +ROS_DISTRO_METADATA_VERSION_MINOR = "${ROS_DISTRO}" + +# Crystal releases have been given patch numbers, but none of the others have them => use the release date (YYYYMMDD) for the +# micro version, unless this is prior to the first release of a ROS_DISTRO, when the date portion of +# ROS_SUPERFLORE_GENERATION_DATETIME is used. +ROS_DISTRO_METADATA_VERSION_MICRO = "${@d.getVar('ROS_SUPERFLORE_GENERATION_DATETIME', True)[0:8] \ + if d.getVar('ROS_DISTRO_RELEASE_DATE', True) == '' else \ + d.getVar('ROS_DISTRO_RELEASE_DATE', True) \ + }" + +# Value determined by superflore and set in conf/ros-distro/include/ROS_DISTRO/generated-ros-distro.inc +ROS_NUM_CACHE_YAML_COMMITS ??= "0" +ROS_DISTRO_METADATA_VERSION_UPDATE = "${ROS_NUM_CACHE_YAML_COMMITS}" + +# ROS_DISTRO_METADATA_VERSION_REVISION is set to "0" in generated-ros-distro.inc and then is incremented there (manually) every +# time meta-ros is released because of a manually created change, ie, NOT as a result of a superflore run (which resets it to "0"). +ROS_DISTRO_METADATA_VERSION_REVISION ??= "0" + +ROS_DISTRO_METADATA_VERSION = "${ROS_DISTRO_METADATA_VERSION_MAJOR}.${ROS_DISTRO_METADATA_VERSION_MINOR}.${ROS_DISTRO_METADATA_VERSION_MICRO}.${ROS_DISTRO_METADATA_VERSION_UPDATE}" +ROS_DISTRO_METADATA_VERSION .= "${@'' \ + if d.getVar('ROS_DISTRO_METADATA_VERSION_REVISION', True) == '0' else \ + '-' + d.getVar('ROS_DISTRO_METADATA_VERSION_REVISION', True) \ + }" + +# NB. Can't use overrides to set this to ROS_DISTRO if ROS 1 because its value is needed below. +ROS1_COMPONENTS_BASELINE_DISTRO ?= "melodic" + +require conf/ros-distro/include/${ROS1_COMPONENTS_BASELINE_DISTRO}/generated-ros-distro.inc +# The list of components whose ROS_COMPONENT_TYPE is "ros1". NB. It is assumed that once a component is "ros1", it's always +# considered "ros1" even though a "ros2" edition of it might be built (or vice versa). +ROS1_COMPONENTS := "${ROS_SUPERFLORE_GENERATED_RECIPES_FOR_COMPONENTS}" + +# If ROS_DISTRO is unset, the build will abort with a ParseError when bitbake attempts to include a file with ROS_DISTRO in its +# path below. +ROS_DISTRO ?= "${@bb.error('ROS_DISTRO must be set in conf/bblayers.conf')}" + +# Bitbake complains if a file is included more than once. +require ${@'conf/ros-distro/include/empty.inc' \ + if d.getVar('ROS_DISTRO', True) == d.getVar('ROS1_COMPONENTS_BASELINE_DISTRO', True) else \ + 'conf/ros-distro/include/' + d.getVar('ROS_DISTRO', True) + '/generated-ros-distro.inc' \ + } + +require conf/ros-distro/include/${ROS_DISTRO}/generated-superflore-datetime.inc +require conf/ros-distro/include/${ROS_DISTRO}/ros-distro.inc + +# ROS_DISTRO_BASELINE_PLATFORM is set in ros-distro.inc . +require conf/ros-distro/include/${ROS_DISTRO_BASELINE_PLATFORM}/ros-distro-platform-preferred-providers.inc +require conf/ros-distro/include/${ROS_DISTRO_BASELINE_PLATFORM}/ros-distro-platform-recipe-blacklist.inc +require conf/ros-distro/include/${ROS_DISTRO_BASELINE_PLATFORM}/ros-distro-platform-preferred-versions.inc +require conf/ros-distro/include/${ROS_DISTRO}/ros-distro-preferred-providers.inc +require conf/ros-distro/include/${ROS_DISTRO}/ros-distro-recipe-blacklist.inc +require conf/ros-distro/include/${ROS_DISTRO}/ros-distro-preferred-versions.inc + + +# Give ROS billing in DISTRO_NAME if being used in a foreign DISTRO. +ROS_DISTRO_NAME_PREPEND ?= "${@'' \ + if d.getVar('DISTRO', True) == d.getVar('ROS_DISTRO_TYPE', True) else \ + 'ROS ' + d.getVar('ROS_VERSION', True) + ' with ' \ + }" +DISTRO_NAME_prepend = "${ROS_DISTRO_NAME_PREPEND}" + +# Append the ROS metadata version to DISTRO_VERSION if being used in a foreign DISTRO. +ROS_OE_DISTRO_VERSION_APPEND ?= "${@'' \ + if d.getVar('DISTRO', True) == d.getVar('ROS_DISTRO_TYPE', True) else \ + '+' + d.getVar('ROS_DISTRO_METADATA_VERSION', True) \ + }" +DISTRO_VERSION_append = "${ROS_OE_DISTRO_VERSION_APPEND}" + +# Default to showing DISTRO_NAME and the ROS build environment variable settings in the build configuration. +ROS_EXTRA_BUILDCFG_VARS ?= "DISTRO_NAME ROS_DISTRO ROS_VERSION ROS_PYTHON_VERSION" +BUILDCFG_VARS_append = " ${ROS_EXTRA_BUILDCFG_VARS}" + +# Allow images of different ROS_DISTRO-s to be distinguished. +ROS_IMAGE_BASENAME_APPEND ?= "-${ROS_DISTRO}" +IMAGE_BASENAME_append = "${ROS_IMAGE_BASENAME_APPEND}" + + +# If DISTRO is unset, the OE config sanity check will end up aborting the build after this ERROR message has been output a number +# of times. (An unset variable in an "include" line doesn't cause a ParseError the way it does in a "require" line.) +DISTRO ?= "${@bb.error('DISTRO must be set in conf/bblayers.conf (not conf/local.conf)')}" + +# Optionally include fixups for foreign DISTRO-s. +include conf/ros-distro/include/${DISTRO}-compat.inc