From b5ff1edf0b329525285305b49d6f7f14bc4a1f72 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 07:35:43 -0700 Subject: [PATCH 01/60] {humble} apriltag: Set SOABI in Python module Upstream changes set PY_DEST so that the Python module is installed in the correct directory. These changes also now use Python3_SOABI. This variable is introduced in CMake 3.26, but Kirkstone uses 3.22.3. Thus, we must supply PYTHON_SOABI in the recipe. Signed-off-by: Rob Woolley --- ...-CMakeLists.txt-allow-to-set-PY_DEST.patch | 55 ------------------- .../apriltag/apriltag/Set-Python-SOABI.patch | 13 +++++ .../apriltag/apriltag_3.4.0-1.bbappend | 15 +++-- 3 files changed, 24 insertions(+), 59 deletions(-) delete mode 100644 meta-ros2-humble/recipes-bbappends/apriltag/apriltag/0001-CMakeLists.txt-allow-to-set-PY_DEST.patch create mode 100644 meta-ros2-humble/recipes-bbappends/apriltag/apriltag/Set-Python-SOABI.patch diff --git a/meta-ros2-humble/recipes-bbappends/apriltag/apriltag/0001-CMakeLists.txt-allow-to-set-PY_DEST.patch b/meta-ros2-humble/recipes-bbappends/apriltag/apriltag/0001-CMakeLists.txt-allow-to-set-PY_DEST.patch deleted file mode 100644 index 70327fa6cda..00000000000 --- a/meta-ros2-humble/recipes-bbappends/apriltag/apriltag/0001-CMakeLists.txt-allow-to-set-PY_DEST.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 7ae39b993cdff4f5bca374cea8c44383a2d15de5 Mon Sep 17 00:00:00 2001 -From: Martin Jansa -Date: Mon, 6 Sep 2021 12:02:27 +0000 -Subject: [PATCH] CMakeLists.txt: allow to set PY_DEST - -* with OE we want to set it to PYTHON_SITEPACKAGES_DIR, because even with - python3targetconfig the site module returns paths to native sysroot: - - apriltag/3.1.5-1-r0/git$ python3 -m site - sys.path = [ - '/jenkins/mjansa/build/ros/ros2-rolling-hardknott/tmp-glibc/work/cortexa72-oe-linux/apriltag/3.1.5-1-r0/git', - '/jenkins/mjansa/build/ros/ros2-rolling-hardknott/tmp-glibc/work/cortexa72-oe-linux/apriltag/3.1.5-1-r0/recipe-sysroot-native/usr/lib/python39.zip', - '/jenkins/mjansa/build/ros/ros2-rolling-hardknott/tmp-glibc/work/cortexa72-oe-linux/apriltag/3.1.5-1-r0/recipe-sysroot-native/usr/lib/python3.9', - '/jenkins/mjansa/build/ros/ros2-rolling-hardknott/tmp-glibc/work/cortexa72-oe-linux/apriltag/3.1.5-1-r0/recipe-sysroot-native/usr/lib/python3.9/lib-dynload', - '/jenkins/mjansa/build/ros/ros2-rolling-hardknott/tmp-glibc/work/cortexa72-oe-linux/apriltag/3.1.5-1-r0/recipe-sysroot-native/usr/lib/python3.9/site-packages', - ] - USER_BASE: '/home/mjansa/.local' (exists) - USER_SITE: '/home/mjansa/.local/lib/python3.9/site-packages' (exists) - ENABLE_USER_SITE: False - - apriltag/3.1.5-1-r0/git$ python3 -c "import site; print(site.getsitepackages()[0])" - /jenkins/mjansa/build/ros/ros2-rolling-hardknott/tmp-glibc/work/cortexa72-oe-linux/apriltag/3.1.5-1-r0/recipe-sysroot-native/usr/lib/python3.9/site-packages - - apriltag/3.1.5-1-r0/git$ export _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata - - apriltag/3.1.5-1-r0/git$ python3 -c "import site; print(site.getsitepackages()[0])" - /jenkins/mjansa/build/ros/ros2-rolling-hardknott/tmp-glibc/work/cortexa72-oe-linux/apriltag/3.1.5-1-r0/recipe-sysroot-native/usr/lib/python3.9/site-packages - -* and currently used --user-site is even worse: - apriltag/3.1.5-1-r0/git$ python3 -m site --user-site - /home/mjansa/.local/lib/python3.6/site-packages - -Upstream-Status: Pending -Signed-off-by: Martin Jansa ---- - CMakeLists.txt | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index edde563..0d6c5ef 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -134,8 +134,10 @@ if (NOT Python3_NOT_FOUND AND NOT Numpy_NOT_FOUND AND PYTHONLIBS_FOUND AND BUILD - add_custom_target(apriltag_python ALL - DEPENDS apriltag${PY_EXT_SUFFIX}) - --execute_process(COMMAND python3 -m site --user-site OUTPUT_VARIABLE PY_DEST) --string(STRIP ${PY_DEST} PY_DEST) -+if (NOT PY_DEST) -+ execute_process(COMMAND python3 -m site --user-site OUTPUT_VARIABLE PY_DEST) -+ string(STRIP ${PY_DEST} PY_DEST) -+endif (NOT PY_DEST) - install(FILES ${PROJECT_BINARY_DIR}/apriltag${PY_EXT_SUFFIX} DESTINATION ${PY_DEST}) - endif (NOT Python3_NOT_FOUND AND NOT Numpy_NOT_FOUND AND PYTHONLIBS_FOUND AND BUILD_PYTHON_WRAPPER) - diff --git a/meta-ros2-humble/recipes-bbappends/apriltag/apriltag/Set-Python-SOABI.patch b/meta-ros2-humble/recipes-bbappends/apriltag/apriltag/Set-Python-SOABI.patch new file mode 100644 index 00000000000..7a4cb40122b --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/apriltag/apriltag/Set-Python-SOABI.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0571c58..0a1a374 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -169,7 +169,7 @@ if(BUILD_PYTHON_WRAPPER AND Python3_Development_FOUND AND Python3_NumPy_FOUND) + ) + + # set the SOABI manually since renaming the library via OUTPUT_NAME does not work on MSVC +- set(apriltag_py_target "apriltag.${Python3_SOABI}") ++ set(apriltag_py_target "apriltag.${PYTHON_SOABI}") + Python3_add_library(${apriltag_py_target} MODULE ${CMAKE_CURRENT_SOURCE_DIR}/apriltag_pywrap.c) + add_dependencies(${apriltag_py_target} apriltag_py_docstrings) + target_link_libraries(${apriltag_py_target} PRIVATE apriltag Python3::Python Python3::NumPy) diff --git a/meta-ros2-humble/recipes-bbappends/apriltag/apriltag_3.4.0-1.bbappend b/meta-ros2-humble/recipes-bbappends/apriltag/apriltag_3.4.0-1.bbappend index 7a225e5cf68..0aa43a47d6d 100644 --- a/meta-ros2-humble/recipes-bbappends/apriltag/apriltag_3.4.0-1.bbappend +++ b/meta-ros2-humble/recipes-bbappends/apriltag/apriltag_3.4.0-1.bbappend @@ -1,11 +1,18 @@ # Copyright (c) 2020-2021 LG Electronics, Inc. +# Copyright (c) 2024 Wind River Systems, Inc. inherit ros_insane_dev_so python3targetconfig +# Copied from ros_ament_cmake +# The SOABI setting changed in newer python3 with: +PYTHON_SOABI_ARCH = "${TUNE_ARCH}-${TARGET_OS}" +PYTHON_SOABI_ARCH_SUFFIX = "-gnu" +PYTHON_SOABI_ARCH_SUFFIX:arm = "" +PYTHON_SOABI_ARCH:i686 = "i386-${TARGET_OS}" +PYTHON_SOABI = "cpython-${@d.getVar('PYTHON_BASEVERSION').replace('.', '')}${PYTHON_ABI}-${PYTHON_SOABI_ARCH}${PYTHON_SOABI_ARCH_SUFFIX}" +EXTRA_OECMAKE:append:class-target = " -DPYTHON_SOABI=${PYTHON_SOABI}" + DEPENDS += "python3-numpy-native" -EXTRA_OECMAKE += "-DPY_DEST=${PYTHON_SITEPACKAGES_DIR}" FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" -SRC_URI += " \ - file://0001-CMakeLists.txt-allow-to-set-PY_DEST.patch \ -" +SRC_URI += "file://Set-Python-SOABI.patch" From 02a073400b481cd1a617b47815d27454e54f0871 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 07:42:22 -0700 Subject: [PATCH 02/60] {humble} as2-motion-controller: Remove pid-controller dependency The pid-controller dependency is no longer required. Signed-off-by: Rob Woolley --- .../aerostack2/as2-motion-controller_1.0.9-1.bbappend | 4 ---- 1 file changed, 4 deletions(-) diff --git a/meta-ros2-humble/recipes-bbappends/aerostack2/as2-motion-controller_1.0.9-1.bbappend b/meta-ros2-humble/recipes-bbappends/aerostack2/as2-motion-controller_1.0.9-1.bbappend index 04390a8a786..288ac0272cc 100644 --- a/meta-ros2-humble/recipes-bbappends/aerostack2/as2-motion-controller_1.0.9-1.bbappend +++ b/meta-ros2-humble/recipes-bbappends/aerostack2/as2-motion-controller_1.0.9-1.bbappend @@ -1,9 +1,5 @@ # Copyright (c) 2023 Wind River Systems, Inc. -ROS_BUILD_DEPENDS += " \ - pid-controller \ -" - ROS_BUILDTOOL_DEPENDS += " \ ament-cmake-ros-native \ " From 20905ae54f4e4504978d4a647851549504e4ee18 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 07:43:38 -0700 Subject: [PATCH 03/60] {humble} fields2cover: Replace gtest with googletest The googletest recipe provides gtest in OpenEmbedded. Signed-off-by: Rob Woolley --- .../fields2cover/fields2cover_2.0.0-1.bbappend | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta-ros2-humble/recipes-bbappends/fields2cover/fields2cover_2.0.0-1.bbappend b/meta-ros2-humble/recipes-bbappends/fields2cover/fields2cover_2.0.0-1.bbappend index b8c219caf25..f8645bc3651 100644 --- a/meta-ros2-humble/recipes-bbappends/fields2cover/fields2cover_2.0.0-1.bbappend +++ b/meta-ros2-humble/recipes-bbappends/fields2cover/fields2cover_2.0.0-1.bbappend @@ -25,6 +25,9 @@ ROS_BUILD_DEPENDS += " \ nlohmann-json \ " +ROS_EXEC_DEPENDS:remove = "gtest" +ROS_EXEC_DEPENDS:append = "googletest" + inherit python3native FILES:${PN} += " \ From 46422a7b037c7d84aad3833d39603abb2cd3375c Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 07:47:36 -0700 Subject: [PATCH 04/60] {humble} libphidget22: Fix SPDX identifier The identifer LGPL-3.0+ has been deprecated in favour of LGPL-3.0-or-later. Signed-off-by: Rob Woolley --- .../phidgets-drivers/libphidget22_2.3.3-1.bbappend | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-ros2-humble/recipes-bbappends/phidgets-drivers/libphidget22_2.3.3-1.bbappend b/meta-ros2-humble/recipes-bbappends/phidgets-drivers/libphidget22_2.3.3-1.bbappend index 938dce0857f..52c7ba6a4be 100644 --- a/meta-ros2-humble/recipes-bbappends/phidgets-drivers/libphidget22_2.3.3-1.bbappend +++ b/meta-ros2-humble/recipes-bbappends/phidgets-drivers/libphidget22_2.3.3-1.bbappend @@ -3,7 +3,7 @@ # WARNING: libphidget22-2.0.1-1-r0 do_populate_lic: libphidget22: No generic license file exists for: LGPL-2 in any provider # COPYING and COPYING.LESSER in libphidget22-1.4.20190605.tar.gz say GPL-3.0+ and LGPL-3.0+, source files have LGPL-3.0+ # headers only autotools files are GPL-3.0+ -LICENSE = "LGPL-3.0+" +LICENSE = "LGPL-3.0-or-later" DEPENDS += "${PN}-upstream" From 18bb0cf7a47e8329fb45f9f9438a9553c3f94993 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 07:49:41 -0700 Subject: [PATCH 05/60] {humble} libphidget22: Refresh integration patch Signed-off-by: Rob Woolley --- ...-libphidget22-from-libphidget22-upstream-and-norm.patch | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/meta-ros2-humble/recipes-bbappends/phidgets-drivers/libphidget22/0001-Use-libphidget22-from-libphidget22-upstream-and-norm.patch b/meta-ros2-humble/recipes-bbappends/phidgets-drivers/libphidget22/0001-Use-libphidget22-from-libphidget22-upstream-and-norm.patch index c148d9f334f..7dd98d5729c 100644 --- a/meta-ros2-humble/recipes-bbappends/phidgets-drivers/libphidget22/0001-Use-libphidget22-from-libphidget22-upstream-and-norm.patch +++ b/meta-ros2-humble/recipes-bbappends/phidgets-drivers/libphidget22/0001-Use-libphidget22-from-libphidget22-upstream-and-norm.patch @@ -13,7 +13,7 @@ Index: git/CMakeLists.txt =================================================================== --- git.orig/CMakeLists.txt +++ git/CMakeLists.txt -@@ -3,44 +3,6 @@ project(libphidget22) +@@ -3,43 +3,6 @@ project(libphidget22) find_package(ament_cmake REQUIRED) @@ -21,10 +21,9 @@ Index: git/CMakeLists.txt - -include(ExternalProject) -ExternalProject_Add(EP_${PROJECT_NAME} -- URL https://www.phidgets.com/downloads/phidget22/libraries/linux/libphidget22/libphidget22-1.13.20230224.tar.gz -- URL_MD5 e34f6bf266562d1950a82067ab5beaa9 +- URL https://www.phidgets.com/downloads/phidget22/libraries/linux/libphidget22/libphidget22-1.19.20240304.tar.gz +- URL_MD5 9b059eaef8cb8ce70b8abd7e4d309d1d - -- PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/patch/libphidget22-1.13.20230224-fix-warnings.patch - SOURCE_DIR ${PROJECT_BINARY_DIR}/${PROJECT_NAME}-src - CONFIGURE_COMMAND - /configure From 1332ea718414550f1dd3e97b9da58cc8ca85bbea Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 07:50:19 -0700 Subject: [PATCH 06/60] {humble} libphidget22-upstream: Update to 1.19 This is the latest version supported in ROS 2 Humble. Signed-off-by: Rob Woolley --- ....20230224.bb => libphidget22-upstream_1.19.20240304.bb} | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) rename meta-ros2-humble/recipes-devtools/libphidget22/{libphidget22-upstream_1.13.20230224.bb => libphidget22-upstream_1.19.20240304.bb} (76%) diff --git a/meta-ros2-humble/recipes-devtools/libphidget22/libphidget22-upstream_1.13.20230224.bb b/meta-ros2-humble/recipes-devtools/libphidget22/libphidget22-upstream_1.19.20240304.bb similarity index 76% rename from meta-ros2-humble/recipes-devtools/libphidget22/libphidget22-upstream_1.13.20230224.bb rename to meta-ros2-humble/recipes-devtools/libphidget22/libphidget22-upstream_1.19.20240304.bb index babefdb04d4..a81f9ff6901 100644 --- a/meta-ros2-humble/recipes-devtools/libphidget22/libphidget22-upstream_1.13.20230224.bb +++ b/meta-ros2-humble/recipes-devtools/libphidget22/libphidget22-upstream_1.19.20240304.bb @@ -12,13 +12,10 @@ DEPENDS = "libusb1" SRCNAME = "libphidget22" -SRC_URI = "https://www.phidgets.com/downloads/phidget22/libraries/linux/${SRCNAME}/${SRCNAME}-${PV}.tar.gz \ - https://raw.githubusercontent.com/ros-drivers/phidgets_drivers/humble/libphidget22/patch/libphidget22-1.13.20230224-fix-warnings.patch;name=patch \ -" +SRC_URI = "https://www.phidgets.com/downloads/phidget22/libraries/linux/${SRCNAME}/${SRCNAME}-${PV}.tar.gz" S = "${WORKDIR}/${SRCNAME}-${PV}" -SRC_URI[sha256sum] = "1d0795110517eb18c806472887cafc861dd0b6a1c1045246c555bc47f6bd77e3" -SRC_URI[patch.sha256sum] = "f72814e010526ec8affaff2886dc69f4d5dad4f34e562ff01ddcd69e44987081" +SRC_URI[sha256sum] = "1a9cc6329434dacfd7fd711c1a8a33ccc8e282b6eabc0bbcd5b71bed01bedfa1" inherit autotools From be317172abed7a8693eef19c9c5c65fea84ad1de Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 08:10:01 -0700 Subject: [PATCH 07/60] {common} libfyaml: Add new recipe The libfyaml receipe is needed by mrpt2. Signed-off-by: Rob Woolley --- .../recipes-support/libfyaml/libfyaml_0.9.bb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 meta-ros-common/recipes-support/libfyaml/libfyaml_0.9.bb diff --git a/meta-ros-common/recipes-support/libfyaml/libfyaml_0.9.bb b/meta-ros-common/recipes-support/libfyaml/libfyaml_0.9.bb new file mode 100644 index 00000000000..e3433ff69e2 --- /dev/null +++ b/meta-ros-common/recipes-support/libfyaml/libfyaml_0.9.bb @@ -0,0 +1,12 @@ +DESCRIPTION = "Fully feature complete YAML parser and emitter, supporting the latest YAML spec and passing the full YAML testsuite." +HOMEPAGE = "https://github.com/pantoniou/libfyaml" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=6399094fbc639a289cfca2d660c010aa" + +SRC_URI = "git://github.com/pantoniou/libfyaml.git;protocol=https;branch=master" +SRCREV = "8054c66e0454a09a810f756996d1b280738594e5" + +S = "${WORKDIR}/git" + +inherit autotools pkgconfig + From f973229251770fde6c9140aa0ed36f3f63ed8707 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 08:16:06 -0700 Subject: [PATCH 08/60] {common} nanogui: Add new recipe Add nanogui recipe as a dependency for mrpt2. Signed-off-by: Rob Woolley --- .../nanogui/0001-set-nanobind-dir.patch | 10 +++++ .../recipes-graphics/nanogui/nanogui_git.bb | 45 +++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 meta-ros-common/recipes-graphics/nanogui/nanogui/0001-set-nanobind-dir.patch create mode 100644 meta-ros-common/recipes-graphics/nanogui/nanogui_git.bb diff --git a/meta-ros-common/recipes-graphics/nanogui/nanogui/0001-set-nanobind-dir.patch b/meta-ros-common/recipes-graphics/nanogui/nanogui/0001-set-nanobind-dir.patch new file mode 100644 index 00000000000..6270b3fe9ce --- /dev/null +++ b/meta-ros-common/recipes-graphics/nanogui/nanogui/0001-set-nanobind-dir.patch @@ -0,0 +1,10 @@ +--- a/ext/nanobind/CMakeLists.txt ++++ b/ext/nanobind/CMakeLists.txt +@@ -129,6 +129,7 @@ + # Include nanobind cmake functionality + # --------------------------------------------------------------------------- + ++set(nanobind_DIR "${CMAKE_CURRENT_LIST_DIR}/cmake") + find_package(nanobind + PATHS ${CMAKE_CURRENT_SOURCE_DIR}/cmake + NO_DEFAULT_PATH) diff --git a/meta-ros-common/recipes-graphics/nanogui/nanogui_git.bb b/meta-ros-common/recipes-graphics/nanogui/nanogui_git.bb new file mode 100644 index 00000000000..40614712dde --- /dev/null +++ b/meta-ros-common/recipes-graphics/nanogui/nanogui_git.bb @@ -0,0 +1,45 @@ +DESCRIPTION = "Minimalistic C++/Python GUI library for OpenGL, GLES2/3, Metal, and WebAssembly/WebGL" +HOMEPAGE = "https://github.com/mitsuba-renderer/nanogui" +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=cea9322f8f8f3489fa38b53cf3c03983" + +DEPENDS = "glfw python3" + +S = "${WORKDIR}/git" + +SRC_URI = " \ + git://github.com/mitsuba-renderer/nanogui.git;name=nanogui;protocol=https;branch=master \ + git://github.com/wjakob/nanovg.git;name=nanovg;protocol=https;branch=master;destsuffix=git/ext/nanovg \ + git://github.com/wjakob/nanovg_metal.git;name=nanovg-metal;protocol=https;branch=master;destsuffix=git/ext/nanovg_metal \ + git://github.com/wjakob/nanobind.git;name=nanobind;protocol=https;branch=master;destsuffix=git/ext/nanobind \ + git://github.com/wjakob/glfw.git;name=glfw;protocol=https;branch=master;destsuffix=git/ext/glfw \ + git://github.com/Tessil/robin-map.git;name=robin-map;protocol=https;branch=master;destsuffix=git/ext/nanobind/ext/robin_map \ + file://0001-set-nanobind-dir.patch \ +" +SRCREV_nanogui = "2ee903c96480d4aee54542ea3c340c13cc06dc32" +SRCREV_nanovg = "7acc5d509f70e038d9229753d4b0f20e77e7f279" +SRCREV_nanovg-metal = "075b04f16c579728c693b46a2ce408f2325968cf" +SRCREV_nanobind = "ea2569f705b9d12185eea67db399a373d37c75aa" +SRCREV_glfw = "e130e55a990998c78fd323f21076e798e0efe8a4" +SRCREV_robin-map = "5eace6f74c9edff8e264c2d26a85365ad9ea149c" +SRCREV_FORMAT = "nanogui-nanvg-nanovg-metal-nanobind-glfw_robin-map" + +EXTRA_OECMAKE += "-DNANOGUI_NATIVE_FLAGS=" + +FILES:${PN} += " \ + ${libdir}/nanogui_ext.cpython-310-x86_64-linux-gnu.so \ + ${libdir}/libnanogui.so \ + ${datadir}/fonts/truetype/fonts-entypo/entypo.ttf \ +" + +FILES:${PN}-dev = "${includedir} ${datadir}/cmake" + +do_install:append () { + rm ${D}${includedir}/GLFW/* + + install -d ${D}${datadir}/fonts/truetype/fonts-entypo + install -m 0600 ${S}/docs/_static/entypo.ttf ${D}${datadir}/fonts/truetype/fonts-entypo +} + +INSANE_SKIP:${PN} += "already-stripped" +inherit cmake python3native From eb2c38a8d67788992aba7035444722bfee64aace Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 08:21:59 -0700 Subject: [PATCH 09/60] {humble} mrpt2: WIP: Add new recipe Receipe does not yet build. It currently fails on finding TrueType fonts: Could not find ENTYPO_TTF_FILE using the following files: entypo.ttf Signed-off-by: Rob Woolley --- .../mrpt2/mrpt2/0001-mrpt2-gui-pthread.patch | 11 +++ ...-fix-debian-bug-unambiguous-tracking.patch | 53 +++++++++++ ...dd-cmake-toolchain-file-to-nanoflann.patch | 12 +++ .../mrpt2/disable-host-system-dirs.patch | 41 +++++++++ .../mrpt2/mrpt2/enable-linking-octomap.patch | 34 +++++++ .../mrpt2/mrpt2/fix-nanogui-cmakelist.patch | 89 +++++++++++++++++++ .../mrpt2/mrpt2_2.12.1-1.bbappend | 56 ++++++++++++ .../recipes-bbappends/mrpt2/source.md | 2 + 8 files changed, 298 insertions(+) create mode 100644 meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2/0001-mrpt2-gui-pthread.patch create mode 100644 meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2/0002-fix-debian-bug-unambiguous-tracking.patch create mode 100644 meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2/add-cmake-toolchain-file-to-nanoflann.patch create mode 100644 meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2/disable-host-system-dirs.patch create mode 100644 meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2/enable-linking-octomap.patch create mode 100644 meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2/fix-nanogui-cmakelist.patch create mode 100644 meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2_2.12.1-1.bbappend create mode 100644 meta-ros2-humble/recipes-bbappends/mrpt2/source.md diff --git a/meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2/0001-mrpt2-gui-pthread.patch b/meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2/0001-mrpt2-gui-pthread.patch new file mode 100644 index 00000000000..365efea7f7d --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2/0001-mrpt2-gui-pthread.patch @@ -0,0 +1,11 @@ +Index: git/libs/gui/CMakeLists.txt +=================================================================== +--- git.orig/libs/gui/CMakeLists.txt ++++ git/libs/gui/CMakeLists.txt +@@ -68,4 +68,6 @@ if(BUILD_mrpt-gui) + if (MRPT_OPENGL_PROFILER) + target_compile_definitions(gui PRIVATE MRPT_OPENGL_PROFILER) + endif() ++ ++ target_link_libraries(gui PRIVATE Threads::Threads) + endif() diff --git a/meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2/0002-fix-debian-bug-unambiguous-tracking.patch b/meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2/0002-fix-debian-bug-unambiguous-tracking.patch new file mode 100644 index 00000000000..78844e32ac3 --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2/0002-fix-debian-bug-unambiguous-tracking.patch @@ -0,0 +1,53 @@ +Index: git/apps/benchmarking-image-features/src/mainwindow.h +=================================================================== +--- git.orig/apps/benchmarking-image-features/src/mainwindow.h ++++ git/apps/benchmarking-image-features/src/mainwindow.h +@@ -217,7 +217,7 @@ class MainWindow : public QMainWindow + int tracking_image_counter; //!< counter for moving forward in the dataset + + /** tracker oject which calls the tracking method to perform tracking */ +- ::Tracker tracker_obj; ++ tracker::Tracker tracker_obj; + + /// tracker parameter variables + QCheckBox* tracker_param1; //! Checkbox for tracking parameter 1 +Index: git/apps/benchmarking-image-features/src/tracker.cpp +=================================================================== +--- git.orig/apps/benchmarking-image-features/src/tracker.cpp ++++ git/apps/benchmarking-image-features/src/tracker.cpp +@@ -24,7 +24,7 @@ using namespace mrpt::img; + /************************************************************************************************ + * Tracker Constructor * + ************************************************************************************************/ +-Tracker::Tracker() ++tracker::Tracker::Tracker() + { + hasResolution = false; + step_num = 0; +@@ -43,7 +43,7 @@ Tracker::Tracker() + /************************************************************************************************ + * Track Them All tracker * + ************************************************************************************************/ +-cv::Mat Tracker::trackThemAll( ++cv::Mat tracker::Tracker::trackThemAll( + std::vector files_fullpath_tracking, + int tracking_image_counter, int remove_lost_feats, int add_new_feats, + int max_feats, int patch_size, int window_width, int window_height) +Index: git/apps/benchmarking-image-features/src/tracker.h +=================================================================== +--- git.orig/apps/benchmarking-image-features/src/tracker.h ++++ git/apps/benchmarking-image-features/src/tracker.h +@@ -48,6 +48,8 @@ + #include + #include + ++namespace tracker ++{ + class Tracker + { + public: +@@ -103,3 +105,4 @@ class Tracker + int tracking_image_counter, int remove_lost_feats, int add_new_feats, + int max_feats, int patch_size, int window_width, int window_height); + }; ++} diff --git a/meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2/add-cmake-toolchain-file-to-nanoflann.patch b/meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2/add-cmake-toolchain-file-to-nanoflann.patch new file mode 100644 index 00000000000..de0cea99a47 --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2/add-cmake-toolchain-file-to-nanoflann.patch @@ -0,0 +1,12 @@ +diff --git a/cmakemodules/script_nanoflann.cmake b/cmakemodules/script_nanoflann.cmake +index 82a07cae..8e1d2298 100644 +--- a/cmakemodules/script_nanoflann.cmake ++++ b/cmakemodules/script_nanoflann.cmake +@@ -19,6 +19,7 @@ if (NOT nanoflann_FOUND) + -DNANOFLANN_BUILD_EXAMPLES=OFF + -DNANOFLANN_BUILD_TESTS=OFF + -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} ++ -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} + RESULT_VARIABLE result + WORKING_DIRECTORY "${nanoflann_EMBEDDED_BUILD_DIR}" + ${echo_flag} diff --git a/meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2/disable-host-system-dirs.patch b/meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2/disable-host-system-dirs.patch new file mode 100644 index 00000000000..cba04daa630 --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2/disable-host-system-dirs.patch @@ -0,0 +1,41 @@ +diff --git a/libs/hwdrivers/CMakeLists.txt b/libs/hwdrivers/CMakeLists.txt +index c45fc79..600a298 100644 +--- a/libs/hwdrivers/CMakeLists.txt ++++ b/libs/hwdrivers/CMakeLists.txt +@@ -207,20 +207,22 @@ endif() + # have some errors: + if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_MRPT_HAS_FFMPEG_SYSTEM) + set(EXTRA_ISYSTEMS "") +- if(EXISTS "${LIBAVCODEC_INCLUDEDIR}") +- set(EXTRA_ISYSTEMS "-isystem ${LIBAVCODEC_INCLUDEDIR} ") +- endif() +- +- if(EXISTS "${LIBAVCODEC_INCLUDEDIR}/ffmpeg") +- set(EXTRA_ISYSTEMS "-isystem ${LIBAVCODEC_INCLUDEDIR}/ffmpeg ") +- endif() +- +- if(EXISTS "${LIBAVCODEC_INCLUDEDIR}/libavcodec") +- set(EXTRA_ISYSTEMS "-isystem ${LIBAVCODEC_INCLUDEDIR}/libavcodec ") +- endif() +- +- if(EXISTS "${LIBAVCODEC_INCLUDEDIR}/libavformat") +- set(EXTRA_ISYSTEMS "-isystem ${LIBAVCODEC_INCLUDEDIR}/libavformat ") ++ if (NOT "${LIBAVCODEC_INCLUDEDIR}" STREQUAL "/usr/include") ++ if(EXISTS "${LIBAVCODEC_INCLUDEDIR}") ++ set(EXTRA_ISYSTEMS "-isystem ${LIBAVCODEC_INCLUDEDIR} ") ++ endif() ++ ++ if(EXISTS "${LIBAVCODEC_INCLUDEDIR}/ffmpeg") ++ set(EXTRA_ISYSTEMS "-isystem ${LIBAVCODEC_INCLUDEDIR}/ffmpeg ") ++ endif() ++ ++ if(EXISTS "${LIBAVCODEC_INCLUDEDIR}/libavcodec") ++ set(EXTRA_ISYSTEMS "-isystem ${LIBAVCODEC_INCLUDEDIR}/libavcodec ") ++ endif() ++ ++ if(EXISTS "${LIBAVCODEC_INCLUDEDIR}/libavformat") ++ set(EXTRA_ISYSTEMS "-isystem ${LIBAVCODEC_INCLUDEDIR}/libavformat ") ++ endif() + endif() + + if (NOT "${EXTRA_ISYSTEMS}" STREQUAL "") diff --git a/meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2/enable-linking-octomap.patch b/meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2/enable-linking-octomap.patch new file mode 100644 index 00000000000..73120bd6cdb --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2/enable-linking-octomap.patch @@ -0,0 +1,34 @@ +diff --git a/libs/maps/CMakeLists.txt b/libs/maps/CMakeLists.txt +index 55139c9..27bdee2 100644 +--- a/libs/maps/CMakeLists.txt ++++ b/libs/maps/CMakeLists.txt +@@ -40,7 +40,7 @@ if(BUILD_mrpt-maps) + if(TARGET "EP_octomap") + add_dependencies(maps EP_octomap) + endif() +- target_link_libraries(maps PRIVATE ${OCTOMAP_LIBRARIES}) ++ target_link_libraries(maps PUBLIC ${OCTOMAP_LIBRARIES}) + endif() + + target_link_libraries(maps PRIVATE ${MRPT_OPENGL_LIBS}) +diff --git a/libs/nav/CMakeLists.txt b/libs/nav/CMakeLists.txt +index c6459bd..8a2c319 100644 +--- a/libs/nav/CMakeLists.txt ++++ b/libs/nav/CMakeLists.txt +@@ -25,3 +25,16 @@ define_mrpt_lib( + mrpt-maps + mrpt-kinematics + ) ++ ++if(BUILD_mrpt-nav) ++ if (CMAKE_MRPT_HAS_OCTOMAP) ++ if (NOT "${OCTOMAP_LIBRARY_DIRS}" STREQUAL "") ++ link_directories("${OCTOMAP_LIBRARY_DIRS}") ++ endif() ++ if(TARGET "EP_octomap") ++ add_dependencies(nav EP_octomap) ++ endif() ++ target_link_libraries(nav PUBLIC ${OCTOMAP_LIBRARIES}) ++ endif() ++ ++endif() diff --git a/meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2/fix-nanogui-cmakelist.patch b/meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2/fix-nanogui-cmakelist.patch new file mode 100644 index 00000000000..f108539c180 --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2/fix-nanogui-cmakelist.patch @@ -0,0 +1,89 @@ +diff --git a/3rdparty/nanogui/CMakeLists.txt b/3rdparty/nanogui/CMakeLists.txt +index fb22011d..1f0a2dbf 100644 +--- a/3rdparty/nanogui/CMakeLists.txt ++++ b/3rdparty/nanogui/CMakeLists.txt +@@ -6,7 +6,7 @@ if (POLICY CMP0058) + cmake_policy(SET CMP0058 NEW) + endif() + +-if (NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/ext/nanovg/src") ++if (NOT IS_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/ext/nanovg/src") + message(FATAL_ERROR "The NanoGUI dependency repositories (NANOVG, etc.) are missing! " + "You probably did not clone the project with --recursive. It is possible to recover " + "by calling \"git submodule update --init --recursive\"") +@@ -93,7 +93,7 @@ else() + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/") + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/") + +- add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/ext/glfw" "ext_build/glfw") ++ add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/ext/glfw" "ext_build/glfw") + # Two targets have now been defined: `glfw_objects`, which will be merged into + # NanoGUI at the end, and `glfw`. The `glfw` target is the library itself + # (e.g., libglfw.so), but can be skipped as we do not need to link against it +@@ -234,11 +234,11 @@ endif() + if (NANOGUI_USE_GLAD) + # Build and include GLAD on Windows + list(APPEND LIBNANOGUI_EXTRA_SOURCE +- "${CMAKE_CURRENT_SOURCE_DIR}/ext/glad/src/glad.c" +- "${CMAKE_CURRENT_SOURCE_DIR}/ext/glad/include/glad/glad.h" +- "${CMAKE_CURRENT_SOURCE_DIR}/ext/glad/include/KHR/khrplatform.h") ++ "${CMAKE_CURRENT_LIST_DIR}/ext/glad/src/glad.c" ++ "${CMAKE_CURRENT_LIST_DIR}/ext/glad/include/glad/glad.h" ++ "${CMAKE_CURRENT_LIST_DIR}/ext/glad/include/KHR/khrplatform.h") + if (MSVC) +- set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/ext/glad/src/glad.c" ++ set_source_files_properties("${CMAKE_CURRENT_LIST_DIR}/ext/glad/src/glad.c" + PROPERTIES COMPILE_FLAGS "/wd4055 ") + endif() + endif() +@@ -260,9 +260,9 @@ endif() + # * Roboto-Bold.ttf, Roboto-Regular.ttf => apt install fonts-roboto-fontface + # * entypo+ is a custom font from: https://github.com/svenevs/nanogui-entypo + # (it is NOT the same one as provided by the entypo debian package) +-find_file(ENTYPO_TTF_FILE entypo.ttf PATHS "${CMAKE_CURRENT_SOURCE_DIR}/resources" REQUIRED) +-find_file(ROBOTO_BOLD_TTF_FILE Roboto-Bold.ttf PATHS /usr/share/fonts/truetype/roboto-fontface/roboto/ "${CMAKE_CURRENT_SOURCE_DIR}/resources" REQUIRED) +-find_file(ROBOTO_REGULAR_TTF_FILE Roboto-Regular.ttf PATHS /usr/share/fonts/truetype/roboto-fontface/roboto/ "${CMAKE_CURRENT_SOURCE_DIR}/resources" REQUIRED) ++find_file(ENTYPO_TTF_FILE entypo.ttf PATHS "${CMAKE_CURRENT_LIST_DIR}/resources" REQUIRED) ++find_file(ROBOTO_BOLD_TTF_FILE Roboto-Bold.ttf PATHS "${CMAKE_CURRENT_LIST_DIR}/resources" REQUIRED) ++find_file(ROBOTO_REGULAR_TTF_FILE Roboto-Regular.ttf PATHS "${CMAKE_CURRENT_LIST_DIR}/resources" REQUIRED) + + # Glob up resource files + set(resources ${ENTYPO_TTF_FILE} ${ROBOTO_BOLD_TTF_FILE} ${ROBOTO_REGULAR_TTF_FILE}) +@@ -277,7 +277,7 @@ set(bin2c_cmdline + -DOUTPUT_C=nanogui_resources.cpp + -DOUTPUT_H=nanogui_resources.h + "-DINPUT_FILES=${resources_string}" +- -P "${CMAKE_CURRENT_SOURCE_DIR}/resources/bin2c.cmake") ++ -P "${CMAKE_CURRENT_LIST_DIR}/resources/bin2c.cmake") + + # Run bin2c on resource files + add_custom_command( +@@ -649,7 +649,7 @@ if (NANOGUI_BUILD_PYTHON) + # Detect Python + + # Try to autodetect Python (can be overridden manually if needed) +- list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/ext/pybind11/tools") ++ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/ext/pybind11/tools") + set(Python_ADDITIONAL_VERSIONS 3.7 3.6 3.5 3.4) + find_package(PythonLibsNew ${NANOGUI_PYTHON_VERSION}) + if (NOT PYTHONLIBS_FOUND) +@@ -762,8 +762,8 @@ else() + # Create documentation for python plugin (optional target for developers) + + string(REPLACE " " ";" MKDOC_CXX_FLAGS_LIST ${CMAKE_CXX_FLAGS}) +- get_property(MKDOC_INCLUDE_DIRECTORIES DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES) +- get_property(MKDOC_COMPILE_DEFINITIONS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY COMPILE_DEFINITIONS) ++ get_property(MKDOC_INCLUDE_DIRECTORIES DIRECTORY ${CMAKE_CURRENT_LIST_DIR} PROPERTY INCLUDE_DIRECTORIES) ++ get_property(MKDOC_COMPILE_DEFINITIONS DIRECTORY ${CMAKE_CURRENT_LIST_DIR} PROPERTY COMPILE_DEFINITIONS) + + foreach (value ${MKDOC_INCLUDE_DIRECTORIES}) + list(APPEND MKDOC_CXX_FLAGS_LIST -I${value}) +@@ -779,7 +779,7 @@ else() + python3 ${PROJECT_SOURCE_DIR}/docs/mkdoc_rst.py + ${MKDOC_CXX_FLAGS_LIST} + ${PROJECT_SOURCE_DIR}/include/nanogui/*.h +- > ${CMAKE_CURRENT_SOURCE_DIR}/python/py_doc.h) ++ > ${CMAKE_CURRENT_LIST_DIR}/python/py_doc.h) + + endif() + diff --git a/meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2_2.12.1-1.bbappend b/meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2_2.12.1-1.bbappend new file mode 100644 index 00000000000..0fb05272632 --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/mrpt2/mrpt2_2.12.1-1.bbappend @@ -0,0 +1,56 @@ +# Copyright (c) 2020 LG Electronics, Inc. +# Copyright (c) 2024 Wind River Systems, Inc. + +LICENSE = "BSD-3-Clause" + +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" + +SRC_URI += "file://disable-host-system-dirs.patch \ + file://enable-linking-octomap.patch \ + file://0001-mrpt2-gui-pthread.patch \ + file://0002-fix-debian-bug-unambiguous-tracking.patch \ + file://add-cmake-toolchain-file-to-nanoflann.patch \ +" +# Make this conditional on meta-qt5, because otherwise builds without +# meta-qt5 give the error "Could not inherit file classes/cmake_qt5.bbclass" +inherit ${@bb.utils.contains('BBFILE_COLLECTIONS', 'qt5-layer', 'cmake_qt5', '', d)} + +# CMake Error: TRY_RUN() invoked in cross-compiling mode, please set the following cache variables appropriately: +# HAS_LTO_EXITCODE (advanced) +# HAS_LTO_EXITCODE__TRYRUN_OUTPUT (advanced) +EXTRA_OECMAKE += "-DHAS_LTO_EXITCODE=1 -DHAS_LTO_EXITCODE__TRYRUN_OUTPUT=0" + +EXTRA_OECMAKE += "-DCMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES:PATH='${STAGING_INCDIR}'" + +# Otherwise it tries to build own version with ExternalProject_Add and fails +# ninja: error: 'lib/liboctomath.a', needed by 'lib/libmrpt-maps.so.2.0.4', missing and no known rule to make it +ROS_BUILD_DEPENDS += " \ + octomap \ +" + +inherit pkgconfig +inherit ros_ament_cmake + +ROS_BUILDTOOL_DEPENDS += " \ + ament-package-native \ +" + +ROS_BUILD_DEPENDS += " \ + ament-cmake-libraries \ + ament-cmake-export-definitions \ + ament-cmake-export-include-directories \ + ament-cmake-export-interfaces \ + ament-cmake-export-libraries \ + ament-cmake-export-link-flags \ + ament-cmake-export-targets \ + ament-cmake-gen-version-h \ + ament-cmake-python \ + ament-cmake-target-dependencies \ + ament-cmake-include-directories \ + ament-cmake-test \ + ament-cmake-version \ + nanogui \ + rosidl-adapter \ +" + +FILES_${PN} += "${datadir}/mrpt* ${datadir}/metainfo/* ${datadir}/mime/packages/*" diff --git a/meta-ros2-humble/recipes-bbappends/mrpt2/source.md b/meta-ros2-humble/recipes-bbappends/mrpt2/source.md new file mode 100644 index 00000000000..612d3a50b40 --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/mrpt2/source.md @@ -0,0 +1,2 @@ +# https://raw.githubusercontent.com/ros/meta-ros/master/meta-ros2-foxy/recipes-bbappends/mrpt2/mrpt2_2.1.3-1.bbappend +c1be6a77acfe5851105666ffe3ee9034 mrpt2_2.%.bbappend From f7a6181d329d64c5e14501cc5470089d5b3eefea Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 08:26:35 -0700 Subject: [PATCH 10/60] {common} jxrlib: Add new recipe Add recipe for jxrlib for freeimage, ogre-next, Gazebo and others. Using Debian as the upstream source including additional patches. Signed-off-by: Rob Woolley --- ...b032be1f6c75173bf603252e4f37bfded9fa.patch | 29 +++ ...7f88539b77d46ebf408b6a215930ae63bbdd.patch | 76 +++++++ ...f95783f2f81bd13bf1f8b03ceb12aa87d661.patch | 36 +++ ...6b78b7ad3205bdb91ef725b09ddbe3c8945d.patch | 56 +++++ .../jxrlib/jxrlib/bug771912.patch | 32 +++ .../jxrlib/jxrlib/bug803743.patch | 70 ++++++ .../jxrlib/jxrlib/bump_version.patch | 16 ++ .../jxrlib/jxrlib/cp1251.patch | 207 ++++++++++++++++++ .../recipes-graphics/jxrlib/jxrlib/pie.patch | 17 ++ .../jxrlib/jxrlib/pkg-config.patch | 23 ++ .../jxrlib/remove-hardcoded-defaults.patch | 22 ++ .../jxrlib/jxrlib/typos.patch | 16 ++ .../jxrlib/jxrlib/usecmake.patch | 144 ++++++++++++ .../recipes-graphics/jxrlib/jxrlib_1.2.bb | 27 +++ 14 files changed, 771 insertions(+) create mode 100644 meta-ros-common/recipes-graphics/jxrlib/jxrlib/082bb032be1f6c75173bf603252e4f37bfded9fa.patch create mode 100644 meta-ros-common/recipes-graphics/jxrlib/jxrlib/31df7f88539b77d46ebf408b6a215930ae63bbdd.patch create mode 100644 meta-ros-common/recipes-graphics/jxrlib/jxrlib/a684f95783f2f81bd13bf1f8b03ceb12aa87d661.patch create mode 100644 meta-ros-common/recipes-graphics/jxrlib/jxrlib/ab9c6b78b7ad3205bdb91ef725b09ddbe3c8945d.patch create mode 100644 meta-ros-common/recipes-graphics/jxrlib/jxrlib/bug771912.patch create mode 100644 meta-ros-common/recipes-graphics/jxrlib/jxrlib/bug803743.patch create mode 100644 meta-ros-common/recipes-graphics/jxrlib/jxrlib/bump_version.patch create mode 100644 meta-ros-common/recipes-graphics/jxrlib/jxrlib/cp1251.patch create mode 100644 meta-ros-common/recipes-graphics/jxrlib/jxrlib/pie.patch create mode 100644 meta-ros-common/recipes-graphics/jxrlib/jxrlib/pkg-config.patch create mode 100644 meta-ros-common/recipes-graphics/jxrlib/jxrlib/remove-hardcoded-defaults.patch create mode 100644 meta-ros-common/recipes-graphics/jxrlib/jxrlib/typos.patch create mode 100644 meta-ros-common/recipes-graphics/jxrlib/jxrlib/usecmake.patch create mode 100644 meta-ros-common/recipes-graphics/jxrlib/jxrlib_1.2.bb diff --git a/meta-ros-common/recipes-graphics/jxrlib/jxrlib/082bb032be1f6c75173bf603252e4f37bfded9fa.patch b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/082bb032be1f6c75173bf603252e4f37bfded9fa.patch new file mode 100644 index 00000000000..66af9afdc4c --- /dev/null +++ b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/082bb032be1f6c75173bf603252e4f37bfded9fa.patch @@ -0,0 +1,29 @@ +From 082bb032be1f6c75173bf603252e4f37bfded9fa Mon Sep 17 00:00:00 2001 +From: Milian Wolff +Date: Mon, 7 Jun 2021 09:45:26 +0200 +Subject: [PATCH] Use mkstemp instead of tmpnam + +tmpnam isn't threadsafe and shouldn't be used. Fixes compiler warning: +``` +warning: the use of 'tmpnam' is dangerous, better use 'mkstemp' +``` +--- + image/encode/strenc.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/image/encode/strenc.c b/image/encode/strenc.c +index d6e970e..65c277e 100644 +--- a/image/encode/strenc.c ++++ b/image/encode/strenc.c +@@ -482,8 +482,10 @@ Int StrIOEncInit(CWMImageStrCodec* pSC) + pSC->ppTempFile[i] = (char *)malloc(FILENAME_MAX * sizeof(char)); + if(pSC->ppTempFile[i] == NULL) return ICERR_ERROR; + +- if ((pFilename = tmpnam(NULL)) == NULL) ++ char tmpnambuf[] = {'f', 'i', 'l', 'e', 'X', 'X', 'X', 'X', 'X', 'X', '\0'}; ++ if (mkstemp(tmpnambuf) == -1) + return ICERR_ERROR; ++ pFilename = tmpnambuf; + strcpy(pSC->ppTempFile[i], pFilename); + #endif + if(CreateWS_File(pSC->ppWStream + i, pFilename, "w+b") != ICERR_OK) return ICERR_ERROR; diff --git a/meta-ros-common/recipes-graphics/jxrlib/jxrlib/31df7f88539b77d46ebf408b6a215930ae63bbdd.patch b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/31df7f88539b77d46ebf408b6a215930ae63bbdd.patch new file mode 100644 index 00000000000..328a938d662 --- /dev/null +++ b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/31df7f88539b77d46ebf408b6a215930ae63bbdd.patch @@ -0,0 +1,76 @@ +From 31df7f88539b77d46ebf408b6a215930ae63bbdd Mon Sep 17 00:00:00 2001 +From: Milian Wolff +Date: Mon, 7 Jun 2021 10:30:46 +0200 +Subject: [PATCH] Fix memory leaks when handling OOM scenario + +If the second or third allocation failed, the code would leak +the first and/or secon allocation. Free all buffers if we return +early to prevent this. +--- + jxrtestlib/JXRTestYUV.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +diff --git a/jxrtestlib/JXRTestYUV.c b/jxrtestlib/JXRTestYUV.c +index 52dc4ca..b803387 100644 +--- a/jxrtestlib/JXRTestYUV.c ++++ b/jxrtestlib/JXRTestYUV.c +@@ -120,6 +120,9 @@ ERR PKImageEncode_WritePixels_IYUV( + + if(pY == NULL || pU == NULL || pV == NULL) + { ++ free(pY); ++ free(pU); ++ free(pV); + return ICERR_ERROR; + } + +@@ -198,6 +201,9 @@ ERR PKImageEncode_WritePixels_YUV422( + + if(pY == NULL || pU == NULL || pV == NULL) + { ++ free(pY); ++ free(pU); ++ free(pV); + return ICERR_ERROR; + } + //YYUV +@@ -273,6 +279,9 @@ ERR PKImageEncode_WritePixels_YUV444( + + if(pY == NULL || pU == NULL || pV == NULL) + { ++ free(pY); ++ free(pU); ++ free(pV); + return ICERR_ERROR; + } + +@@ -491,6 +500,9 @@ ERR PKImageDecode_Copy_IYUV( + + if(pY == NULL || pU == NULL || pV == NULL) + { ++ free(pY); ++ free(pU); ++ free(pV); + return ICERR_ERROR; + } + +@@ -564,6 +576,9 @@ ERR PKImageDecode_Copy_YUV422( + + if(pY == NULL || pU == NULL || pV == NULL) + { ++ free(pY); ++ free(pU); ++ free(pV); + return ICERR_ERROR; + } + +@@ -635,6 +650,9 @@ ERR PKImageDecode_Copy_YUV444( + + if(pY == NULL || pU == NULL || pV == NULL) + { ++ free(pY); ++ free(pU); ++ free(pV); + return ICERR_ERROR; + } + diff --git a/meta-ros-common/recipes-graphics/jxrlib/jxrlib/a684f95783f2f81bd13bf1f8b03ceb12aa87d661.patch b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/a684f95783f2f81bd13bf1f8b03ceb12aa87d661.patch new file mode 100644 index 00000000000..06cce14d184 --- /dev/null +++ b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/a684f95783f2f81bd13bf1f8b03ceb12aa87d661.patch @@ -0,0 +1,36 @@ +From a684f95783f2f81bd13bf1f8b03ceb12aa87d661 Mon Sep 17 00:00:00 2001 +From: Milian Wolff +Date: Mon, 7 Jun 2021 10:00:09 +0200 +Subject: [PATCH] fix undefined behavior for left-shift of -1 + +My hunch is that (-1 << 31) tries to build INT_MIN, so use that +directly. Compare: + +1 << 31 = 2147483648 +INT_MIN = -2147483648 +--- + image/sys/adapthuff.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/image/sys/adapthuff.c b/image/sys/adapthuff.c +index a690889..cd83034 100644 +--- a/image/sys/adapthuff.c ++++ b/image/sys/adapthuff.c +@@ -28,6 +28,8 @@ + + #include "strcodec.h" + ++#include ++ + #ifdef MEM_TRACE + #define TRACE_MALLOC 1 + #define TRACE_NEW 0 +@@ -459,7 +461,7 @@ Void AdaptDiscriminant (CAdaptiveHuffman *pAdHuff) + assert (t < gMaxTables[iSym]); + + //pAdHuff->m_iDiscriminant >>= 1; +- pAdHuff->m_iLowerBound = (t == 0) ? (-1 << 31) : -THRESHOLD; ++ pAdHuff->m_iLowerBound = (t == 0) ? INT_MIN : -THRESHOLD; + pAdHuff->m_iUpperBound = (t == gMaxTables[iSym] - 1) ? (1 << 30) : THRESHOLD; + + switch (iSym) { diff --git a/meta-ros-common/recipes-graphics/jxrlib/jxrlib/ab9c6b78b7ad3205bdb91ef725b09ddbe3c8945d.patch b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/ab9c6b78b7ad3205bdb91ef725b09ddbe3c8945d.patch new file mode 100644 index 00000000000..54bf84fc97e --- /dev/null +++ b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/ab9c6b78b7ad3205bdb91ef725b09ddbe3c8945d.patch @@ -0,0 +1,56 @@ +From ab9c6b78b7ad3205bdb91ef725b09ddbe3c8945d Mon Sep 17 00:00:00 2001 +From: Milian Wolff +Date: Mon, 7 Jun 2021 09:56:37 +0200 +Subject: [PATCH] fix warnings about unaligned loads from UBSAN + +Use memcpy instead to ensure that we don't get warnings about +unaligned loads from UBSAN: + +``` +../3rdParty/jxrlib/image/decode/segdec.c:66:12: runtime error: load of misaligned address 0x7fc3a0544006 for type 'U32', which requires 4 byte alignment +0x7fc3a0544006: note: pointer points here + 01 01 a5 c0 b0 7c 0a 06 05 00 0c 14 10 c2 c0 30 80 38 72 41 ae 1a 8f 54 26 c2 9e f6 c1 25 a9 65 + ^ + #0 0x7fc3e137429a in _load4 ../3rdParty/jxrlib/image/decode/segdec.c:66 + #1 0x7fc3e13748b8 in _flushBit16 ../3rdParty/jxrlib/image/decode/segdec.c:80 + #2 0x7fc3e13749a6 in _getBit16 ../3rdParty/jxrlib/image/decode/segdec.c:86 + #3 0x7fc3e1385d75 in DecodeMacroblockDC ../3rdParty/jxrlib/image/decode/segdec.c:1224 + #4 0x7fc3e131924a in processMacroblockDec ../3rdParty/jxrlib/image/decode/strdec.c:412 + #5 0x7fc3e137207a in ImageStrDecDecode ../3rdParty/jxrlib/image/decode/strdec.c:4003 + #6 0x7fc3e126c0b2 in PKImageDecode_Copy_WMP ../3rdParty/jxrlib/jxrgluelib/JXRGlueJxr.c:1874 +``` +--- + image/decode/segdec.c | 4 +++- + image/sys/strcodec.c | 4 +++- + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/image/decode/segdec.c b/image/decode/segdec.c +index fb83f2b..3c890af 100644 +--- a/image/decode/segdec.c ++++ b/image/decode/segdec.c +@@ -63,7 +63,9 @@ static U32 _FORCEINLINE _load4(void* pv) + v |= ((U32)((U16 *) pv)[1]) << 16; + return _byteswap_ulong(v); + #else // _M_IA64 +- return _byteswap_ulong(*(U32*)pv); ++ U32 v; ++ memcpy(&v, pv, sizeof(U32)); ++ return _byteswap_ulong(v); + #endif // _M_IA64 + #endif // _BIG__ENDIAN_ + } +diff --git a/image/sys/strcodec.c b/image/sys/strcodec.c +index c746d6f..b0989dd 100644 +--- a/image/sys/strcodec.c ++++ b/image/sys/strcodec.c +@@ -694,7 +694,9 @@ U32 load4BE(void* pv) + v |= ((U32)((U16 *) pv)[1]) << 16; + return _byteswap_ulong(v); + #else // _M_IA64 +- return _byteswap_ulong(*(U32*)pv); ++ U32 v; ++ memcpy(&v, pv, sizeof(U32)); ++ return _byteswap_ulong(v); + #endif // _M_IA64 + #endif // _BIG__ENDIAN_ + } diff --git a/meta-ros-common/recipes-graphics/jxrlib/jxrlib/bug771912.patch b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/bug771912.patch new file mode 100644 index 00000000000..a9ca33c73e1 --- /dev/null +++ b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/bug771912.patch @@ -0,0 +1,32 @@ +Description: Document PNM output +Author: Mathieu Malaterre +Bug-Debian: https://bugs.debian.org/771912 +Forwarded: https://github.com/4creators/jxrlib/pull/4 +Last-Update: 2021-11-26 + +--- jxrlib-1.2~git20170615.f752187.orig/jxrencoderdecoder/JxrDecApp.c ++++ jxrlib-1.2~git20170615.f752187/jxrencoderdecoder/JxrDecApp.c +@@ -82,8 +82,9 @@ void WmpDecAppUsage(const char* szExe) + printf(CRLF); + printf(" -i input.jxr/wdp Input JPEG XR/HD Photo file name" CRLF); + printf(CRLF); +- printf(" -o output.bmp/tif/jxr Output image file name" CRLF); ++ printf(" -o output.bmp/pnm/tif/jxr Output image file name" CRLF); + printf(" bmp: <=8bpc, BGR" CRLF); ++ printf(" pnm: >=8bpc, RGB" CRLF); + printf(" tif: >=8bpc, RGB" CRLF); + printf(" jxr: for compressed domain transcode" CRLF); + printf(CRLF); +--- jxrlib-1.2~git20170615.f752187.orig/jxrencoderdecoder/JxrEncApp.c ++++ jxrlib-1.2~git20170615.f752187/jxrencoderdecoder/JxrEncApp.c +@@ -55,8 +55,9 @@ void WmpEncAppUsage(const char* szExe) + printf(CRLF); + printf("%s [options]..." CRLF, szExe); + printf(CRLF); +- printf(" -i input.bmp/tif/hdr Input image file name" CRLF); ++ printf(" -i input.bmp/pnm/tif/hdr Input image file name" CRLF); + printf(" bmp: <=8bpc, BGR" CRLF); ++ printf(" pnm: >=8bpc, RGB" CRLF); + printf(" tif: >=8bpc, RGB" CRLF); + printf(" hdr: 32bppRGBE only" CRLF); + printf(CRLF); diff --git a/meta-ros-common/recipes-graphics/jxrlib/jxrlib/bug803743.patch b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/bug803743.patch new file mode 100644 index 00000000000..d2d8e720944 --- /dev/null +++ b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/bug803743.patch @@ -0,0 +1,70 @@ +Description: libjxr-dev: Missing pkgconfig file +Author: Mathieu Malaterre +Bug-Debian: https://bugs.debian.org/803743 +Forwarded: no +Last-Update: 2021-11-26 + +Index: jxrlib/libjxr.pc.in +=================================================================== +--- jxrlib.orig/libjxr.pc.in ++++ jxrlib/libjxr.pc.in +@@ -1,4 +1,4 @@ +-prefix=%(DIR_INSTALL)s ++prefix=@DIR_INSTALL@ + exec_prefix=${prefix} + libdir=${exec_prefix}/lib + includedir=${prefix}/include +@@ -6,7 +6,7 @@ includedir=${prefix}/include + Name: libjxr + Description: A library for reading JPEG XR images. + +-Version: %(JXR_VERSION)s ++Version: @JXR_VERSION@ + Libs: -L${libdir} -ljpegxr -ljxrglue + Libs.private: -lm +-Cflags: -I${includedir}/libjxr/common -I${includedir}/libjxr/image/x86 -I${includedir}/libjxr/image -I${includedir}/libjxr/glue -I${includedir}/libjxr/test -D__ANSI__ -DDISABLE_PERF_MEASUREMENT %(JXR_ENDIAN)s ++Cflags: -I${includedir}/libjxr/common -I${includedir}/libjxr/image/x86 -I${includedir}/libjxr/image -I${includedir}/libjxr/glue -I${includedir}/libjxr/test -D__ANSI__ -DDISABLE_PERF_MEASUREMENT @JXR_ENDIAN@ +Index: jxrlib/CMakeLists.txt +=================================================================== +--- jxrlib.orig/CMakeLists.txt ++++ jxrlib/CMakeLists.txt +@@ -17,6 +17,7 @@ include(TestBigEndian) + test_big_endian(ISBIGENDIAN) + if(ISBIGENDIAN) + set(DEF_ENDIAN _BIG__ENDIAN_) ++ set(JXR_ENDIAN "-D${DEF_ENDIAN}") + endif() + + set(DIR_SYS image/sys) +@@ -73,7 +74,8 @@ set_property(TARGET jpegxr + set_property(TARGET jpegxr PROPERTY LINK_INTERFACE_LIBRARIES "") + set_property(TARGET jpegxr PROPERTY COMPILE_FLAGS -w) + # VERSION/SOVERSION +-set_property(TARGET jpegxr PROPERTY VERSION 1.1) ++set(JXR_VERSION "1.1") ++set_property(TARGET jpegxr PROPERTY VERSION ${JXR_VERSION}) + set_property(TARGET jpegxr PROPERTY SOVERSION 0) + install(TARGETS jpegxr + EXPORT JXRLibTargets +@@ -94,7 +96,7 @@ set_property(TARGET jxrglue + #set_property(TARGET jxrglue PROPERTY LINK_INTERFACE_LIBRARIES "") + set_property(TARGET jxrglue PROPERTY COMPILE_FLAGS -w) + # VERSION/SOVERSION +-set_property(TARGET jxrglue PROPERTY VERSION 1.1) ++set_property(TARGET jxrglue PROPERTY VERSION ${JXR_VERSION}) + set_property(TARGET jxrglue PROPERTY SOVERSION 0) + install(TARGETS jxrglue + EXPORT JXRLibTargets +@@ -133,3 +135,12 @@ install(FILES jxrgluelib/JXRGlue.h jxrgl + install(DIRECTORY common/include/ DESTINATION ${JXRLIB_INSTALL_INCLUDE_DIR} + FILES_MATCHING PATTERN "*.h" + ) ++ ++set(DIR_INSTALL ${CMAKE_INSTALL_PREFIX}) ++configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libjxr.pc.in ++ ${CMAKE_CURRENT_BINARY_DIR}/libjxr.pc ++ @ONLY ++) ++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libjxr.pc ++ DESTINATION ${JXRLIB_INSTALL_LIB_DIR}/pkgconfig COMPONENT Header ++) diff --git a/meta-ros-common/recipes-graphics/jxrlib/jxrlib/bump_version.patch b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/bump_version.patch new file mode 100644 index 00000000000..b9e7b8d93f4 --- /dev/null +++ b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/bump_version.patch @@ -0,0 +1,16 @@ +Description: Version is 1.2 +Author: Mathieu Malaterre +Forwarded: not-needed +Last-Update: 2021-11-26 + +--- jxrlib-1.2~git20170615.f752187.orig/CMakeLists.txt ++++ jxrlib-1.2~git20170615.f752187/CMakeLists.txt +@@ -74,7 +74,7 @@ set_property(TARGET jpegxr + set_property(TARGET jpegxr PROPERTY LINK_INTERFACE_LIBRARIES "") + set_property(TARGET jpegxr PROPERTY COMPILE_FLAGS -w) + # VERSION/SOVERSION +-set(JXR_VERSION "1.1") ++set(JXR_VERSION "1.2") + set_property(TARGET jpegxr PROPERTY VERSION ${JXR_VERSION}) + set_property(TARGET jpegxr PROPERTY SOVERSION 0) + install(TARGETS jpegxr diff --git a/meta-ros-common/recipes-graphics/jxrlib/jxrlib/cp1251.patch b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/cp1251.patch new file mode 100644 index 00000000000..a292730f204 --- /dev/null +++ b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/cp1251.patch @@ -0,0 +1,207 @@ +Description: Convert some national-encoding file to utf-8 + W: libjxr-dev: national-encoding usr/include/jxrlib/wmsal.h + Steps: + % iconv -f CP1251 -t UTF-8 input.h -o input.h +Author: Mathieu Malaterre +Forwarded: not-needed +Last-Update: 2021-11-26 + +Index: jxrlib/jxrgluelib/JXRMeta.h +=================================================================== +--- jxrlib.orig/jxrgluelib/JXRMeta.h ++++ jxrlib/jxrgluelib/JXRMeta.h +@@ -1,14 +1,14 @@ + //*@@@+++@@@@****************************************************************** + // +-// Copyright © Microsoft Corp. ++// Copyright © Microsoft Corp. + // All rights reserved. + // + // Redistribution and use in source and binary forms, with or without + // modification, are permitted provided that the following conditions are met: + // +-// • Redistributions of source code must retain the above copyright notice, ++// • Redistributions of source code must retain the above copyright notice, + // this list of conditions and the following disclaimer. +-// • Redistributions in binary form must reproduce the above copyright notice, ++// • Redistributions in binary form must reproduce the above copyright notice, + // this list of conditions and the following disclaimer in the documentation + // and/or other materials provided with the distribution. + // +Index: jxrlib/jxrtestlib/JXRTest.h +=================================================================== +--- jxrlib.orig/jxrtestlib/JXRTest.h ++++ jxrlib/jxrtestlib/JXRTest.h +@@ -1,14 +1,14 @@ + //*@@@+++@@@@****************************************************************** + // +-// Copyright © Microsoft Corp. ++// Copyright © Microsoft Corp. + // All rights reserved. + // + // Redistribution and use in source and binary forms, with or without + // modification, are permitted provided that the following conditions are met: + // +-// • Redistributions of source code must retain the above copyright notice, ++// • Redistributions of source code must retain the above copyright notice, + // this list of conditions and the following disclaimer. +-// • Redistributions in binary form must reproduce the above copyright notice, ++// • Redistributions in binary form must reproduce the above copyright notice, + // this list of conditions and the following disclaimer in the documentation + // and/or other materials provided with the distribution. + // +Index: jxrlib/common/include/guiddef.h +=================================================================== +--- jxrlib.orig/common/include/guiddef.h ++++ jxrlib/common/include/guiddef.h +@@ -1,14 +1,14 @@ + //+--------------------------------------------------------------------------- + // +-// Copyright © Microsoft Corp. ++// Copyright © Microsoft Corp. + // All rights reserved. + // + // Redistribution and use in source and binary forms, with or without + // modification, are permitted provided that the following conditions are met: + // +-// • Redistributions of source code must retain the above copyright notice, ++// • Redistributions of source code must retain the above copyright notice, + // this list of conditions and the following disclaimer. +-// • Redistributions in binary form must reproduce the above copyright notice, ++// • Redistributions in binary form must reproduce the above copyright notice, + // this list of conditions and the following disclaimer in the documentation + // and/or other materials provided with the distribution. + // +Index: jxrlib/common/include/wmspecstring.h +=================================================================== +--- jxrlib.orig/common/include/wmspecstring.h ++++ jxrlib/common/include/wmspecstring.h +@@ -1,14 +1,14 @@ + //*@@@+++@@@@****************************************************************** + // +-// Copyright © Microsoft Corp. ++// Copyright © Microsoft Corp. + // All rights reserved. + // + // Redistribution and use in source and binary forms, with or without + // modification, are permitted provided that the following conditions are met: + // +-// • Redistributions of source code must retain the above copyright notice, ++// • Redistributions of source code must retain the above copyright notice, + // this list of conditions and the following disclaimer. +-// • Redistributions in binary form must reproduce the above copyright notice, ++// • Redistributions in binary form must reproduce the above copyright notice, + // this list of conditions and the following disclaimer in the documentation + // and/or other materials provided with the distribution. + // +Index: jxrlib/image/sys/windowsmediaphoto.h +=================================================================== +--- jxrlib.orig/image/sys/windowsmediaphoto.h ++++ jxrlib/image/sys/windowsmediaphoto.h +@@ -1,14 +1,14 @@ + //*@@@+++@@@@****************************************************************** + // +-// Copyright © Microsoft Corp. ++// Copyright © Microsoft Corp. + // All rights reserved. + // + // Redistribution and use in source and binary forms, with or without + // modification, are permitted provided that the following conditions are met: + // +-// • Redistributions of source code must retain the above copyright notice, ++// • Redistributions of source code must retain the above copyright notice, + // this list of conditions and the following disclaimer. +-// • Redistributions in binary form must reproduce the above copyright notice, ++// • Redistributions in binary form must reproduce the above copyright notice, + // this list of conditions and the following disclaimer in the documentation + // and/or other materials provided with the distribution. + // +Index: jxrlib/common/include/wmspecstrings_adt.h +=================================================================== +--- jxrlib.orig/common/include/wmspecstrings_adt.h ++++ jxrlib/common/include/wmspecstrings_adt.h +@@ -1,14 +1,14 @@ + //*@@@+++@@@@****************************************************************** + // +-// Copyright © Microsoft Corp. ++// Copyright © Microsoft Corp. + // All rights reserved. + // + // Redistribution and use in source and binary forms, with or without + // modification, are permitted provided that the following conditions are met: + // +-// • Redistributions of source code must retain the above copyright notice, ++// • Redistributions of source code must retain the above copyright notice, + // this list of conditions and the following disclaimer. +-// • Redistributions in binary form must reproduce the above copyright notice, ++// • Redistributions in binary form must reproduce the above copyright notice, + // this list of conditions and the following disclaimer in the documentation + // and/or other materials provided with the distribution. + // +Index: jxrlib/common/include/wmspecstrings_strict.h +=================================================================== +--- jxrlib.orig/common/include/wmspecstrings_strict.h ++++ jxrlib/common/include/wmspecstrings_strict.h +@@ -1,14 +1,14 @@ + //*@@@+++@@@@****************************************************************** + // +-// Copyright © Microsoft Corp. ++// Copyright © Microsoft Corp. + // All rights reserved. + // + // Redistribution and use in source and binary forms, with or without + // modification, are permitted provided that the following conditions are met: + // +-// • Redistributions of source code must retain the above copyright notice, ++// • Redistributions of source code must retain the above copyright notice, + // this list of conditions and the following disclaimer. +-// • Redistributions in binary form must reproduce the above copyright notice, ++// • Redistributions in binary form must reproduce the above copyright notice, + // this list of conditions and the following disclaimer in the documentation + // and/or other materials provided with the distribution. + // +Index: jxrlib/common/include/wmspecstrings_undef.h +=================================================================== +--- jxrlib.orig/common/include/wmspecstrings_undef.h ++++ jxrlib/common/include/wmspecstrings_undef.h +@@ -1,14 +1,14 @@ + //*@@@+++@@@@****************************************************************** + // +-// Copyright © Microsoft Corp. ++// Copyright © Microsoft Corp. + // All rights reserved. + // + // Redistribution and use in source and binary forms, with or without + // modification, are permitted provided that the following conditions are met: + // +-// • Redistributions of source code must retain the above copyright notice, ++// • Redistributions of source code must retain the above copyright notice, + // this list of conditions and the following disclaimer. +-// • Redistributions in binary form must reproduce the above copyright notice, ++// • Redistributions in binary form must reproduce the above copyright notice, + // this list of conditions and the following disclaimer in the documentation + // and/or other materials provided with the distribution. + // +Index: jxrlib/common/include/wmsal.h +=================================================================== +--- jxrlib.orig/common/include/wmsal.h ++++ jxrlib/common/include/wmsal.h +@@ -1,15 +1,15 @@ + /*** + *sal.h - markers for documenting the semantics of APIs + * +-* Copyright © Microsoft Corp. ++* Copyright © Microsoft Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * +-* • Redistributions of source code must retain the above copyright notice, ++* • Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. +-* • Redistributions in binary form must reproduce the above copyright notice, ++* • Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * diff --git a/meta-ros-common/recipes-graphics/jxrlib/jxrlib/pie.patch b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/pie.patch new file mode 100644 index 00000000000..e339161942f --- /dev/null +++ b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/pie.patch @@ -0,0 +1,17 @@ +Description: lintian hardening-no-bindnow +Author: Mathieu Malaterre +Forwarded: not-needed +Last-Update: 2022-01-28 + +--- jxrlib-1.2~git20170615.f752187.orig/CMakeLists.txt ++++ jxrlib-1.2~git20170615.f752187/CMakeLists.txt +@@ -6,6 +6,9 @@ project(jxrlib C) + # Need shared libs for ABI + set(BUILD_SHARED_LIBS ON) + ++# PIE for executables: ++set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) ++ + # helper macro to preserve original Makefile convention + macro(JXR_MAKE_OBJ SET_NAME) + foreach(src ${SRC_${SET_NAME}}) diff --git a/meta-ros-common/recipes-graphics/jxrlib/jxrlib/pkg-config.patch b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/pkg-config.patch new file mode 100644 index 00000000000..bbee01d6144 --- /dev/null +++ b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/pkg-config.patch @@ -0,0 +1,23 @@ +Description: Incorrect path to include directory in pkg-config (libjxr.pc) + The pkg-config file for libjxr contains incorrect paths to the headers: it + refers to paths used by the upstream Makefile (sub-directories of + /usr/include/libjxr) whereas the Debian package actually installs the headers + directly into a different directory (/usr/include/jxrlib). Therefore, + packages that depend on jxrlib via the pkg-config file fail to build. + . + Original patch did not apply cleanly, rework it (malat) +Author: Yann Leprince +Reviewed-By: Mathieu Malaterre +Forwarded: no +Last-Update: 2022-01-28 + +Index: jxrlib/libjxr.pc.in +=================================================================== +--- jxrlib.orig/libjxr.pc.in ++++ jxrlib/libjxr.pc.in +@@ -9,4 +9,4 @@ Description: A library for reading JPEG + Version: @JXR_VERSION@ + Libs: -L${libdir} -ljpegxr -ljxrglue + Libs.private: -lm +-Cflags: -I${includedir}/libjxr/common -I${includedir}/libjxr/image/x86 -I${includedir}/libjxr/image -I${includedir}/libjxr/glue -I${includedir}/libjxr/test -D__ANSI__ -DDISABLE_PERF_MEASUREMENT @JXR_ENDIAN@ ++Cflags: -I${includedir}/jxrlib -D__ANSI__ -DDISABLE_PERF_MEASUREMENT @JXR_ENDIAN@ diff --git a/meta-ros-common/recipes-graphics/jxrlib/jxrlib/remove-hardcoded-defaults.patch b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/remove-hardcoded-defaults.patch new file mode 100644 index 00000000000..6c92902bb3d --- /dev/null +++ b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/remove-hardcoded-defaults.patch @@ -0,0 +1,22 @@ +Index: git/Makefile +=================================================================== +--- git.orig/Makefile ++++ git/Makefile +@@ -29,8 +29,6 @@ + ## + build: all + +-CC=cc +- + JXR_VERSION=1.1 + + DIR_SRC=$(CURDIR) +@@ -65,7 +63,7 @@ endif + + CD=cd + MK_DIR=mkdir -p +-CFLAGS=-I. -Icommon/include -I$(DIR_SYS) $(ENDIANFLAG) -D__ANSI__ -DDISABLE_PERF_MEASUREMENT -w $(PICFLAG) -O ++CFLAGS+=$(ENDIANFLAG) -D__ANSI__ -DDISABLE_PERF_MEASUREMENT -w $(PICFLAG) -O + + STATIC_LIBRARIES=$(DIR_BUILD)/libjxrglue.a $(DIR_BUILD)/libjpegxr.a + SHARED_LIBRARIES=$(DIR_BUILD)/libjxrglue.so $(DIR_BUILD)/libjpegxr.so diff --git a/meta-ros-common/recipes-graphics/jxrlib/jxrlib/typos.patch b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/typos.patch new file mode 100644 index 00000000000..9de45d60026 --- /dev/null +++ b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/typos.patch @@ -0,0 +1,16 @@ +Description: Fix typos and remove some warnings +Author: Mathieu Malaterre + +Index: jxrlib/jxrencoderdecoder/JxrEncApp.c +=================================================================== +--- jxrlib.orig/jxrencoderdecoder/JxrEncApp.c ++++ jxrlib/jxrencoderdecoder/JxrEncApp.c +@@ -615,7 +615,7 @@ main(int argc, char* argv[]) + + //================================ + Call(PKCreateCodecFactory(&pCodecFactory, WMP_SDK_VERSION)); +- Call(pCodecFactory->CreateCodec(&IID_PKImageWmpEncode, &pEncoder)); ++ Call(pCodecFactory->CreateCodec(&IID_PKImageWmpEncode, (void**)&pEncoder)); + + //---------------------------------------------------------------- + Call(PKCreateTestFactory(&pTestFactory, WMP_SDK_VERSION)); diff --git a/meta-ros-common/recipes-graphics/jxrlib/jxrlib/usecmake.patch b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/usecmake.patch new file mode 100644 index 00000000000..36dad57f177 --- /dev/null +++ b/meta-ros-common/recipes-graphics/jxrlib/jxrlib/usecmake.patch @@ -0,0 +1,144 @@ +Description: Prefer a cmake based build system +Author: Mathieu Malaterre +Forwarded: https://jxrlib.codeplex.com/discussions/440294 + +Index: jxrlib/CMakeLists.txt +=================================================================== +--- /dev/null ++++ jxrlib/CMakeLists.txt +@@ -0,0 +1,135 @@ ++# Copyright Mathieu Malaterre ++# BSD (Same as jxrlib) ++cmake_minimum_required(VERSION 3.13) ++project(jxrlib C) ++ ++# Need shared libs for ABI ++set(BUILD_SHARED_LIBS ON) ++ ++# helper macro to preserve original Makefile convention ++macro(JXR_MAKE_OBJ SET_NAME) ++ foreach(src ${SRC_${SET_NAME}}) ++ list(APPEND OBJ_${SET_NAME} ${DIR_${SET_NAME}}/${src}) ++ endforeach() ++endmacro() ++ ++include(TestBigEndian) ++test_big_endian(ISBIGENDIAN) ++if(ISBIGENDIAN) ++ set(DEF_ENDIAN _BIG__ENDIAN_) ++endif() ++ ++set(DIR_SYS image/sys) ++set(DIR_DEC image/decode) ++set(DIR_ENC image/encode) ++ ++set(DIR_GLUE jxrgluelib) ++set(DIR_TEST jxrtestlib) ++set(DIR_EXEC jxrencoderdecoder) ++ ++if(NOT JXRLIB_INSTALL_BIN_DIR) ++ set(JXRLIB_INSTALL_BIN_DIR "bin") ++endif() ++ ++if(NOT JXRLIB_INSTALL_LIB_DIR) ++ set(JXRLIB_INSTALL_LIB_DIR "lib") ++endif() ++ ++if(NOT JXRLIB_INSTALL_INCLUDE_DIR) ++ set(JXRLIB_INSTALL_INCLUDE_DIR "include/jxrlib") ++endif() ++ ++include_directories( ++ common/include ++ ${DIR_SYS} ++ ${DIR_GLUE} ++ ${DIR_TEST} ++) ++ ++# where is strlcpy ? ++include(CheckSymbolExists) ++check_symbol_exists(strlcpy "string.h" HAVE_STRLCPY) ++#set(CMAKE_REQUIRED_LIBRARIES bsd) ++#CHECK_SYMBOL_EXISTS(strlcpy "string.h" HAVE_STRLCPY4) ++# on linux, strlcpy is in -lbsd: ++#if(NOT HAVE_STRLCPY) ++# include(CheckLibraryExists) ++# find_library(BSD_LIBRARY bsd) ++# check_library_exists(bsd "strlcpy" ${BSD_LIBRARY} HAVE_STRLCPY_BSD) ++#endif() ++ ++# JPEG-XR ++set(SRC_SYS adapthuff.c image.c strcodec.c strPredQuant.c strTransform.c perfTimerANSI.c) ++JXR_MAKE_OBJ(SYS) ++set(SRC_DEC decode.c postprocess.c segdec.c strdec.c strInvTransform.c strPredQuantDec.c JXRTranscode.c) ++JXR_MAKE_OBJ(DEC) ++set(SRC_ENC encode.c segenc.c strenc.c strFwdTransform.c strPredQuantEnc.c) ++JXR_MAKE_OBJ(ENC) ++ ++add_library(jpegxr ${OBJ_ENC} ${OBJ_DEC} ${OBJ_SYS}) ++set_property(TARGET jpegxr ++ PROPERTY COMPILE_DEFINITIONS __ANSI__ DISABLE_PERF_MEASUREMENT ${DEF_ENDIAN} ++) ++set_property(TARGET jpegxr PROPERTY LINK_INTERFACE_LIBRARIES "") ++set_property(TARGET jpegxr PROPERTY COMPILE_FLAGS -w) ++# VERSION/SOVERSION ++set_property(TARGET jpegxr PROPERTY VERSION 1.1) ++set_property(TARGET jpegxr PROPERTY SOVERSION 0) ++install(TARGETS jpegxr ++ EXPORT JXRLibTargets ++ RUNTIME DESTINATION ${JXRLIB_INSTALL_BIN_DIR} COMPONENT Applications ++ LIBRARY DESTINATION ${JXRLIB_INSTALL_LIB_DIR} COMPONENT Libraries ++) ++ ++# JXR-GLUE ++set(SRC_GLUE JXRGlue.c JXRMeta.c JXRGluePFC.c JXRGlueJxr.c) ++JXR_MAKE_OBJ(GLUE) ++set(SRC_TEST JXRTest.c JXRTestBmp.c JXRTestHdr.c JXRTestPnm.c JXRTestTif.c JXRTestYUV.c) ++JXR_MAKE_OBJ(TEST) ++ ++add_library(jxrglue ${OBJ_GLUE} ${OBJ_TEST}) ++set_property(TARGET jxrglue ++ PROPERTY COMPILE_DEFINITIONS __ANSI__ DISABLE_PERF_MEASUREMENT ${DEF_ENDIAN} ++) ++#set_property(TARGET jxrglue PROPERTY LINK_INTERFACE_LIBRARIES "") ++set_property(TARGET jxrglue PROPERTY COMPILE_FLAGS -w) ++# VERSION/SOVERSION ++set_property(TARGET jxrglue PROPERTY VERSION 1.1) ++set_property(TARGET jxrglue PROPERTY SOVERSION 0) ++install(TARGETS jxrglue ++ EXPORT JXRLibTargets ++ RUNTIME DESTINATION ${JXRLIB_INSTALL_BIN_DIR} COMPONENT Applications ++ LIBRARY DESTINATION ${JXRLIB_INSTALL_LIB_DIR} COMPONENT Libraries ++) ++#if(HAVE_STRLCPY_BSD) ++# target_link_libraries(jxrglue ${BSD_LIBRARY}) ++#endif() ++#target_link_libraries(jxrglue m) ++target_link_libraries(jxrglue PRIVATE jpegxr m) ++# Enc app files ++set(ENCAPP JxrEncApp) ++add_executable(${ENCAPP} ${DIR_EXEC}/${ENCAPP}.c) ++set_property(TARGET ${ENCAPP} ++ PROPERTY COMPILE_DEFINITIONS __ANSI__ DISABLE_PERF_MEASUREMENT ${DEF_ENDIAN} ++) ++#set_property(TARGET ${ENCAPP} PROPERTY COMPILE_FLAGS -w) ++target_link_libraries(${ENCAPP} jxrglue) # jpegxr) ++install(TARGETS ${ENCAPP} RUNTIME DESTINATION ${JXRLIB_INSTALL_BIN_DIR}) ++# Dec app files ++set(DECAPP JxrDecApp) ++add_executable(${DECAPP} ${DIR_EXEC}/${DECAPP}.c) ++set_property(TARGET ${DECAPP} ++ PROPERTY COMPILE_DEFINITIONS __ANSI__ DISABLE_PERF_MEASUREMENT ${DEF_ENDIAN} ++) ++set_property(TARGET ${DECAPP} PROPERTY COMPILE_FLAGS -w) ++target_link_libraries(${DECAPP} jxrglue) # jpegxr) ++install(TARGETS ${DECAPP} RUNTIME DESTINATION ${JXRLIB_INSTALL_BIN_DIR}) ++ ++# install rules ++install(FILES jxrgluelib/JXRGlue.h jxrgluelib/JXRMeta.h jxrtestlib/JXRTest.h ++ image/sys/windowsmediaphoto.h ++ DESTINATION ${JXRLIB_INSTALL_INCLUDE_DIR} COMPONENT Headers ++) ++install(DIRECTORY common/include/ DESTINATION ${JXRLIB_INSTALL_INCLUDE_DIR} ++ FILES_MATCHING PATTERN "*.h" ++) diff --git a/meta-ros-common/recipes-graphics/jxrlib/jxrlib_1.2.bb b/meta-ros-common/recipes-graphics/jxrlib/jxrlib_1.2.bb new file mode 100644 index 00000000000..242d4024ee3 --- /dev/null +++ b/meta-ros-common/recipes-graphics/jxrlib/jxrlib_1.2.bb @@ -0,0 +1,27 @@ +LICENSE = "BSD-2-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=ea034eb982f97aff03a4704f608ed2b4" + +SRC_URI = " \ + git://salsa.debian.org/debian-phototools-team/jxrlib.git;protocol=https;branch=master \ + file://usecmake.patch \ + file://typos.patch \ + file://cp1251.patch \ + file://bug771912.patch \ + file://bug803743.patch \ + file://bump_version.patch \ + file://pkg-config.patch \ + file://pie.patch \ + file://082bb032be1f6c75173bf603252e4f37bfded9fa.patch \ + file://31df7f88539b77d46ebf408b6a215930ae63bbdd.patch \ + file://a684f95783f2f81bd13bf1f8b03ceb12aa87d661.patch \ + file://ab9c6b78b7ad3205bdb91ef725b09ddbe3c8945d.patch \ + file://remove-hardcoded-defaults.patch \ +" + +SRCREV = "1b84578fa80eae689c2677970cda64f53953880b" + +S = "${WORKDIR}/git" + +inherit cmake + +BBCLASSEXTEND = "native nativesdk" From c00a3ff24ec164b41e8ff458aba844415af07eea Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 08:33:17 -0700 Subject: [PATCH 11/60] {common} Add backport of tiff 4.6.0 recipe This version is being backported from scarthgap. The tiff recipe is used by gdal, openscenegraph, and freeimage. Signed-off-by: Rob Woolley --- ...277-Apply-1-suggestion-s-to-1-file-s.patch | 27 +++ ...ompare-data-size-of-some-tags-data-2.patch | 36 ++++ ...-compare-data-size-of-some-tags-data.patch | 162 ++++++++++++++++++ .../recipes-multimedia/libtiff/tiff_4.6.0.bb | 63 +++++++ 4 files changed, 288 insertions(+) create mode 100644 meta-ros-common/recipes-multimedia/libtiff/tiff/CVE-2023-6277-Apply-1-suggestion-s-to-1-file-s.patch create mode 100644 meta-ros-common/recipes-multimedia/libtiff/tiff/CVE-2023-6277-At-image-reading-compare-data-size-of-some-tags-data-2.patch create mode 100644 meta-ros-common/recipes-multimedia/libtiff/tiff/CVE-2023-6277-At-image-reading-compare-data-size-of-some-tags-data.patch create mode 100644 meta-ros-common/recipes-multimedia/libtiff/tiff_4.6.0.bb diff --git a/meta-ros-common/recipes-multimedia/libtiff/tiff/CVE-2023-6277-Apply-1-suggestion-s-to-1-file-s.patch b/meta-ros-common/recipes-multimedia/libtiff/tiff/CVE-2023-6277-Apply-1-suggestion-s-to-1-file-s.patch new file mode 100644 index 00000000000..5d15dff1d9b --- /dev/null +++ b/meta-ros-common/recipes-multimedia/libtiff/tiff/CVE-2023-6277-Apply-1-suggestion-s-to-1-file-s.patch @@ -0,0 +1,27 @@ +From e1640519208121f916da1772a5efb6ca28971b86 Mon Sep 17 00:00:00 2001 +From: Even Rouault +Date: Tue, 31 Oct 2023 15:04:37 +0000 +Subject: [PATCH 3/3] Apply 1 suggestion(s) to 1 file(s) + +CVE: CVE-2023-6277 +Upstream-Status: Backport [https://gitlab.com/libtiff/libtiff/-/merge_requests/545] +Signed-off-by: Khem Raj +--- + libtiff/tif_dirread.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c +index fe8d6f8..58a4276 100644 +--- a/libtiff/tif_dirread.c ++++ b/libtiff/tif_dirread.c +@@ -5306,7 +5306,6 @@ static int EstimateStripByteCounts(TIFF *tif, TIFFDirEntry *dir, + { + uint64_t space; + uint16_t n; +- filesize = TIFFGetFileSize(tif); + if (!(tif->tif_flags & TIFF_BIGTIFF)) + space = sizeof(TIFFHeaderClassic) + 2 + dircount * 12 + 4; + else +-- +2.43.0 + diff --git a/meta-ros-common/recipes-multimedia/libtiff/tiff/CVE-2023-6277-At-image-reading-compare-data-size-of-some-tags-data-2.patch b/meta-ros-common/recipes-multimedia/libtiff/tiff/CVE-2023-6277-At-image-reading-compare-data-size-of-some-tags-data-2.patch new file mode 100644 index 00000000000..9fc8182fef3 --- /dev/null +++ b/meta-ros-common/recipes-multimedia/libtiff/tiff/CVE-2023-6277-At-image-reading-compare-data-size-of-some-tags-data-2.patch @@ -0,0 +1,36 @@ +From f500facf7723f1cae725dd288b2daad15e45131c Mon Sep 17 00:00:00 2001 +From: Su_Laus +Date: Mon, 30 Oct 2023 21:21:57 +0100 +Subject: [PATCH 2/3] At image reading, compare data size of some tags / data + structures (StripByteCounts, StripOffsets, StripArray, TIFF directory) with + file size to prevent provoked out-of-memory attacks. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +See issue #614. + +Correct declaration of ‘filesize’ shadows a previous local. + +CVE: CVE-2023-6277 +Upstream-Status: Backport [https://gitlab.com/libtiff/libtiff/-/merge_requests/545] +Signed-off-by: Khem Raj +--- + libtiff/tif_dirread.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c +index c52d41f..fe8d6f8 100644 +--- a/libtiff/tif_dirread.c ++++ b/libtiff/tif_dirread.c +@@ -5305,7 +5305,6 @@ static int EstimateStripByteCounts(TIFF *tif, TIFFDirEntry *dir, + if (td->td_compression != COMPRESSION_NONE) + { + uint64_t space; +- uint64_t filesize; + uint16_t n; + filesize = TIFFGetFileSize(tif); + if (!(tif->tif_flags & TIFF_BIGTIFF)) +-- +2.43.0 + diff --git a/meta-ros-common/recipes-multimedia/libtiff/tiff/CVE-2023-6277-At-image-reading-compare-data-size-of-some-tags-data.patch b/meta-ros-common/recipes-multimedia/libtiff/tiff/CVE-2023-6277-At-image-reading-compare-data-size-of-some-tags-data.patch new file mode 100644 index 00000000000..d5854a9059b --- /dev/null +++ b/meta-ros-common/recipes-multimedia/libtiff/tiff/CVE-2023-6277-At-image-reading-compare-data-size-of-some-tags-data.patch @@ -0,0 +1,162 @@ +From b33baa5d9c6aac8ce49b5180dd48e39697ab7a11 Mon Sep 17 00:00:00 2001 +From: Su_Laus +Date: Fri, 27 Oct 2023 22:11:10 +0200 +Subject: [PATCH 1/3] At image reading, compare data size of some tags / data + structures (StripByteCounts, StripOffsets, StripArray, TIFF directory) with + file size to prevent provoked out-of-memory attacks. + +See issue #614. + +CVE: CVE-2023-6277 +Upstream-Status: Backport [https://gitlab.com/libtiff/libtiff/-/merge_requests/545] +Signed-off-by: Khem Raj +--- + libtiff/tif_dirread.c | 90 +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 90 insertions(+) + +diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c +index 2c49dc6..c52d41f 100644 +--- a/libtiff/tif_dirread.c ++++ b/libtiff/tif_dirread.c +@@ -1308,6 +1308,21 @@ TIFFReadDirEntryArrayWithLimit(TIFF *tif, TIFFDirEntry *direntry, + datasize = (*count) * typesize; + assert((tmsize_t)datasize > 0); + ++ /* Before allocating a huge amount of memory for corrupted files, check if ++ * size of requested memory is not greater than file size. ++ */ ++ uint64_t filesize = TIFFGetFileSize(tif); ++ if (datasize > filesize) ++ { ++ TIFFWarningExtR(tif, "ReadDirEntryArray", ++ "Requested memory size for tag %d (0x%x) %" PRIu32 ++ " is greather than filesize %" PRIu64 ++ ". Memory not allocated, tag not read", ++ direntry->tdir_tag, direntry->tdir_tag, datasize, ++ filesize); ++ return (TIFFReadDirEntryErrAlloc); ++ } ++ + if (isMapped(tif) && datasize > (uint64_t)tif->tif_size) + return TIFFReadDirEntryErrIo; + +@@ -5266,6 +5281,20 @@ static int EstimateStripByteCounts(TIFF *tif, TIFFDirEntry *dir, + if (!_TIFFFillStrilesInternal(tif, 0)) + return -1; + ++ /* Before allocating a huge amount of memory for corrupted files, check if ++ * size of requested memory is not greater than file size. */ ++ uint64_t filesize = TIFFGetFileSize(tif); ++ uint64_t allocsize = (uint64_t)td->td_nstrips * sizeof(uint64_t); ++ if (allocsize > filesize) ++ { ++ TIFFWarningExtR(tif, module, ++ "Requested memory size for StripByteCounts of %" PRIu64 ++ " is greather than filesize %" PRIu64 ++ ". Memory not allocated", ++ allocsize, filesize); ++ return -1; ++ } ++ + if (td->td_stripbytecount_p) + _TIFFfreeExt(tif, td->td_stripbytecount_p); + td->td_stripbytecount_p = (uint64_t *)_TIFFCheckMalloc( +@@ -5807,6 +5836,20 @@ static uint16_t TIFFFetchDirectory(TIFF *tif, uint64_t diroff, + dircount16 = (uint16_t)dircount64; + dirsize = 20; + } ++ /* Before allocating a huge amount of memory for corrupted files, check ++ * if size of requested memory is not greater than file size. */ ++ uint64_t filesize = TIFFGetFileSize(tif); ++ uint64_t allocsize = (uint64_t)dircount16 * dirsize; ++ if (allocsize > filesize) ++ { ++ TIFFWarningExtR( ++ tif, module, ++ "Requested memory size for TIFF directory of %" PRIu64 ++ " is greather than filesize %" PRIu64 ++ ". Memory not allocated, TIFF directory not read", ++ allocsize, filesize); ++ return 0; ++ } + origdir = _TIFFCheckMalloc(tif, dircount16, dirsize, + "to read TIFF directory"); + if (origdir == NULL) +@@ -5921,6 +5964,20 @@ static uint16_t TIFFFetchDirectory(TIFF *tif, uint64_t diroff, + "directories not supported"); + return 0; + } ++ /* Before allocating a huge amount of memory for corrupted files, check ++ * if size of requested memory is not greater than file size. */ ++ uint64_t filesize = TIFFGetFileSize(tif); ++ uint64_t allocsize = (uint64_t)dircount16 * dirsize; ++ if (allocsize > filesize) ++ { ++ TIFFWarningExtR( ++ tif, module, ++ "Requested memory size for TIFF directory of %" PRIu64 ++ " is greather than filesize %" PRIu64 ++ ". Memory not allocated, TIFF directory not read", ++ allocsize, filesize); ++ return 0; ++ } + origdir = _TIFFCheckMalloc(tif, dircount16, dirsize, + "to read TIFF directory"); + if (origdir == NULL) +@@ -5968,6 +6025,8 @@ static uint16_t TIFFFetchDirectory(TIFF *tif, uint64_t diroff, + } + } + } ++ /* No check against filesize needed here because "dir" should have same size ++ * than "origdir" checked above. */ + dir = (TIFFDirEntry *)_TIFFCheckMalloc( + tif, dircount16, sizeof(TIFFDirEntry), "to read TIFF directory"); + if (dir == 0) +@@ -7164,6 +7223,20 @@ static int TIFFFetchStripThing(TIFF *tif, TIFFDirEntry *dir, uint32_t nstrips, + return (0); + } + ++ /* Before allocating a huge amount of memory for corrupted files, check ++ * if size of requested memory is not greater than file size. */ ++ uint64_t filesize = TIFFGetFileSize(tif); ++ uint64_t allocsize = (uint64_t)nstrips * sizeof(uint64_t); ++ if (allocsize > filesize) ++ { ++ TIFFWarningExtR(tif, module, ++ "Requested memory size for StripArray of %" PRIu64 ++ " is greather than filesize %" PRIu64 ++ ". Memory not allocated", ++ allocsize, filesize); ++ _TIFFfreeExt(tif, data); ++ return (0); ++ } + resizeddata = (uint64_t *)_TIFFCheckMalloc( + tif, nstrips, sizeof(uint64_t), "for strip array"); + if (resizeddata == 0) +@@ -7263,6 +7336,23 @@ static void allocChoppedUpStripArrays(TIFF *tif, uint32_t nstrips, + } + bytecount = last_offset + last_bytecount - offset; + ++ /* Before allocating a huge amount of memory for corrupted files, check if ++ * size of StripByteCount and StripOffset tags is not greater than ++ * file size. ++ */ ++ uint64_t allocsize = (uint64_t)nstrips * sizeof(uint64_t) * 2; ++ uint64_t filesize = TIFFGetFileSize(tif); ++ if (allocsize > filesize) ++ { ++ TIFFWarningExtR(tif, "allocChoppedUpStripArrays", ++ "Requested memory size for StripByteCount and " ++ "StripOffsets %" PRIu64 ++ " is greather than filesize %" PRIu64 ++ ". Memory not allocated", ++ allocsize, filesize); ++ return; ++ } ++ + newcounts = + (uint64_t *)_TIFFCheckMalloc(tif, nstrips, sizeof(uint64_t), + "for chopped \"StripByteCounts\" array"); +-- +2.43.0 + diff --git a/meta-ros-common/recipes-multimedia/libtiff/tiff_4.6.0.bb b/meta-ros-common/recipes-multimedia/libtiff/tiff_4.6.0.bb new file mode 100644 index 00000000000..4c472f8ef6f --- /dev/null +++ b/meta-ros-common/recipes-multimedia/libtiff/tiff_4.6.0.bb @@ -0,0 +1,63 @@ +SUMMARY = "Provides support for the Tag Image File Format (TIFF)" +DESCRIPTION = "Library provides support for the Tag Image File Format \ +(TIFF), a widely used format for storing image data. This library \ +provide means to easily access and create TIFF image files." +HOMEPAGE = "http://www.libtiff.org/" +LICENSE = "BSD-2-Clause" +LIC_FILES_CHKSUM = "file://LICENSE.md;md5=a3e32d664d6db1386b4689c8121531c3" + +CVE_PRODUCT = "libtiff" + +SRC_URI = "http://download.osgeo.org/libtiff/tiff-${PV}.tar.gz \ + file://CVE-2023-6277-At-image-reading-compare-data-size-of-some-tags-data.patch \ + file://CVE-2023-6277-At-image-reading-compare-data-size-of-some-tags-data-2.patch \ + file://CVE-2023-6277-Apply-1-suggestion-s-to-1-file-s.patch \ + " + +SRC_URI[sha256sum] = "88b3979e6d5c7e32b50d7ec72fb15af724f6ab2cbf7e10880c360a77e4b5d99a" + +# exclude betas +UPSTREAM_CHECK_REGEX = "tiff-(?P\d+(\.\d+)+).tar" + +CVE_STATUS[CVE-2015-7313] = "fixed-version: Tested with check from https://security-tracker.debian.org/tracker/CVE-2015-7313 and already 4.3.0 doesn't have the issue" + +inherit autotools multilib_header + +CACHED_CONFIGUREVARS = "ax_cv_check_gl_libgl=no" + +PACKAGECONFIG ?= "cxx jpeg zlib lzma \ + strip-chopping extrasample-as-alpha check-ycbcr-subsampling" + +PACKAGECONFIG[cxx] = "--enable-cxx,--disable-cxx,," +PACKAGECONFIG[jbig] = "--enable-jbig,--disable-jbig,jbig," +PACKAGECONFIG[jpeg] = "--enable-jpeg,--disable-jpeg,jpeg," +PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib," +PACKAGECONFIG[lzma] = "--enable-lzma,--disable-lzma,xz," +PACKAGECONFIG[webp] = "--enable-webp,--disable-webp,libwebp," +PACKAGECONFIG[zstd] = "--enable-zstd,--disable-zstd,zstd," +PACKAGECONFIG[libdeflate] = "--enable-libdeflate,--disable-libdeflate,libdeflate," + +# Convert single-strip uncompressed images to multiple strips of specified +# size (default: 8192) to reduce memory usage +PACKAGECONFIG[strip-chopping] = "--enable-strip-chopping,--disable-strip-chopping,," + +# Treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA +PACKAGECONFIG[extrasample-as-alpha] = "--enable-extrasample-as-alpha,--disable-extrasample-as-alpha,," + +# Control picking up YCbCr subsample info. Disable to support files lacking +# the tag +PACKAGECONFIG[check-ycbcr-subsampling] = "--enable-check-ycbcr-subsampling,--disable-check-ycbcr-subsampling,," + +# Support a mechanism allowing reading large strips (usually one strip files) +# in chunks when using TIFFReadScanline. Experimental 4.0+ feature +PACKAGECONFIG[chunky-strip-read] = "--enable-chunky-strip-read,--disable-chunky-strip-read,," + +PACKAGES =+ "tiffxx tiff-utils" +FILES:tiffxx = "${libdir}/libtiffxx.so.*" +FILES:tiff-utils = "${bindir}/*" + +do_install:append() { + oe_multilib_header tiffconf.h +} + +BBCLASSEXTEND = "native nativesdk" From 90b08e8cc4dfdeca5a73aa13aa7f409690452ec1 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 08:39:15 -0700 Subject: [PATCH 12/60] {common} freeimage: Add new recipe The freeimage recipe is used by ogre, ogre-next, ignition, and Gazebo. Debian is used as the upstream source including patches. Signed-off-by: Rob Woolley --- .../freeimage/Amend-jxrlib-include-dir.patch | 13 + .../freeimage/CVE-2019-12211-13.patch | 162 ++++++ .../Disable-testing-of-JPEG-transform.patch | 42 ++ .../Disable-testing-of-JXR-MemIO.patch | 24 + ...-usage-of-HTML-timestamps-in-doxygen.patch | 22 + .../Disable-vendored-dependencies.patch | 469 ++++++++++++++++++ .../Enable-substitution-of-pkg-config.patch | 39 ++ .../freeimage/freeimage/Fix-big-endian.patch | 63 +++ ...Fix-compatibility-with-system-libpng.patch | 99 ++++ .../freeimage/Fix-encoding-of-fi-header.patch | 21 + .../freeimage/Fix-libraw-compilation-2.patch | 13 + .../freeimage/Fix-libraw-compilation.patch | 76 +++ ...edefinition-for-64-bit-integer-types.patch | 26 + .../Fix_compilation_external-static.patch | 16 + .../freeimage/Use-system-dependencies.patch | 184 +++++++ .../Use-system-jpeg_read_icc_profile.patch | 128 +++++ .../freeimage/fix-include-dirs.patch | 19 + .../freeimage/r1830-minor-refactoring.patch | 15 + ...n-when-working-with-malicious-images.patch | 455 +++++++++++++++++ ...n-when-working-with-malicious-images.patch | 159 ++++++ ...-PFM-plugin-against-malicious-images.patch | 227 +++++++++ ...-DDS-plugin-against-malicious-images.patch | 15 + .../freeimage/freeimage/revert-xtiff.patch | 114 +++++ .../freeimage/freeimage_3.18.0-2.bb | 85 ++++ 24 files changed, 2486 insertions(+) create mode 100644 meta-ros-common/recipes-graphics/freeimage/freeimage/Amend-jxrlib-include-dir.patch create mode 100644 meta-ros-common/recipes-graphics/freeimage/freeimage/CVE-2019-12211-13.patch create mode 100644 meta-ros-common/recipes-graphics/freeimage/freeimage/Disable-testing-of-JPEG-transform.patch create mode 100644 meta-ros-common/recipes-graphics/freeimage/freeimage/Disable-testing-of-JXR-MemIO.patch create mode 100644 meta-ros-common/recipes-graphics/freeimage/freeimage/Disable-usage-of-HTML-timestamps-in-doxygen.patch create mode 100644 meta-ros-common/recipes-graphics/freeimage/freeimage/Disable-vendored-dependencies.patch create mode 100644 meta-ros-common/recipes-graphics/freeimage/freeimage/Enable-substitution-of-pkg-config.patch create mode 100644 meta-ros-common/recipes-graphics/freeimage/freeimage/Fix-big-endian.patch create mode 100644 meta-ros-common/recipes-graphics/freeimage/freeimage/Fix-compatibility-with-system-libpng.patch create mode 100644 meta-ros-common/recipes-graphics/freeimage/freeimage/Fix-encoding-of-fi-header.patch create mode 100644 meta-ros-common/recipes-graphics/freeimage/freeimage/Fix-libraw-compilation-2.patch create mode 100644 meta-ros-common/recipes-graphics/freeimage/freeimage/Fix-libraw-compilation.patch create mode 100644 meta-ros-common/recipes-graphics/freeimage/freeimage/Fix-macro-redefinition-for-64-bit-integer-types.patch create mode 100644 meta-ros-common/recipes-graphics/freeimage/freeimage/Fix_compilation_external-static.patch create mode 100644 meta-ros-common/recipes-graphics/freeimage/freeimage/Use-system-dependencies.patch create mode 100644 meta-ros-common/recipes-graphics/freeimage/freeimage/Use-system-jpeg_read_icc_profile.patch create mode 100644 meta-ros-common/recipes-graphics/freeimage/freeimage/fix-include-dirs.patch create mode 100644 meta-ros-common/recipes-graphics/freeimage/freeimage/r1830-minor-refactoring.patch create mode 100644 meta-ros-common/recipes-graphics/freeimage/freeimage/r1832-improved-BMP-plugin-when-working-with-malicious-images.patch create mode 100644 meta-ros-common/recipes-graphics/freeimage/freeimage/r1836-improved-BMP-plugin-when-working-with-malicious-images.patch create mode 100644 meta-ros-common/recipes-graphics/freeimage/freeimage/r1848-improved-PFM-plugin-against-malicious-images.patch create mode 100644 meta-ros-common/recipes-graphics/freeimage/freeimage/r1877-improved-DDS-plugin-against-malicious-images.patch create mode 100644 meta-ros-common/recipes-graphics/freeimage/freeimage/revert-xtiff.patch create mode 100644 meta-ros-common/recipes-graphics/freeimage/freeimage_3.18.0-2.bb diff --git a/meta-ros-common/recipes-graphics/freeimage/freeimage/Amend-jxrlib-include-dir.patch b/meta-ros-common/recipes-graphics/freeimage/freeimage/Amend-jxrlib-include-dir.patch new file mode 100644 index 00000000000..79dd9bc3511 --- /dev/null +++ b/meta-ros-common/recipes-graphics/freeimage/freeimage/Amend-jxrlib-include-dir.patch @@ -0,0 +1,13 @@ +Index: git/Source/FreeImage/PluginJXR.cpp +=================================================================== +--- git.orig/Source/FreeImage/PluginJXR.cpp ++++ git/Source/FreeImage/PluginJXR.cpp +@@ -23,7 +23,7 @@ + #include "Utilities.h" + #include "../Metadata/FreeImageTag.h" + +-#include ++#include + + // ========================================================== + // Plugin Interface diff --git a/meta-ros-common/recipes-graphics/freeimage/freeimage/CVE-2019-12211-13.patch b/meta-ros-common/recipes-graphics/freeimage/freeimage/CVE-2019-12211-13.patch new file mode 100644 index 00000000000..5774165a67b --- /dev/null +++ b/meta-ros-common/recipes-graphics/freeimage/freeimage/CVE-2019-12211-13.patch @@ -0,0 +1,162 @@ +Index: freeimage/Source/FreeImage/PluginTIFF.cpp +=================================================================== +--- freeimage.orig/Source/FreeImage/PluginTIFF.cpp ++++ freeimage/Source/FreeImage/PluginTIFF.cpp +@@ -122,9 +122,14 @@ static void ReadThumbnail(FreeImageIO *i + static int s_format_id; + + typedef struct { ++ //! FreeImage IO functions + FreeImageIO *io; ++ //! FreeImage handle + fi_handle handle; ++ //! LibTIFF handle + TIFF *tif; ++ //! Count the number of thumbnails already read (used to avoid recursion on loading) ++ unsigned thumbnailCount; + } fi_TIFFIO; + + // ---------------------------------------------------------- +@@ -184,10 +189,8 @@ Open a TIFF file descriptor for reading + */ + TIFF * + TIFFFdOpen(thandle_t handle, const char *name, const char *mode) { +- TIFF *tif; +- + // Open the file; the callback will set everything up +- tif = TIFFClientOpen(name, mode, handle, ++ TIFF *tif = TIFFClientOpen(name, mode, handle, + _tiffReadProc, _tiffWriteProc, _tiffSeekProc, _tiffCloseProc, + _tiffSizeProc, _tiffMapProc, _tiffUnmapProc); + +@@ -460,9 +463,9 @@ CreateImageType(BOOL header_only, FREE_I + } + + } +- else { ++ else if (bpp <= 32) { + +- dib = FreeImage_AllocateHeader(header_only, width, height, MIN(bpp, 32), FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK); ++ dib = FreeImage_AllocateHeader(header_only, width, height, bpp, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK); + } + + +@@ -1053,6 +1056,7 @@ Open(FreeImageIO *io, fi_handle handle, + if(!fio) return NULL; + fio->io = io; + fio->handle = handle; ++ fio->thumbnailCount = 0; + + if (read) { + fio->tif = TIFFFdOpen((thandle_t)fio, "", "r"); +@@ -1108,6 +1112,27 @@ check for uncommon bitspersample values + */ + static BOOL + IsValidBitsPerSample(uint16 photometric, uint16 bitspersample, uint16 samplesperpixel) { ++ // get the pixel depth in bits ++ const uint16 pixel_depth = bitspersample * samplesperpixel; ++ ++ // check for a supported pixel depth ++ switch (pixel_depth) { ++ case 1: ++ case 4: ++ case 8: ++ case 16: ++ case 24: ++ case 32: ++ case 48: ++ case 64: ++ case 96: ++ case 128: ++ // OK, go on ++ break; ++ default: ++ // unsupported pixel depth ++ return FALSE; ++ } + + switch(bitspersample) { + case 1: +@@ -1148,6 +1173,8 @@ IsValidBitsPerSample(uint16 photometric, + default: + return FALSE; + } ++ ++ return FALSE; + } + + static TIFFLoadMethod +@@ -1237,16 +1264,32 @@ Read embedded thumbnail + static void + ReadThumbnail(FreeImageIO *io, fi_handle handle, void *data, TIFF *tiff, FIBITMAP *dib) { + FIBITMAP* thumbnail = NULL; ++ ++ fi_TIFFIO *fio = (fi_TIFFIO*)data; ++ ++ /* ++ Thumbnail loading can cause recursions because of the way ++ functions TIFFLastDirectory and TIFFSetSubDirectory are working. ++ We use here a hack to count the number of times the ReadThumbnail function was called. ++ We only allow one call, check for this ++ */ ++ if (fio->thumbnailCount > 0) { ++ return; ++ } ++ else { ++ // update the thumbnail count (used to avoid recursion) ++ fio->thumbnailCount++; ++ } + + // read exif thumbnail (IFD 1) ... + +- /* +- // this code can cause unwanted recursion causing an overflow, it is thus disabled until we have a better solution +- // do we really need to read a thumbnail from the Exif segment ? knowing that TIFF store the thumbnail in the subIFD ... +- // + toff_t exif_offset = 0; + if(TIFFGetField(tiff, TIFFTAG_EXIFIFD, &exif_offset)) { + ++ // this code can cause unwanted recursion causing an overflow, ++ // because of the way TIFFLastDirectory work => this is checked ++ // using ++ + if(!TIFFLastDirectory(tiff)) { + // save current position + const long tell_pos = io->tell_proc(handle); +@@ -1264,7 +1307,6 @@ ReadThumbnail(FreeImageIO *io, fi_handle + TIFFSetDirectory(tiff, cur_dir); + } + } +- */ + + // ... or read the first subIFD + +@@ -1281,6 +1323,10 @@ ReadThumbnail(FreeImageIO *io, fi_handle + const long tell_pos = io->tell_proc(handle); + const uint16 cur_dir = TIFFCurrentDirectory(tiff); + ++ // this code can cause unwanted recursion ++ // causing an overflow, because of the way ++ // TIFFSetSubDirectory work ++ + if(TIFFSetSubDirectory(tiff, subIFD_offsets[0])) { + // load the thumbnail + int page = -1; +@@ -2041,7 +2087,7 @@ Load(FreeImageIO *io, fi_handle handle, + } + + // calculate src line and dst pitch +- int dst_pitch = FreeImage_GetPitch(dib); ++ unsigned dst_pitch = FreeImage_GetPitch(dib); + uint32 tileRowSize = (uint32)TIFFTileRowSize(tif); + uint32 imageRowSize = (uint32)TIFFScanlineSize(tif); + +@@ -2071,7 +2117,7 @@ Load(FreeImageIO *io, fi_handle handle, + BYTE *src_bits = tileBuffer; + BYTE *dst_bits = bits + rowSize; + for(int k = 0; k < nrows; k++) { +- memcpy(dst_bits, src_bits, src_line); ++ memcpy(dst_bits, src_bits, MIN(dst_pitch, src_line)); + src_bits += tileRowSize; + dst_bits -= dst_pitch; + } diff --git a/meta-ros-common/recipes-graphics/freeimage/freeimage/Disable-testing-of-JPEG-transform.patch b/meta-ros-common/recipes-graphics/freeimage/freeimage/Disable-testing-of-JPEG-transform.patch new file mode 100644 index 00000000000..6206a1cae8f --- /dev/null +++ b/meta-ros-common/recipes-graphics/freeimage/freeimage/Disable-testing-of-JPEG-transform.patch @@ -0,0 +1,42 @@ +From: Ghislain Antony Vaillant +Date: Tue, 3 Nov 2015 18:15:18 +0000 +Subject: Disable testing of JPEG transform. + +Reason: the JPEG transform features are disabled from the Debian build as a +result of the stripping of the vendored dependencies. +--- + TestAPI/testJPEG.cpp | 4 ++++ + 1 file changed, 4 insertions(+) + +Index: FreeImage/TestAPI/testJPEG.cpp +=================================================================== +--- FreeImage.orig/TestAPI/testJPEG.cpp ++++ FreeImage/TestAPI/testJPEG.cpp +@@ -25,6 +25,7 @@ + // Local test functions + // ---------------------------------------------------------- + ++#if 0 + void testJPEGTransform(const char *src_file) { + BOOL bResult; + BOOL perfect; +@@ -193,11 +194,13 @@ void testJPEGSameFile(const char *src_fi + bResult = FreeImage_JPEGTransform("test.jpg", "test.jpg", FIJPEG_OP_ROTATE_270, perfect); + assert(bResult); + } ++#endif + + // Main test function + // ---------------------------------------------------------- + + void testJPEG() { ++#if 0 + const char *src_file = "exif.jpg"; + + printf("testJPEG (should throw exceptions) ...\n"); +@@ -213,4 +216,5 @@ void testJPEG() { + + // using the same file for src & dst is allowed + testJPEGSameFile(src_file); ++#endif + } diff --git a/meta-ros-common/recipes-graphics/freeimage/freeimage/Disable-testing-of-JXR-MemIO.patch b/meta-ros-common/recipes-graphics/freeimage/freeimage/Disable-testing-of-JXR-MemIO.patch new file mode 100644 index 00000000000..47394b70bd1 --- /dev/null +++ b/meta-ros-common/recipes-graphics/freeimage/freeimage/Disable-testing-of-JXR-MemIO.patch @@ -0,0 +1,24 @@ +From: Ghislain Antony Vaillant +Date: Thu, 5 Nov 2015 23:47:23 +0000 +Subject: Disable testing of JXR MemIO. + +Reason: The JXR MemIO test raises an assertion error, whose origin is unknown +and needs to be assessed with upstream. Meanwhile the failing test should be +temporarily disabled. +--- + TestAPI/MainTestSuite.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: FreeImage/TestAPI/MainTestSuite.cpp +=================================================================== +--- FreeImage.orig/TestAPI/MainTestSuite.cpp ++++ FreeImage/TestAPI/MainTestSuite.cpp +@@ -76,7 +76,7 @@ int main(int argc, char *argv[]) { + + // test memory IO + testMemIO("sample.png"); +- testMemIO("exif.jxr"); ++ //testMemIO("exif.jxr"); + + // test multipage functions + testMultiPage("sample.png"); diff --git a/meta-ros-common/recipes-graphics/freeimage/freeimage/Disable-usage-of-HTML-timestamps-in-doxygen.patch b/meta-ros-common/recipes-graphics/freeimage/freeimage/Disable-usage-of-HTML-timestamps-in-doxygen.patch new file mode 100644 index 00000000000..4f2c5c67046 --- /dev/null +++ b/meta-ros-common/recipes-graphics/freeimage/freeimage/Disable-usage-of-HTML-timestamps-in-doxygen.patch @@ -0,0 +1,22 @@ +From: Ghislain Antony Vaillant +Date: Tue, 10 Nov 2015 13:50:59 +0000 +Subject: Disable usage of HTML timestamps in doxygen. + +Improves package reproducibility. +--- + Wrapper/FreeImagePlus/doc/FreeImagePlus.dox | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: FreeImage/Wrapper/FreeImagePlus/doc/FreeImagePlus.dox +=================================================================== +--- FreeImage.orig/Wrapper/FreeImagePlus/doc/FreeImagePlus.dox ++++ FreeImage/Wrapper/FreeImagePlus/doc/FreeImagePlus.dox +@@ -1166,7 +1166,7 @@ HTML_COLORSTYLE_GAMMA = 80 + # The default value is: NO. + # This tag requires that the tag GENERATE_HTML is set to YES. + +-HTML_TIMESTAMP = YES ++HTML_TIMESTAMP = NO + + # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML + # documentation will contain sections that can be hidden and shown after the diff --git a/meta-ros-common/recipes-graphics/freeimage/freeimage/Disable-vendored-dependencies.patch b/meta-ros-common/recipes-graphics/freeimage/freeimage/Disable-vendored-dependencies.patch new file mode 100644 index 00000000000..7844a7ee5e8 --- /dev/null +++ b/meta-ros-common/recipes-graphics/freeimage/freeimage/Disable-vendored-dependencies.patch @@ -0,0 +1,469 @@ +From: Ghislain Antony Vaillant +Date: Tue, 3 Nov 2015 14:39:33 +0000 +Subject: Disable vendored dependencies. + +This commit disables usage of the embedded dependencies for building +FreeImage and FreeImagePlus. Functionalities which could not use the +packaged dependencies are delibarately disabled for security reasons. + +This patch is based on Fedora's FreeImage-3.17.0_unbundle patch. +--- + Source/FreeImage.h | 9 ++++- + Source/FreeImage/J2KHelper.cpp | 2 +- + Source/FreeImage/PluginEXR.cpp | 20 +++++----- + Source/FreeImage/PluginG3.cpp | 9 +++-- + Source/FreeImage/PluginJ2K.cpp | 2 +- + Source/FreeImage/PluginJP2.cpp | 2 +- + Source/FreeImage/PluginJPEG.cpp | 6 +-- + Source/FreeImage/PluginJXR.cpp | 2 +- + Source/FreeImage/PluginPNG.cpp | 4 +- + Source/FreeImage/PluginRAW.cpp | 2 +- + Source/FreeImage/PluginTIFF.cpp | 4 +- + Source/FreeImage/PluginWebP.cpp | 8 ++-- + Source/FreeImage/ZLibInterface.cpp | 5 +-- + Source/Metadata/XTIFF.cpp | 80 +++++++++++++++++++------------------- + genfipsrclist.sh | 9 +---- + gensrclist.sh | 11 ++---- + 16 files changed, 85 insertions(+), 90 deletions(-) + +Index: freeimage-3.18.0+ds2/Source/FreeImage.h +=================================================================== +--- freeimage-3.18.0+ds2.orig/Source/FreeImage.h ++++ freeimage-3.18.0+ds2/Source/FreeImage.h +@@ -473,6 +473,9 @@ FI_ENUM(FREE_IMAGE_DITHER) { + FID_BAYER16x16 = 6 //! Bayer ordered dispersed dot dithering (order 4 dithering matrix) + }; + ++/* Debian: The JPEGTransform functions are deliberately disabled in our build ++ of FreeImage, since they require usage of the vendored copy of libjpeg. */ ++#if 0 + /** Lossless JPEG transformations + Constants used in FreeImage_JPEGTransform + */ +@@ -486,6 +489,7 @@ FI_ENUM(FREE_IMAGE_JPEG_OPERATION) { + FIJPEG_OP_ROTATE_180 = 6, //! 180-degree rotation + FIJPEG_OP_ROTATE_270 = 7 //! 270-degree clockwise (or 90 ccw) + }; ++#endif + + /** Tone mapping operators. + Constants used in FreeImage_ToneMapping. +@@ -1088,7 +1092,9 @@ DLL_API const char* DLL_CALLCONV FreeIma + // -------------------------------------------------------------------------- + // JPEG lossless transformation routines + // -------------------------------------------------------------------------- +- ++/* Debian: The JPEGTransform functions are deliberately disabled in our build ++ of FreeImage, since they require usage of the vendored copy of libjpeg. */ ++#if 0 + DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransform(const char *src_file, const char *dst_file, FREE_IMAGE_JPEG_OPERATION operation, BOOL perfect FI_DEFAULT(TRUE)); + DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformU(const wchar_t *src_file, const wchar_t *dst_file, FREE_IMAGE_JPEG_OPERATION operation, BOOL perfect FI_DEFAULT(TRUE)); + DLL_API BOOL DLL_CALLCONV FreeImage_JPEGCrop(const char *src_file, const char *dst_file, int left, int top, int right, int bottom); +@@ -1097,6 +1103,7 @@ DLL_API BOOL DLL_CALLCONV FreeImage_JPEG + DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformCombined(const char *src_file, const char *dst_file, FREE_IMAGE_JPEG_OPERATION operation, int* left, int* top, int* right, int* bottom, BOOL perfect FI_DEFAULT(TRUE)); + DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformCombinedU(const wchar_t *src_file, const wchar_t *dst_file, FREE_IMAGE_JPEG_OPERATION operation, int* left, int* top, int* right, int* bottom, BOOL perfect FI_DEFAULT(TRUE)); + DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformCombinedFromMemory(FIMEMORY* src_stream, FIMEMORY* dst_stream, FREE_IMAGE_JPEG_OPERATION operation, int* left, int* top, int* right, int* bottom, BOOL perfect FI_DEFAULT(TRUE)); ++#endif + + + // -------------------------------------------------------------------------- +Index: freeimage-3.18.0+ds2/Source/FreeImage/J2KHelper.cpp +=================================================================== +--- freeimage-3.18.0+ds2.orig/Source/FreeImage/J2KHelper.cpp ++++ freeimage-3.18.0+ds2/Source/FreeImage/J2KHelper.cpp +@@ -21,7 +21,7 @@ + + #include "FreeImage.h" + #include "Utilities.h" +-#include "../LibOpenJPEG/openjpeg.h" ++#include + #include "J2KHelper.h" + + // -------------------------------------------------------------------------- +Index: freeimage-3.18.0+ds2/Source/FreeImage/PluginEXR.cpp +=================================================================== +--- freeimage-3.18.0+ds2.orig/Source/FreeImage/PluginEXR.cpp ++++ freeimage-3.18.0+ds2/Source/FreeImage/PluginEXR.cpp +@@ -28,16 +28,17 @@ + #pragma warning (disable : 4800) // ImfVersion.h - 'const int' : forcing value to bool 'true' or 'false' (performance warning) + #endif + +-#include "../OpenEXR/IlmImf/ImfIO.h" +-#include "../OpenEXR/Iex/Iex.h" +-#include "../OpenEXR/IlmImf/ImfOutputFile.h" +-#include "../OpenEXR/IlmImf/ImfInputFile.h" +-#include "../OpenEXR/IlmImf/ImfRgbaFile.h" +-#include "../OpenEXR/IlmImf/ImfChannelList.h" +-#include "../OpenEXR/IlmImf/ImfRgba.h" +-#include "../OpenEXR/IlmImf/ImfArray.h" +-#include "../OpenEXR/IlmImf/ImfPreviewImage.h" +-#include "../OpenEXR/Half/half.h" ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include + + + // ========================================================== +Index: freeimage-3.18.0+ds2/Source/FreeImage/PluginG3.cpp +=================================================================== +--- freeimage-3.18.0+ds2.orig/Source/FreeImage/PluginG3.cpp ++++ freeimage-3.18.0+ds2/Source/FreeImage/PluginG3.cpp +@@ -20,8 +20,6 @@ + // Use at your own risk! + // ========================================================== + +-#include "../LibTIFF4/tiffiop.h" +- + #include "FreeImage.h" + #include "Utilities.h" + +@@ -31,6 +29,7 @@ + + static int s_format_id; + ++#if 0 + // ========================================================== + // Constant/Macro declarations + // ========================================================== +@@ -192,6 +191,7 @@ copyFaxFile(FreeImageIO *io, fi_handle h + + return (row); + } ++#endif + + + // ========================================================== +@@ -229,7 +229,7 @@ SupportsExportDepth(int depth) { + } + + // ---------------------------------------------------------- +- ++#if 0 + static FIBITMAP * DLL_CALLCONV + Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) { + TIFF *faxTIFF = NULL; +@@ -406,6 +406,7 @@ Load(FreeImageIO *io, fi_handle handle, + return dib; + + } ++#endif + + // ========================================================== + // Init +@@ -423,7 +424,7 @@ InitG3(Plugin *plugin, int format_id) { + plugin->close_proc = NULL; + plugin->pagecount_proc = NULL; + plugin->pagecapability_proc = NULL; +- plugin->load_proc = Load; ++ plugin->load_proc = NULL; + plugin->save_proc = NULL; + plugin->validate_proc = NULL; + plugin->mime_proc = MimeType; +Index: freeimage-3.18.0+ds2/Source/FreeImage/PluginJ2K.cpp +=================================================================== +--- freeimage-3.18.0+ds2.orig/Source/FreeImage/PluginJ2K.cpp ++++ freeimage-3.18.0+ds2/Source/FreeImage/PluginJ2K.cpp +@@ -21,7 +21,7 @@ + + #include "FreeImage.h" + #include "Utilities.h" +-#include "../LibOpenJPEG/openjpeg.h" ++#include + #include "J2KHelper.h" + + // ========================================================== +Index: freeimage-3.18.0+ds2/Source/FreeImage/PluginJP2.cpp +=================================================================== +--- freeimage-3.18.0+ds2.orig/Source/FreeImage/PluginJP2.cpp ++++ freeimage-3.18.0+ds2/Source/FreeImage/PluginJP2.cpp +@@ -21,7 +21,7 @@ + + #include "FreeImage.h" + #include "Utilities.h" +-#include "../LibOpenJPEG/openjpeg.h" ++#include + #include "J2KHelper.h" + + // ========================================================== +Index: freeimage-3.18.0+ds2/Source/FreeImage/PluginJPEG.cpp +=================================================================== +--- freeimage-3.18.0+ds2.orig/Source/FreeImage/PluginJPEG.cpp ++++ freeimage-3.18.0+ds2/Source/FreeImage/PluginJPEG.cpp +@@ -35,9 +35,9 @@ extern "C" { + #undef FAR + #include + +-#include "../LibJPEG/jinclude.h" +-#include "../LibJPEG/jpeglib.h" +-#include "../LibJPEG/jerror.h" ++#include ++#include ++#include + } + + #include "FreeImage.h" +Index: freeimage-3.18.0+ds2/Source/FreeImage/PluginJXR.cpp +=================================================================== +--- freeimage-3.18.0+ds2.orig/Source/FreeImage/PluginJXR.cpp ++++ freeimage-3.18.0+ds2/Source/FreeImage/PluginJXR.cpp +@@ -23,7 +23,7 @@ + #include "Utilities.h" + #include "../Metadata/FreeImageTag.h" + +-#include "../LibJXR/jxrgluelib/JXRGlue.h" ++#include + + // ========================================================== + // Plugin Interface +Index: freeimage-3.18.0+ds2/Source/FreeImage/PluginPNG.cpp +=================================================================== +--- freeimage-3.18.0+ds2.orig/Source/FreeImage/PluginPNG.cpp ++++ freeimage-3.18.0+ds2/Source/FreeImage/PluginPNG.cpp +@@ -40,8 +40,8 @@ + + // ---------------------------------------------------------- + +-#include "../ZLib/zlib.h" +-#include "../LibPNG/png.h" ++#include ++#include + + // ---------------------------------------------------------- + +Index: freeimage-3.18.0+ds2/Source/FreeImage/PluginRAW.cpp +=================================================================== +--- freeimage-3.18.0+ds2.orig/Source/FreeImage/PluginRAW.cpp ++++ freeimage-3.18.0+ds2/Source/FreeImage/PluginRAW.cpp +@@ -19,7 +19,7 @@ + // Use at your own risk! + // ========================================================== + +-#include "../LibRawLite/libraw/libraw.h" ++#include + + #include "FreeImage.h" + #include "Utilities.h" +Index: freeimage-3.18.0+ds2/Source/FreeImage/ZLibInterface.cpp +=================================================================== +--- freeimage-3.18.0+ds2.orig/Source/FreeImage/ZLibInterface.cpp ++++ freeimage-3.18.0+ds2/Source/FreeImage/ZLibInterface.cpp +@@ -19,10 +19,9 @@ + // Use at your own risk! + // ========================================================== + +-#include "../ZLib/zlib.h" ++#include + #include "FreeImage.h" + #include "Utilities.h" +-#include "../ZLib/zutil.h" /* must be the last header because of error C3163 in VS2008 (_vsnprintf defined in stdio.h) */ + + /** + Compresses a source buffer into a target buffer, using the ZLib library. +@@ -115,7 +114,7 @@ FreeImage_ZLibGZip(BYTE *target, DWORD t + return 0; + case Z_OK: { + // patch header, setup crc and length (stolen from mod_trace_output) +- BYTE *p = target + 8; *p++ = 2; *p = OS_CODE; // xflags, os_code ++ BYTE *p = target + 8; *p++ = 2; *p = 0x03; // xflags, os_code (unix) + crc = crc32(crc, source, source_size); + memcpy(target + 4 + dest_len, &crc, 4); + memcpy(target + 8 + dest_len, &source_size, 4); +Index: freeimage-3.18.0+ds2/Source/Metadata/XTIFF.cpp +=================================================================== +--- freeimage-3.18.0+ds2.orig/Source/Metadata/XTIFF.cpp ++++ freeimage-3.18.0+ds2/Source/Metadata/XTIFF.cpp +@@ -29,7 +29,7 @@ + #pragma warning (disable : 4786) // identifier was truncated to 'number' characters + #endif + +-#include "../LibTIFF4/tiffiop.h" ++#include + + #include "FreeImage.h" + #include "Utilities.h" +@@ -224,6 +224,33 @@ tiff_write_geotiff_profile(TIFF *tif, FI + // TIFF EXIF tag reading & writing + // ---------------------------------------------------------- + ++static uint32 exif_tag_ids[] = { ++ EXIFTAG_EXPOSURETIME, EXIFTAG_FNUMBER, EXIFTAG_EXPOSUREPROGRAM, ++ EXIFTAG_SPECTRALSENSITIVITY, EXIFTAG_ISOSPEEDRATINGS, EXIFTAG_OECF, ++ EXIFTAG_EXIFVERSION, EXIFTAG_DATETIMEORIGINAL, EXIFTAG_DATETIMEDIGITIZED, ++ EXIFTAG_COMPONENTSCONFIGURATION, EXIFTAG_COMPRESSEDBITSPERPIXEL, ++ EXIFTAG_SHUTTERSPEEDVALUE, EXIFTAG_APERTUREVALUE, ++ EXIFTAG_BRIGHTNESSVALUE, EXIFTAG_EXPOSUREBIASVALUE, ++ EXIFTAG_MAXAPERTUREVALUE, EXIFTAG_SUBJECTDISTANCE, EXIFTAG_METERINGMODE, ++ EXIFTAG_LIGHTSOURCE, EXIFTAG_FLASH, EXIFTAG_FOCALLENGTH, ++ EXIFTAG_SUBJECTAREA, EXIFTAG_MAKERNOTE, EXIFTAG_USERCOMMENT, ++ EXIFTAG_SUBSECTIME, EXIFTAG_SUBSECTIMEORIGINAL, ++ EXIFTAG_SUBSECTIMEDIGITIZED, EXIFTAG_FLASHPIXVERSION, EXIFTAG_COLORSPACE, ++ EXIFTAG_PIXELXDIMENSION, EXIFTAG_PIXELYDIMENSION, ++ EXIFTAG_RELATEDSOUNDFILE, EXIFTAG_FLASHENERGY, ++ EXIFTAG_SPATIALFREQUENCYRESPONSE, EXIFTAG_FOCALPLANEXRESOLUTION, ++ EXIFTAG_FOCALPLANEYRESOLUTION, EXIFTAG_FOCALPLANERESOLUTIONUNIT, ++ EXIFTAG_SUBJECTLOCATION, EXIFTAG_EXPOSUREINDEX, EXIFTAG_SENSINGMETHOD, ++ EXIFTAG_FILESOURCE, EXIFTAG_SCENETYPE, EXIFTAG_CFAPATTERN, ++ EXIFTAG_CUSTOMRENDERED, EXIFTAG_EXPOSUREMODE, EXIFTAG_WHITEBALANCE, ++ EXIFTAG_DIGITALZOOMRATIO, EXIFTAG_FOCALLENGTHIN35MMFILM, ++ EXIFTAG_SCENECAPTURETYPE, EXIFTAG_GAINCONTROL, EXIFTAG_CONTRAST, ++ EXIFTAG_SATURATION, EXIFTAG_SHARPNESS, EXIFTAG_DEVICESETTINGDESCRIPTION, ++ EXIFTAG_SUBJECTDISTANCERANGE, EXIFTAG_GAINCONTROL, EXIFTAG_GAINCONTROL, ++ EXIFTAG_IMAGEUNIQUEID ++}; ++static int nExifTags = sizeof(exif_tag_ids) / sizeof(exif_tag_ids[0]); ++ + /** + Read a single Exif tag + +@@ -575,43 +602,10 @@ tiff_read_exif_tags(TIFF *tif, TagLib::M + + // loop over all Core Directory Tags + // ### uses private data, but there is no other way ++ // -> Fedora: Best we can do without private headers is to hard-code a list of known EXIF tags and read those + if(md_model == TagLib::EXIF_MAIN) { +- const TIFFDirectory *td = &tif->tif_dir; +- +- uint32 lastTag = 0; //<- used to prevent reading some tags twice (as stored in tif_fieldinfo) +- +- for (int fi = 0, nfi = (int)tif->tif_nfields; nfi > 0; nfi--, fi++) { +- const TIFFField *fld = tif->tif_fields[fi]; +- +- const uint32 tag_id = TIFFFieldTag(fld); +- +- if(tag_id == lastTag) { +- continue; +- } +- +- // test if tag value is set +- // (lifted directly from LibTiff _TIFFWriteDirectory) +- +- if( fld->field_bit == FIELD_CUSTOM ) { +- int is_set = FALSE; +- +- for(int ci = 0; ci < td->td_customValueCount; ci++ ) { +- is_set |= (td->td_customValues[ci].info == fld); +- } +- +- if( !is_set ) { +- continue; +- } +- +- } else if(!TIFFFieldSet(tif, fld->field_bit)) { +- continue; +- } +- +- // process *all* other tags (some will be ignored) +- +- tiff_read_exif_tag(tif, tag_id, dib, md_model); +- +- lastTag = tag_id; ++ for (int i = 0; i < nExifTags; ++i) { ++ tiff_read_exif_tag(tif, exif_tag_ids[i], dib, md_model); + } + + } +@@ -723,10 +717,9 @@ tiff_write_exif_tags(TIFF *tif, TagLib:: + + TagLib& tag_lib = TagLib::instance(); + +- for (int fi = 0, nfi = (int)tif->tif_nfields; nfi > 0; nfi--, fi++) { +- const TIFFField *fld = tif->tif_fields[fi]; +- +- const uint32 tag_id = TIFFFieldTag(fld); ++ for (int fi = 0, nfi = nExifTags; nfi > 0; nfi--, fi++) { ++ const uint32 tag_id = exif_tag_ids[fi]; ++ const TIFFField *fld = TIFFFieldWithTag(tif, tag_id); + + if(skip_write_field(tif, tag_id)) { + // skip tags that are already handled by the LibTIFF writing process +@@ -749,7 +742,7 @@ tiff_write_exif_tags(TIFF *tif, TagLib:: + continue; + } + // type of storage may differ (e.g. rationnal array vs float array type) +- if((unsigned)_TIFFDataSize(tif_tag_type) != FreeImage_TagDataWidth(tag_type)) { ++ if((unsigned)TIFFFieldSetGetSize(fld) != FreeImage_TagDataWidth(tag_type)) { + // skip tag or _TIFFmemcpy will fail + continue; + } +Index: freeimage-3.18.0+ds2/Source/FreeImage/PluginTIFF.cpp +=================================================================== +--- freeimage-3.18.0+ds2.orig/Source/FreeImage/PluginTIFF.cpp ++++ freeimage-3.18.0+ds2/Source/FreeImage/PluginTIFF.cpp +@@ -37,9 +37,9 @@ + + #include "FreeImage.h" + #include "Utilities.h" +-#include "../LibTIFF4/tiffiop.h" ++#include + #include "../Metadata/FreeImageTag.h" +-#include "../OpenEXR/Half/half.h" ++#include "Imath/half.h" + + #include "FreeImageIO.h" + #include "PSDParser.h" +Index: freeimage-3.18.0+ds2/Source/FreeImage/PluginWebP.cpp +=================================================================== +--- freeimage-3.18.0+ds2.orig/Source/FreeImage/PluginWebP.cpp ++++ freeimage-3.18.0+ds2/Source/FreeImage/PluginWebP.cpp +@@ -24,9 +24,9 @@ + + #include "../Metadata/FreeImageTag.h" + +-#include "../LibWebP/src/webp/decode.h" +-#include "../LibWebP/src/webp/encode.h" +-#include "../LibWebP/src/webp/mux.h" ++#include "webp/decode.h" ++#include "webp/encode.h" ++#include "webp/mux.h" + + // ========================================================== + // Plugin Interface +Index: freeimage-3.18.0+ds2/gensrclist.sh +=================================================================== +--- freeimage-3.18.0+ds2.orig/gensrclist.sh ++++ freeimage-3.18.0+ds2/gensrclist.sh +@@ -6,16 +6,11 @@ echo "VER_MAJOR = 3" > Makefile.srcs + echo "VER_MINOR = 18.0" >> Makefile.srcs + + echo -n "SRCS = " >> Makefile.srcs +-for DIR in $DIRLIST; do +- VCPRJS=`echo $DIR/*.2013.vcxproj` +- if [ "$VCPRJS" != "$DIR/*.2013.vcxproj" ]; then +- egrep 'ClCompile Include=.*\.(c|cpp)' $DIR/*.2013.vcxproj | cut -d'"' -f2 | tr '\\' '/' | awk '{print "'$DIR'/"$0}' | tr '\r\n' ' ' | tr -s ' ' >> Makefile.srcs +- fi +-done ++find Source -name '*.c' -or -name '*.cpp' -not -name 'JPEGTransform.cpp' | LC_ALL=C sort | xargs echo -n >> Makefile.srcs + echo >> Makefile.srcs + + echo -n "INCLS = " >> Makefile.srcs +-find . -name "*.h" -print | xargs echo >> Makefile.srcs ++find Source -name '*.h' | LC_ALL=C sort | xargs echo -n >> Makefile.srcs + echo >> Makefile.srcs + + echo -n "INCLUDE =" >> Makefile.srcs +Index: freeimage-3.18.0+ds2/genfipsrclist.sh +=================================================================== +--- freeimage-3.18.0+ds2.orig/genfipsrclist.sh ++++ freeimage-3.18.0+ds2/genfipsrclist.sh +@@ -7,12 +7,7 @@ echo "VER_MAJOR = 3" > fipMakefile.srcs + echo "VER_MINOR = 18.0" >> fipMakefile.srcs + + echo -n "SRCS = " >> fipMakefile.srcs +-for DIR in $DIRLIST; do +- VCPRJS=`echo $DIR/*.2013.vcxproj` +- if [ "$VCPRJS" != "$DIR/*.2013.vcxproj" ]; then +- egrep 'ClCompile Include=.*\.(c|cpp)' $DIR/*.2013.vcxproj | cut -d'"' -f2 | tr '\\' '/' | awk '{print "'$DIR'/"$0}' | tr '\r\n' ' ' | tr -s ' ' >> fipMakefile.srcs +- fi +-done ++find Wrapper/FreeImagePlus/src -name '*.cpp' -print | LC_ALL=C sort | xargs echo -n >> fipMakefile.srcs + echo >> fipMakefile.srcs + + echo -n "INCLUDE =" >> fipMakefile.srcs diff --git a/meta-ros-common/recipes-graphics/freeimage/freeimage/Enable-substitution-of-pkg-config.patch b/meta-ros-common/recipes-graphics/freeimage/freeimage/Enable-substitution-of-pkg-config.patch new file mode 100644 index 00000000000..628545b52de --- /dev/null +++ b/meta-ros-common/recipes-graphics/freeimage/freeimage/Enable-substitution-of-pkg-config.patch @@ -0,0 +1,39 @@ +From: Helmut Grohne +Date: Tue, 13 Dec 2016 15:59:00 +0000 +Subject: Enable substitution of pkg-config + +--- + Makefile.gnu | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +Index: FreeImage/Makefile.gnu +=================================================================== +--- FreeImage.orig/Makefile.gnu ++++ FreeImage/Makefile.gnu +@@ -11,7 +11,10 @@ INSTALLDIR ?= $(DESTDIR)/usr/lib + # Converts cr/lf to just lf + DOS2UNIX = dos2unix + +-LIBRARIES = -lstdc++ -ljxrglue $(shell pkg-config --libs libjpeg libopenjp2 libpng libraw libtiff-4 libwebpmux OpenEXR zlib) -lm ++# See Bug-Debian #845279 ++PKG_CONFIG ?= pkg-config ++ ++LIBRARIES = -lstdc++ -ljxrglue $(shell $(PKG_CONFIG) --libs libjpeg libopenjp2 libpng libraw libtiff-4 libwebpmux OpenEXR zlib) -lm + + MODULES = $(SRCS:.c=.o) + MODULES := $(MODULES:.cpp=.o) +@@ -23,12 +26,12 @@ override CFLAGS += -DOPJ_STATIC + override CFLAGS += -DNO_LCMS + # LibJXR + override CFLAGS += -DDISABLE_PERF_MEASUREMENT -D__ANSI__ +-override CFLAGS += $(INCLUDE) -I/usr/include/jxrlib $(shell pkg-config --cflags libjpeg libopenjp2 libpng libraw libtiff-4 libwebpmux OpenEXR zlib) ++override CFLAGS += $(INCLUDE) -I/usr/include/jxrlib $(shell $(PKG_CONFIG) --cflags libjpeg libopenjp2 libpng libraw libtiff-4 libwebpmux OpenEXR zlib) + CXXFLAGS ?= -O3 -fPIC + override CXXFLAGS += -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy + # LibJXR + override CXXFLAGS += -D__ANSI__ +-override CXXFLAGS += $(INCLUDE) -I/usr/include/jxrlib $(shell pkg-config --cflags libjpeg libopenjp2 libpng libraw libtiff-4 libwebpmux OpenEXR zlib) ++override CXXFLAGS += $(INCLUDE) -I/usr/include/jxrlib $(shell $(PKG_CONFIG) --cflags libjpeg libopenjp2 libpng libraw libtiff-4 libwebpmux OpenEXR zlib) + + TARGET = freeimage + STATICLIB = lib$(TARGET).a diff --git a/meta-ros-common/recipes-graphics/freeimage/freeimage/Fix-big-endian.patch b/meta-ros-common/recipes-graphics/freeimage/freeimage/Fix-big-endian.patch new file mode 100644 index 00000000000..a08bbf91e17 --- /dev/null +++ b/meta-ros-common/recipes-graphics/freeimage/freeimage/Fix-big-endian.patch @@ -0,0 +1,63 @@ +Description: Fix FTBFS on some big-endian targets +Bug-Debian: https://bugs.debian.org/1002610 +Origin: backport, https://sourceforge.net/p/freeimage/svn/1809/ + +Index: freeimage-3.18.0+ds2/Source/FreeImage/PluginBMP.cpp +=================================================================== +--- freeimage-3.18.0+ds2.orig/Source/FreeImage/PluginBMP.cpp ++++ freeimage-3.18.0+ds2/Source/FreeImage/PluginBMP.cpp +@@ -518,7 +518,7 @@ LoadWindowsBMP(FreeImageIO *io, fi_handl + io->read_proc(FreeImage_GetPalette(dib), used_colors * sizeof(RGBQUAD), 1, handle); + #if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_RGB + RGBQUAD *pal = FreeImage_GetPalette(dib); +- for(int i = 0; i < used_colors; i++) { ++ for(unsigned i = 0; i < used_colors; i++) { + INPLACESWAP(pal[i].rgbRed, pal[i].rgbBlue); + } + #endif +@@ -1419,7 +1419,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_ + + free(buffer); + #ifdef FREEIMAGE_BIGENDIAN +- } else if (bpp == 16) { ++ } else if (dst_bpp == 16) { + int padding = dst_pitch - dst_width * sizeof(WORD); + WORD pad = 0; + WORD pixel; +@@ -1440,7 +1440,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_ + } + #endif + #if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_RGB +- } else if (bpp == 24) { ++ } else if (dst_bpp == 24) { + int padding = dst_pitch - dst_width * sizeof(FILE_BGR); + DWORD pad = 0; + FILE_BGR bgr; +@@ -1461,7 +1461,7 @@ Save(FreeImageIO *io, FIBITMAP *dib, fi_ + } + } + } +- } else if (bpp == 32) { ++ } else if (dst_bpp == 32) { + FILE_BGRA bgra; + for(unsigned y = 0; y < dst_height; y++) { + BYTE *line = FreeImage_GetScanLine(dib, y); +Index: freeimage-3.18.0+ds2/Source/FreeImage/PluginDDS.cpp +=================================================================== +--- freeimage-3.18.0+ds2.orig/Source/FreeImage/PluginDDS.cpp ++++ freeimage-3.18.0+ds2/Source/FreeImage/PluginDDS.cpp +@@ -356,14 +356,6 @@ SwapHeader(DDSHEADER *header) { + for(int i=0; i<11; i++) { + SwapLong(&header->surfaceDesc.dwReserved1[i]); + } +- SwapLong(&header->surfaceDesc.ddpfPixelFormat.dwSize); +- SwapLong(&header->surfaceDesc.ddpfPixelFormat.dwFlags); +- SwapLong(&header->surfaceDesc.ddpfPixelFormat.dwFourCC); +- SwapLong(&header->surfaceDesc.ddpfPixelFormat.dwRGBBitCount); +- SwapLong(&header->surfaceDesc.ddpfPixelFormat.dwRBitMask); +- SwapLong(&header->surfaceDesc.ddpfPixelFormat.dwGBitMask); +- SwapLong(&header->surfaceDesc.ddpfPixelFormat.dwBBitMask); +- SwapLong(&header->surfaceDesc.ddpfPixelFormat.dwRGBAlphaBitMask); + SwapLong(&header->surfaceDesc.ddsCaps.dwCaps1); + SwapLong(&header->surfaceDesc.ddsCaps.dwCaps2); + SwapLong(&header->surfaceDesc.ddsCaps.dwReserved[0]); diff --git a/meta-ros-common/recipes-graphics/freeimage/freeimage/Fix-compatibility-with-system-libpng.patch b/meta-ros-common/recipes-graphics/freeimage/freeimage/Fix-compatibility-with-system-libpng.patch new file mode 100644 index 00000000000..4add170a352 --- /dev/null +++ b/meta-ros-common/recipes-graphics/freeimage/freeimage/Fix-compatibility-with-system-libpng.patch @@ -0,0 +1,99 @@ +From: Ghislain Antony Vaillant +Date: Tue, 3 Nov 2015 15:20:45 +0000 +Subject: Fix compatibility with system libpng. + +[Ghislain Antony Vaillant] +The PNG plugin of FreeImage makes use of optional features of libpng, which +are not enabled in Debian. This commit adds the necessary guards for FreeImage +to compile and run without these features. + +[Tobias Frost] +Fix FTBFS with libpng 1.6. +--- + Source/FreeImage/PluginPNG.cpp | 35 ++++++++++++++++++++++++++++------- + 1 file changed, 28 insertions(+), 7 deletions(-) + +Index: FreeImage/Source/FreeImage/PluginPNG.cpp +=================================================================== +--- FreeImage.orig/Source/FreeImage/PluginPNG.cpp ++++ FreeImage/Source/FreeImage/PluginPNG.cpp +@@ -115,9 +115,11 @@ ReadMetadata(png_structp png_ptr, png_in + // create a tag + tag = FreeImage_CreateTag(); + if(!tag) return FALSE; +- ++#ifdef PNG_iTXt_SUPPORTED + DWORD tag_length = (DWORD) MAX(text_ptr[i].text_length, text_ptr[i].itxt_length); +- ++#else ++ DWORD tag_length = text_ptr[i].text_length; ++#endif + FreeImage_SetTagLength(tag, tag_length); + FreeImage_SetTagCount(tag, tag_length); + FreeImage_SetTagType(tag, FIDT_ASCII); +@@ -185,14 +187,19 @@ WriteMetadata(png_structp png_ptr, png_i + if(mdhandle) { + do { + memset(&text_metadata, 0, sizeof(png_text)); ++#ifdef PNG_iTXt_SUPPORTED + text_metadata.compression = 1; // iTXt, none ++#else ++ text_metadata.compression = -1; ++#endif + text_metadata.key = (char*)FreeImage_GetTagKey(tag); // keyword, 1-79 character description of "text" + text_metadata.text = (char*)FreeImage_GetTagValue(tag); // comment, may be an empty string (ie "") + text_metadata.text_length = FreeImage_GetTagLength(tag);// length of the text string ++#ifdef PNG_iTXt_SUPPORTED + text_metadata.itxt_length = FreeImage_GetTagLength(tag);// length of the itxt string + text_metadata.lang = 0; // language code, 0-79 characters or a NULL pointer + text_metadata.lang_key = 0; // keyword translated UTF-8 string, 0 or more chars or a NULL pointer +- ++#endif + // set the tag + png_set_text(png_ptr, info_ptr, &text_metadata, 1); + +@@ -211,10 +218,11 @@ WriteMetadata(png_structp png_ptr, png_i + text_metadata.key = (char*)g_png_xmp_keyword; // keyword, 1-79 character description of "text" + text_metadata.text = (char*)FreeImage_GetTagValue(tag); // comment, may be an empty string (ie "") + text_metadata.text_length = FreeImage_GetTagLength(tag);// length of the text string ++#ifdef PNG_iTXt_SUPPORTED + text_metadata.itxt_length = FreeImage_GetTagLength(tag);// length of the itxt string + text_metadata.lang = 0; // language code, 0-79 characters or a NULL pointer + text_metadata.lang_key = 0; // keyword translated UTF-8 string, 0 or more chars or a NULL pointer +- ++#endif + // set the tag + png_set_text(png_ptr, info_ptr, &text_metadata, 1); + bResult &= TRUE; +@@ -707,11 +715,19 @@ Load(FreeImageIO *io, fi_handle handle, + + if (png_get_valid(png_ptr, info_ptr, PNG_INFO_iCCP)) { + png_charp profile_name = NULL; +- png_bytep profile_data = NULL; ++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4 ++ png_bytepp profile_data = NULL; ++#else ++ png_charp profile_data = NULL; ++#endif + png_uint_32 profile_length = 0; + int compression_type; + ++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4 ++ png_get_iCCP(png_ptr, info_ptr, &profile_name, &compression_type, profile_data, &profile_length); ++#else + png_get_iCCP(png_ptr, info_ptr, &profile_name, &compression_type, &profile_data, &profile_length); ++#endif + + // copy ICC profile data (must be done after FreeImage_AllocateHeader) + +@@ -746,8 +762,9 @@ Load(FreeImageIO *io, fi_handle handle, + for (png_uint_32 k = 0; k < height; k++) { + row_pointers[height - 1 - k] = FreeImage_GetScanLine(dib, k); + } +- ++#ifdef PNG_BENIGN_ERRORS_SUPPORTED + png_set_benign_errors(png_ptr, 1); ++#endif + png_read_image(png_ptr, row_pointers); + + // check if the bitmap contains transparency, if so enable it in the header diff --git a/meta-ros-common/recipes-graphics/freeimage/freeimage/Fix-encoding-of-fi-header.patch b/meta-ros-common/recipes-graphics/freeimage/freeimage/Fix-encoding-of-fi-header.patch new file mode 100644 index 00000000000..a3ae2453d9c --- /dev/null +++ b/meta-ros-common/recipes-graphics/freeimage/freeimage/Fix-encoding-of-fi-header.patch @@ -0,0 +1,21 @@ +From: Ghislain Antony Vaillant +Date: Sun, 10 Jan 2016 16:03:12 +0000 +Subject: Fix encoding of fi header. + +--- + Source/FreeImage.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: FreeImage/Source/FreeImage.h +=================================================================== +--- FreeImage.orig/Source/FreeImage.h ++++ FreeImage/Source/FreeImage.h +@@ -3,7 +3,7 @@ + // + // Design and implementation by + // - Floris van den Berg (flvdberg@wxs.nl) +-// - Hervé Drolon (drolon@infonie.fr) ++// - Herve Drolon (drolon@infonie.fr) + // + // Contributors: + // - see changes log named 'Whatsnew.txt', see header of each .h and .cpp file diff --git a/meta-ros-common/recipes-graphics/freeimage/freeimage/Fix-libraw-compilation-2.patch b/meta-ros-common/recipes-graphics/freeimage/freeimage/Fix-libraw-compilation-2.patch new file mode 100644 index 00000000000..7e516527a7d --- /dev/null +++ b/meta-ros-common/recipes-graphics/freeimage/freeimage/Fix-libraw-compilation-2.patch @@ -0,0 +1,13 @@ +Index: Source/FreeImage/PluginRAW.cpp +=================================================================== +--- a/Source/FreeImage/PluginRAW.cpp (revision 1894) ++++ b/Source/FreeImage/PluginRAW.cpp (revision 1895) +@@ -701,7 +701,7 @@ + // -------------------------------------------- + + // (-s [0..N-1]) Select one raw image from input file +- RawProcessor->imgdata.params.shot_select = 0; ++ RawProcessor->imgdata.rawparams.shot_select = 0; + // (-w) Use camera white balance, if possible (otherwise, fallback to auto_wb) + RawProcessor->imgdata.params.use_camera_wb = 1; + // (-M) Use any color matrix from the camera metadata. This option only affects Olympus, Leaf, and Phase One cameras. diff --git a/meta-ros-common/recipes-graphics/freeimage/freeimage/Fix-libraw-compilation.patch b/meta-ros-common/recipes-graphics/freeimage/freeimage/Fix-libraw-compilation.patch new file mode 100644 index 00000000000..f3aaca12e5a --- /dev/null +++ b/meta-ros-common/recipes-graphics/freeimage/freeimage/Fix-libraw-compilation.patch @@ -0,0 +1,76 @@ +Description: Fix FTBFS against libraw 0.20.0 +Origin: https://sourceforge.net/p/freeimage/svn/1842/ +Acked-By: Anton Gladky +Bug-Debian: https://bugs.debian.org/968637 +Last-update: 2020-08-27 + +Index: freeimage/Source/FreeImage/PluginRAW.cpp +=================================================================== +--- freeimage.orig/Source/FreeImage/PluginRAW.cpp ++++ freeimage/Source/FreeImage/PluginRAW.cpp +@@ -59,21 +59,18 @@ public: + } + + int valid() { +- return (_io && _handle); ++ return (_io && _handle) ? 1 : 0; + } + + int read(void *buffer, size_t size, size_t count) { +- if(substream) return substream->read(buffer, size, count); + return _io->read_proc(buffer, (unsigned)size, (unsigned)count, _handle); + } + + int seek(INT64 offset, int origin) { +- if(substream) return substream->seek(offset, origin); + return _io->seek_proc(_handle, (long)offset, origin); + } + + INT64 tell() { +- if(substream) return substream->tell(); + return _io->tell_proc(_handle); + } + +@@ -83,19 +80,21 @@ public: + + int get_char() { + int c = 0; +- if(substream) return substream->get_char(); +- if(!_io->read_proc(&c, 1, 1, _handle)) return -1; ++ if (!_io->read_proc(&c, 1, 1, _handle)) { ++ return -1; ++ } + return c; + } + + char* gets(char *buffer, int length) { +- if (substream) return substream->gets(buffer, length); + memset(buffer, 0, length); + for(int i = 0; i < length; i++) { +- if(!_io->read_proc(&buffer[i], 1, 1, _handle)) ++ if (!_io->read_proc(&buffer[i], 1, 1, _handle)) { + return NULL; +- if(buffer[i] == 0x0A) ++ } ++ if (buffer[i] == 0x0A) { + break; ++ } + } + return buffer; + } +@@ -104,7 +103,6 @@ public: + std::string buffer; + char element = 0; + bool bDone = false; +- if(substream) return substream->scanf_one(fmt,val); + do { + if(_io->read_proc(&element, 1, 1, _handle) == 1) { + switch(element) { +@@ -127,7 +125,6 @@ public: + } + + int eof() { +- if(substream) return substream->eof(); + return (_io->tell_proc(_handle) >= _eof); + } + diff --git a/meta-ros-common/recipes-graphics/freeimage/freeimage/Fix-macro-redefinition-for-64-bit-integer-types.patch b/meta-ros-common/recipes-graphics/freeimage/freeimage/Fix-macro-redefinition-for-64-bit-integer-types.patch new file mode 100644 index 00000000000..f63f3b8c7c4 --- /dev/null +++ b/meta-ros-common/recipes-graphics/freeimage/freeimage/Fix-macro-redefinition-for-64-bit-integer-types.patch @@ -0,0 +1,26 @@ +From: Debian QA Group +Date: Fri, 6 Nov 2015 13:51:20 +0000 +Subject: Fix macro redefinition for 64-bit integer types. + +Both FreeImage and LibRAW defines INT64 and UINT64 aliases in their respective +public headers via macros. This commit guards against macro redefinitions for +these types inside the FreeImage.h public header. +--- + Source/FreeImage.h | 2 ++ + 1 file changed, 2 insertions(+) + +Index: FreeImage/Source/FreeImage.h +=================================================================== +--- FreeImage.orig/Source/FreeImage.h ++++ FreeImage/Source/FreeImage.h +@@ -155,8 +155,10 @@ typedef uint8_t BYTE; + typedef uint16_t WORD; + typedef uint32_t DWORD; + typedef int32_t LONG; ++#ifndef _LIBRAW_TYPES_H + typedef int64_t INT64; + typedef uint64_t UINT64; ++#endif + #else + // MS is not C99 ISO compliant + typedef long BOOL; diff --git a/meta-ros-common/recipes-graphics/freeimage/freeimage/Fix_compilation_external-static.patch b/meta-ros-common/recipes-graphics/freeimage/freeimage/Fix_compilation_external-static.patch new file mode 100644 index 00000000000..3c832de46dd --- /dev/null +++ b/meta-ros-common/recipes-graphics/freeimage/freeimage/Fix_compilation_external-static.patch @@ -0,0 +1,16 @@ +Description: Fix compilation due to external-static mismatch +Author: Anton Gladky +Bug-Debian: https://bugs.debian.org/964653 +Last-Update: 2020-07-15 + +--- freeimage-3.18.0+ds2.orig/Source/FreeImage/PluginJPEG.cpp ++++ freeimage-3.18.0+ds2/Source/FreeImage/PluginJPEG.cpp +@@ -502,7 +502,7 @@ marker_is_icc(jpeg_saved_marker_ptr mark + NOTE: if the file contains invalid ICC APP2 markers, we just silently + return FALSE. You might want to issue an error message instead. + */ +-static BOOL ++BOOL + jpeg_read_icc_profile(j_decompress_ptr cinfo, JOCTET **icc_data_ptr, unsigned *icc_data_len) { + jpeg_saved_marker_ptr marker; + int num_markers = 0; diff --git a/meta-ros-common/recipes-graphics/freeimage/freeimage/Use-system-dependencies.patch b/meta-ros-common/recipes-graphics/freeimage/freeimage/Use-system-dependencies.patch new file mode 100644 index 00000000000..952fb3b4da2 --- /dev/null +++ b/meta-ros-common/recipes-graphics/freeimage/freeimage/Use-system-dependencies.patch @@ -0,0 +1,184 @@ +From: Ghislain Antony Vaillant +Date: Thu, 5 Nov 2015 22:47:13 +0000 +Subject: Use system dependencies. + +This commit patches the build system to use the packaged dependencies +for building FreeImage and FreeImagePlus. This patch also modifies some +targets in the corresponding Makefiles to help with the package build process. +--- + Makefile.fip | 45 +++++++++++++++++---------------------------- + Makefile.gnu | 41 ++++++++++++++++++++--------------------- + 2 files changed, 37 insertions(+), 49 deletions(-) + +diff --git a/Makefile.fip b/Makefile.fip +index b59c419..98733cf 100644 +--- a/Makefile.fip ++++ b/Makefile.fip +@@ -11,27 +11,16 @@ INSTALLDIR ?= $(DESTDIR)/usr/lib + # Converts cr/lf to just lf + DOS2UNIX = dos2unix + +-LIBRARIES = -lstdc++ ++LIBRARIES = -lstdc++ -ljxrglue $(shell pkg-config --libs libjpeg libopenjp2 libpng libraw libtiff-4 libwebpmux OpenEXR zlib) -lm + + MODULES = $(SRCS:.c=.o) + MODULES := $(MODULES:.cpp=.o) +-CFLAGS ?= -O3 -fPIC -fexceptions -fvisibility=hidden +-# OpenJPEG +-CFLAGS += -DOPJ_STATIC +-# LibRaw +-CFLAGS += -DNO_LCMS +-# LibJXR +-CFLAGS += -DDISABLE_PERF_MEASUREMENT -D__ANSI__ +-CFLAGS += $(INCLUDE) +-CXXFLAGS ?= -O3 -fPIC -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy +-# LibJXR +-CXXFLAGS += -D__ANSI__ +-CXXFLAGS += $(INCLUDE) +- +-ifeq ($(shell sh -c 'uname -m 2>/dev/null || echo not'),x86_64) +- CFLAGS += -fPIC +- CXXFLAGS += -fPIC +-endif ++CFLAGS ?= -O3 -fPIC ++override CFLAGS += -fexceptions -fvisibility=hidden ++override CFLAGS += $(INCLUDE) -IDist ++CXXFLAGS ?= -O3 -fPIC ++override CXXFLAGS += -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy ++override CXXFLAGS += $(INCLUDE) -IDist + + TARGET = freeimageplus + STATICLIB = lib$(TARGET).a +@@ -48,31 +37,31 @@ all: dist + + dist: FreeImage + mkdir -p Dist +- cp *.a Dist/ +- cp *.so Dist/ +- cp Source/FreeImage.h Dist/ +- cp Wrapper/FreeImagePlus/FreeImagePlus.h Dist/ ++ cp $(STATICLIB) Dist/ ++ cp $(SHAREDLIB) Dist/ ++ cp $(HEADERFIP) Dist/ ++ ln -sf $(SHAREDLIB) Dist/$(VERLIBNAME) ++ ln -sf $(VERLIBNAME) Dist/$(LIBNAME) + + dos2unix: +- @$(DOS2UNIX) $(SRCS) ++ @$(DOS2UNIX) $(SRCS) $(HEADERFIP) + + FreeImage: $(STATICLIB) $(SHAREDLIB) + + .c.o: +- $(CC) $(CFLAGS) -c $< -o $@ ++ $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ + + .cpp.o: +- $(CXX) $(CXXFLAGS) -c $< -o $@ ++ $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@ + + $(STATICLIB): $(MODULES) + $(AR) r $@ $(MODULES) + + $(SHAREDLIB): $(MODULES) +- $(CC) -s -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES) ++ $(CC) -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES) + + install: + install -d $(INCDIR) $(INSTALLDIR) +- install -m 644 -o root -g root $(HEADER) $(INCDIR) + install -m 644 -o root -g root $(HEADERFIP) $(INCDIR) + install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR) + install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR) +@@ -80,5 +69,5 @@ install: + ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME) + + clean: +- rm -f core Dist/*.* u2dtmp* $(MODULES) $(STATICLIB) $(SHAREDLIB) $(LIBNAME) ++ rm -f Dist/lib$(TARGET)* Dist/FreeImagePlus.h $(MODULES) $(STATICLIB) $(SHAREDLIB) $(LIBNAME) + +diff --git a/Makefile.gnu b/Makefile.gnu +index 92f6358..4e61efa 100644 +--- a/Makefile.gnu ++++ b/Makefile.gnu +@@ -11,27 +11,24 @@ INSTALLDIR ?= $(DESTDIR)/usr/lib + # Converts cr/lf to just lf + DOS2UNIX = dos2unix + +-LIBRARIES = -lstdc++ ++LIBRARIES = -lstdc++ -ljxrglue $(shell pkg-config --libs libjpeg libopenjp2 libpng libraw libtiff-4 libwebpmux OpenEXR zlib) -lm + + MODULES = $(SRCS:.c=.o) + MODULES := $(MODULES:.cpp=.o) +-CFLAGS ?= -O3 -fPIC -fexceptions -fvisibility=hidden ++CFLAGS ?= -O3 -fPIC ++override CFLAGS += -fexceptions -fvisibility=hidden + # OpenJPEG +-CFLAGS += -DOPJ_STATIC ++override CFLAGS += -DOPJ_STATIC + # LibRaw +-CFLAGS += -DNO_LCMS ++override CFLAGS += -DNO_LCMS + # LibJXR +-CFLAGS += -DDISABLE_PERF_MEASUREMENT -D__ANSI__ +-CFLAGS += $(INCLUDE) +-CXXFLAGS ?= -O3 -fPIC -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy ++override CFLAGS += -DDISABLE_PERF_MEASUREMENT -D__ANSI__ ++override CFLAGS += $(INCLUDE) -I/usr/include/jxrlib $(shell pkg-config --cflags libjpeg libopenjp2 libpng libraw libtiff-4 libwebpmux OpenEXR zlib) ++CXXFLAGS ?= -O3 -fPIC ++override CXXFLAGS += -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy + # LibJXR +-CXXFLAGS += -D__ANSI__ +-CXXFLAGS += $(INCLUDE) +- +-ifeq ($(shell sh -c 'uname -m 2>/dev/null || echo not'),x86_64) +- CFLAGS += -fPIC +- CXXFLAGS += -fPIC +-endif ++override CXXFLAGS += -D__ANSI__ ++override CXXFLAGS += $(INCLUDE) -I/usr/include/jxrlib $(shell pkg-config --cflags libjpeg libopenjp2 libpng libraw libtiff-4 libwebpmux OpenEXR zlib) + + TARGET = freeimage + STATICLIB = lib$(TARGET).a +@@ -48,9 +45,11 @@ all: dist + + dist: FreeImage + mkdir -p Dist +- cp *.a Dist/ +- cp *.so Dist/ +- cp Source/FreeImage.h Dist/ ++ cp $(STATICLIB) Dist/ ++ cp $(SHAREDLIB) Dist/ ++ cp $(HEADER) Dist/ ++ ln -sf $(SHAREDLIB) Dist/$(VERLIBNAME) ++ ln -sf $(VERLIBNAME) Dist/$(LIBNAME) + + dos2unix: + @$(DOS2UNIX) $(SRCS) $(INCLS) +@@ -58,16 +57,16 @@ dos2unix: + FreeImage: $(STATICLIB) $(SHAREDLIB) + + .c.o: +- $(CC) $(CFLAGS) -c $< -o $@ ++ $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ + + .cpp.o: +- $(CXX) $(CXXFLAGS) -c $< -o $@ ++ $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@ + + $(STATICLIB): $(MODULES) + $(AR) r $@ $(MODULES) + + $(SHAREDLIB): $(MODULES) +- $(CC) -s -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES) ++ $(CC) -shared -Wl,-soname,$(VERLIBNAME) $(LDFLAGS) -o $@ $(MODULES) $(LIBRARIES) + + install: + install -d $(INCDIR) $(INSTALLDIR) +@@ -79,5 +78,5 @@ install: + # ldconfig + + clean: +- rm -f core Dist/*.* u2dtmp* $(MODULES) $(STATICLIB) $(SHAREDLIB) $(LIBNAME) ++ rm -f Dist/lib$(TARGET)* Dist/FreeImage.h $(MODULES) $(STATICLIB) $(SHAREDLIB) $(LIBNAME) + diff --git a/meta-ros-common/recipes-graphics/freeimage/freeimage/Use-system-jpeg_read_icc_profile.patch b/meta-ros-common/recipes-graphics/freeimage/freeimage/Use-system-jpeg_read_icc_profile.patch new file mode 100644 index 00000000000..62edae8e7f8 --- /dev/null +++ b/meta-ros-common/recipes-graphics/freeimage/freeimage/Use-system-jpeg_read_icc_profile.patch @@ -0,0 +1,128 @@ +Description: Use jpeg_read_icc_profile() from libjpeg + Current version of libjpeg8-turbo provides jpeg_read_icc_profile(), which + means our static definition now conflicts with the system headers. Drop + the local implementation in favor of the (compatible) libjpeg one. +Author: Steve Langasek +Last-Modified: 2018-11-14 + +Index: freeimage-3.17.0+ds1/Source/FreeImage/PluginJPEG.cpp +=================================================================== +--- freeimage-3.17.0+ds1.orig/Source/FreeImage/PluginJPEG.cpp ++++ freeimage-3.17.0+ds1/Source/FreeImage/PluginJPEG.cpp +@@ -485,116 +485,6 @@ + } + + /** +- See if there was an ICC profile in the JPEG file being read; +- if so, reassemble and return the profile data. +- +- TRUE is returned if an ICC profile was found, FALSE if not. +- If TRUE is returned, *icc_data_ptr is set to point to the +- returned data, and *icc_data_len is set to its length. +- +- IMPORTANT: the data at **icc_data_ptr has been allocated with malloc() +- and must be freed by the caller with free() when the caller no longer +- needs it. (Alternatively, we could write this routine to use the +- IJG library's memory allocator, so that the data would be freed implicitly +- at jpeg_finish_decompress() time. But it seems likely that many apps +- will prefer to have the data stick around after decompression finishes.) +- +- NOTE: if the file contains invalid ICC APP2 markers, we just silently +- return FALSE. You might want to issue an error message instead. +-*/ +-BOOL +-jpeg_read_icc_profile(j_decompress_ptr cinfo, JOCTET **icc_data_ptr, unsigned *icc_data_len) { +- jpeg_saved_marker_ptr marker; +- int num_markers = 0; +- int seq_no; +- JOCTET *icc_data; +- unsigned total_length; +- +- const int MAX_SEQ_NO = 255; // sufficient since marker numbers are bytes +- BYTE marker_present[MAX_SEQ_NO+1]; // 1 if marker found +- unsigned data_length[MAX_SEQ_NO+1]; // size of profile data in marker +- unsigned data_offset[MAX_SEQ_NO+1]; // offset for data in marker +- +- *icc_data_ptr = NULL; // avoid confusion if FALSE return +- *icc_data_len = 0; +- +- /** +- this first pass over the saved markers discovers whether there are +- any ICC markers and verifies the consistency of the marker numbering. +- */ +- +- memset(marker_present, 0, (MAX_SEQ_NO + 1)); +- +- for(marker = cinfo->marker_list; marker != NULL; marker = marker->next) { +- if (marker_is_icc(marker)) { +- if (num_markers == 0) { +- // number of markers +- num_markers = GETJOCTET(marker->data[13]); +- } +- else if (num_markers != GETJOCTET(marker->data[13])) { +- return FALSE; // inconsistent num_markers fields +- } +- // sequence number +- seq_no = GETJOCTET(marker->data[12]); +- if (seq_no <= 0 || seq_no > num_markers) { +- return FALSE; // bogus sequence number +- } +- if (marker_present[seq_no]) { +- return FALSE; // duplicate sequence numbers +- } +- marker_present[seq_no] = 1; +- data_length[seq_no] = marker->data_length - ICC_HEADER_SIZE; +- } +- } +- +- if (num_markers == 0) +- return FALSE; +- +- /** +- check for missing markers, count total space needed, +- compute offset of each marker's part of the data. +- */ +- +- total_length = 0; +- for(seq_no = 1; seq_no <= num_markers; seq_no++) { +- if (marker_present[seq_no] == 0) { +- return FALSE; // missing sequence number +- } +- data_offset[seq_no] = total_length; +- total_length += data_length[seq_no]; +- } +- +- if (total_length <= 0) +- return FALSE; // found only empty markers ? +- +- // allocate space for assembled data +- icc_data = (JOCTET *) malloc(total_length * sizeof(JOCTET)); +- if (icc_data == NULL) +- return FALSE; // out of memory +- +- // and fill it in +- for (marker = cinfo->marker_list; marker != NULL; marker = marker->next) { +- if (marker_is_icc(marker)) { +- JOCTET FAR *src_ptr; +- JOCTET *dst_ptr; +- unsigned length; +- seq_no = GETJOCTET(marker->data[12]); +- dst_ptr = icc_data + data_offset[seq_no]; +- src_ptr = marker->data + ICC_HEADER_SIZE; +- length = data_length[seq_no]; +- while (length--) { +- *dst_ptr++ = *src_ptr++; +- } +- } +- } +- +- *icc_data_ptr = icc_data; +- *icc_data_len = total_length; +- +- return TRUE; +-} +- +-/** + Read JPEG_APPD marker (IPTC or Adobe Photoshop profile) + */ + static BOOL diff --git a/meta-ros-common/recipes-graphics/freeimage/freeimage/fix-include-dirs.patch b/meta-ros-common/recipes-graphics/freeimage/freeimage/fix-include-dirs.patch new file mode 100644 index 00000000000..d3193ca5647 --- /dev/null +++ b/meta-ros-common/recipes-graphics/freeimage/freeimage/fix-include-dirs.patch @@ -0,0 +1,19 @@ +Index: git/Makefile.gnu +=================================================================== +--- git.orig/Makefile.gnu ++++ git/Makefile.gnu +@@ -26,12 +26,12 @@ override CFLAGS += -DOPJ_STATIC + override CFLAGS += -DNO_LCMS + # LibJXR + override CFLAGS += -DDISABLE_PERF_MEASUREMENT -D__ANSI__ +-override CFLAGS += $(INCLUDE) -I/usr/include/jxrlib $(shell $(PKG_CONFIG) --cflags libjpeg libopenjp2 libpng libraw libtiff-4 libwebpmux OpenEXR zlib) ++override CFLAGS += $(INCLUDE) $(shell $(PKG_CONFIG) --cflags libjpeg libopenjp2 libpng libraw libtiff-4 libwebpmux OpenEXR zlib libjxr) + CXXFLAGS ?= -O3 -fPIC + override CXXFLAGS += -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy + # LibJXR + override CXXFLAGS += -D__ANSI__ +-override CXXFLAGS += $(INCLUDE) -I/usr/include/jxrlib $(shell $(PKG_CONFIG) --cflags libjpeg libopenjp2 libpng libraw libtiff-4 libwebpmux OpenEXR zlib) ++override CXXFLAGS += $(INCLUDE) $(shell $(PKG_CONFIG) --cflags libjpeg libopenjp2 libpng libraw libtiff-4 libwebpmux OpenEXR zlib libjxr) + + TARGET = freeimage + STATICLIB = lib$(TARGET).a diff --git a/meta-ros-common/recipes-graphics/freeimage/freeimage/r1830-minor-refactoring.patch b/meta-ros-common/recipes-graphics/freeimage/freeimage/r1830-minor-refactoring.patch new file mode 100644 index 00000000000..a4da6a12455 --- /dev/null +++ b/meta-ros-common/recipes-graphics/freeimage/freeimage/r1830-minor-refactoring.patch @@ -0,0 +1,15 @@ +Index: Source/Utilities.h +=================================================================== +diff --git a/Source/Utilities.h b/Source/Utilities.h +--- a/Source/Utilities.h (revision 1829) ++++ b/Source/Utilities.h (revision 1830) +@@ -529,7 +529,8 @@ + static const char *FI_MSG_ERROR_DIB_MEMORY = "DIB allocation failed, maybe caused by an invalid image size or by a lack of memory"; + static const char *FI_MSG_ERROR_PARSING = "Parsing error"; + static const char *FI_MSG_ERROR_MAGIC_NUMBER = "Invalid magic number"; +-static const char *FI_MSG_ERROR_UNSUPPORTED_FORMAT = "Unsupported format"; ++static const char *FI_MSG_ERROR_UNSUPPORTED_FORMAT = "Unsupported image format"; ++static const char *FI_MSG_ERROR_INVALID_FORMAT = "Invalid file format"; + static const char *FI_MSG_ERROR_UNSUPPORTED_COMPRESSION = "Unsupported compression type"; + static const char *FI_MSG_WARNING_INVALID_THUMBNAIL = "Warning: attached thumbnail cannot be written to output file (invalid format) - Thumbnail saving aborted"; + diff --git a/meta-ros-common/recipes-graphics/freeimage/freeimage/r1832-improved-BMP-plugin-when-working-with-malicious-images.patch b/meta-ros-common/recipes-graphics/freeimage/freeimage/r1832-improved-BMP-plugin-when-working-with-malicious-images.patch new file mode 100644 index 00000000000..e69c0a2d8b3 --- /dev/null +++ b/meta-ros-common/recipes-graphics/freeimage/freeimage/r1832-improved-BMP-plugin-when-working-with-malicious-images.patch @@ -0,0 +1,455 @@ +Origin: upstream, r1832 +Index: Source/FreeImage/PluginBMP.cpp +--- +diff --git a/Source/FreeImage/PluginBMP.cpp b/Source/FreeImage/PluginBMP.cpp +--- a/Source/FreeImage/PluginBMP.cpp (revision 1831) ++++ b/Source/FreeImage/PluginBMP.cpp (revision 1832) +@@ -181,6 +181,7 @@ + } + } + #endif ++ + #if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_RGB + if (bit_count == 24 || bit_count == 32) { + for(unsigned y = 0; y < FreeImage_GetHeight(dib); y++) { +@@ -202,7 +203,7 @@ + @param handle FreeImage IO handle + @param width Image width + @param height Image height +-@param dib Image to be loaded ++@param dib 4-bit image to be loaded + @return Returns TRUE if successful, returns FALSE otherwise + */ + static BOOL +@@ -217,7 +218,9 @@ + height = abs(height); + + pixels = (BYTE*)malloc(width * height * sizeof(BYTE)); +- if(!pixels) throw(1); ++ if (!pixels) { ++ throw(1); ++ } + memset(pixels, 0, width * height * sizeof(BYTE)); + + BYTE *q = pixels; +@@ -237,7 +240,7 @@ + throw(1); + } + for (int i = 0; i < status_byte; i++) { +- *q++=(BYTE)((i & 0x01) ? (second_byte & 0x0f) : ((second_byte >> 4) & 0x0f)); ++ *q++ = (BYTE)((i & 0x01) ? (second_byte & 0x0f) : ((second_byte >> 4) & 0x0f)); + } + bits += status_byte; + } +@@ -252,7 +255,7 @@ + // End of line + bits = 0; + scanline++; +- q = pixels + scanline*width; ++ q = pixels + scanline * width; + } + break; + +@@ -264,7 +267,6 @@ + case RLE_DELTA: + { + // read the delta values +- + BYTE delta_x = 0; + BYTE delta_y = 0; + +@@ -276,7 +278,6 @@ + } + + // apply them +- + bits += delta_x; + scanline += delta_y; + q = pixels + scanline*width+bits; +@@ -293,7 +294,7 @@ + throw(1); + } + } +- *q++=(BYTE)((i & 0x01) ? (second_byte & 0x0f) : ((second_byte >> 4) & 0x0f)); ++ *q++ = (BYTE)((i & 0x01) ? (second_byte & 0x0f) : ((second_byte >> 4) & 0x0f)); + } + bits += status_byte; + // Read pad byte +@@ -334,7 +335,9 @@ + return TRUE; + + } catch(int) { +- if(pixels) free(pixels); ++ if (pixels) { ++ free(pixels); ++ } + return FALSE; + } + } +@@ -345,7 +348,7 @@ + @param handle FreeImage IO handle + @param width Image width + @param height Image height +-@param dib Image to be loaded ++@param dib 8-bit image to be loaded + @return Returns TRUE if successful, returns FALSE otherwise + */ + static BOOL +@@ -354,103 +357,85 @@ + BYTE second_byte = 0; + int scanline = 0; + int bits = 0; ++ int count = 0; ++ BYTE delta_x = 0; ++ BYTE delta_y = 0; + +- for (;;) { +- if( io->read_proc(&status_byte, sizeof(BYTE), 1, handle) != 1) { ++ height = abs(height); ++ ++ while(scanline < height) { ++ ++ if (io->read_proc(&status_byte, sizeof(BYTE), 1, handle) != 1) { + return FALSE; + } + +- switch (status_byte) { +- case RLE_COMMAND : +- if(io->read_proc(&status_byte, sizeof(BYTE), 1, handle) != 1) { +- return FALSE; +- } ++ if (status_byte == RLE_COMMAND) { ++ if (io->read_proc(&status_byte, sizeof(BYTE), 1, handle) != 1) { ++ return FALSE; ++ } + +- switch (status_byte) { +- case RLE_ENDOFLINE : +- bits = 0; +- scanline++; +- break; ++ switch (status_byte) { ++ case RLE_ENDOFLINE: ++ bits = 0; ++ scanline++; ++ break; + +- case RLE_ENDOFBITMAP : +- return TRUE; ++ case RLE_ENDOFBITMAP: ++ return TRUE; + +- case RLE_DELTA : +- { +- // read the delta values ++ case RLE_DELTA: ++ // read the delta values ++ delta_x = 0; ++ delta_y = 0; ++ if (io->read_proc(&delta_x, sizeof(BYTE), 1, handle) != 1) { ++ return FALSE; ++ } ++ if (io->read_proc(&delta_y, sizeof(BYTE), 1, handle) != 1) { ++ return FALSE; ++ } ++ // apply them ++ bits += delta_x; ++ scanline += delta_y; ++ break; + +- BYTE delta_x = 0; +- BYTE delta_y = 0; +- +- if(io->read_proc(&delta_x, sizeof(BYTE), 1, handle) != 1) { +- return FALSE; +- } +- if(io->read_proc(&delta_y, sizeof(BYTE), 1, handle) != 1) { +- return FALSE; +- } +- +- // apply them +- +- bits += delta_x; +- scanline += delta_y; +- +- break; ++ default: ++ // absolute mode ++ count = MIN((int)status_byte, width - bits); ++ if (count < 0) { ++ return FALSE; + } +- +- default : +- { +- if(scanline >= abs(height)) { +- return TRUE; +- } +- +- int count = MIN((int)status_byte, width - bits); +- +- BYTE *sline = FreeImage_GetScanLine(dib, scanline); +- +- if(io->read_proc((void *)(sline + bits), sizeof(BYTE) * count, 1, handle) != 1) { ++ BYTE *sline = FreeImage_GetScanLine(dib, scanline); ++ if (io->read_proc((void *)(sline + bits), sizeof(BYTE) * count, 1, handle) != 1) { ++ return FALSE; ++ } ++ // align run length to even number of bytes ++ if ((status_byte & 1) == 1) { ++ if (io->read_proc(&second_byte, sizeof(BYTE), 1, handle) != 1) { + return FALSE; + } +- +- // align run length to even number of bytes +- +- if ((status_byte & 1) == 1) { +- if(io->read_proc(&second_byte, sizeof(BYTE), 1, handle) != 1) { +- return FALSE; +- } +- } +- +- bits += status_byte; +- +- break; + } +- } ++ bits += status_byte; ++ break; + +- break; +- +- default : +- { +- if(scanline >= abs(height)) { +- return TRUE; +- } +- +- int count = MIN((int)status_byte, width - bits); +- +- BYTE *sline = FreeImage_GetScanLine(dib, scanline); +- +- if(io->read_proc(&second_byte, sizeof(BYTE), 1, handle) != 1) { +- return FALSE; +- } +- +- for (int i = 0; i < count; i++) { +- *(sline + bits) = second_byte; +- +- bits++; +- } +- +- break; ++ } // switch (status_byte) ++ } ++ else { ++ count = MIN((int)status_byte, width - bits); ++ if (count < 0) { ++ return FALSE; + } ++ BYTE *sline = FreeImage_GetScanLine(dib, scanline); ++ if (io->read_proc(&second_byte, sizeof(BYTE), 1, handle) != 1) { ++ return FALSE; ++ } ++ for (int i = 0; i < count; i++) { ++ *(sline + bits) = second_byte; ++ bits++; ++ } + } + } ++ ++ return FALSE; + } + + // -------------------------------------------------------------------------- +@@ -463,10 +448,12 @@ + BOOL header_only = (flags & FIF_LOAD_NOPIXELS) == FIF_LOAD_NOPIXELS; + + // load the info header +- + BITMAPINFOHEADER bih; ++ memset(&bih, 0, sizeof(BITMAPINFOHEADER)); ++ if (io->read_proc(&bih, sizeof(BITMAPINFOHEADER), 1, handle) != 1) { ++ throw FI_MSG_ERROR_INVALID_FORMAT; ++ } + +- io->read_proc(&bih, sizeof(BITMAPINFOHEADER), 1, handle); + #ifdef FREEIMAGE_BIGENDIAN + SwapInfoHeader(&bih); + #endif +@@ -514,8 +501,8 @@ + } + + // load the palette ++ io->read_proc(FreeImage_GetPalette(dib), used_colors * sizeof(RGBQUAD), 1, handle); + +- io->read_proc(FreeImage_GetPalette(dib), used_colors * sizeof(RGBQUAD), 1, handle); + #if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_RGB + RGBQUAD *pal = FreeImage_GetPalette(dib); + for(unsigned i = 0; i < used_colors; i++) { +@@ -544,7 +531,7 @@ + break; + + case BI_RLE4 : +- if( LoadPixelDataRLE4(io, handle, width, height, dib) ) { ++ if( (bit_count == 4) && LoadPixelDataRLE4(io, handle, width, height, dib) ) { + return dib; + } else { + throw "Error encountered while decoding RLE4 BMP data"; +@@ -552,7 +539,7 @@ + break; + + case BI_RLE8 : +- if( LoadPixelDataRLE8(io, handle, width, height, dib) ) { ++ if( (bit_count == 8) && LoadPixelDataRLE8(io, handle, width, height, dib) ) { + return dib; + } else { + throw "Error encountered while decoding RLE8 BMP data"; +@@ -602,7 +589,7 @@ + + return dib; + } +- break; // 16-bit ++ break; // 16-bit RGB + + case 24 : + case 32 : +@@ -679,10 +666,12 @@ + BOOL header_only = (flags & FIF_LOAD_NOPIXELS) == FIF_LOAD_NOPIXELS; + + // load the info header +- + BITMAPINFOHEADER bih; ++ memset(&bih, 0, sizeof(BITMAPINFOHEADER)); ++ if (io->read_proc(&bih, sizeof(BITMAPINFOHEADER), 1, handle) != 1) { ++ throw FI_MSG_ERROR_INVALID_FORMAT; ++ } + +- io->read_proc(&bih, sizeof(BITMAPINFOHEADER), 1, handle); + #ifdef FREEIMAGE_BIGENDIAN + SwapInfoHeader(&bih); + #endif +@@ -767,17 +756,19 @@ + return dib; + + case BI_RLE4 : +- if( LoadPixelDataRLE4(io, handle, width, height, dib) ) { ++ if ((bit_count == 4) && LoadPixelDataRLE4(io, handle, width, height, dib)) { + return dib; +- } else { ++ } ++ else { + throw "Error encountered while decoding RLE4 BMP data"; + } + break; + + case BI_RLE8 : +- if( LoadPixelDataRLE8(io, handle, width, height, dib) ) { ++ if ((bit_count == 8) && LoadPixelDataRLE8(io, handle, width, height, dib)) { + return dib; +- } else { ++ } ++ else { + throw "Error encountered while decoding RLE8 BMP data"; + } + break; +@@ -863,9 +854,9 @@ + } + } + } catch(const char *message) { +- if(dib) ++ if (dib) { + FreeImage_Unload(dib); +- ++ } + FreeImage_OutputMessageProc(s_format_id, message); + } + +@@ -881,9 +872,13 @@ + try { + BOOL header_only = (flags & FIF_LOAD_NOPIXELS) == FIF_LOAD_NOPIXELS; + ++ // load the info header + BITMAPINFOOS2_1X_HEADER bios2_1x; ++ memset(&bios2_1x, 0, sizeof(BITMAPINFOOS2_1X_HEADER)); ++ if (io->read_proc(&bios2_1x, sizeof(BITMAPINFOOS2_1X_HEADER), 1, handle) != 1) { ++ throw FI_MSG_ERROR_INVALID_FORMAT; ++ } + +- io->read_proc(&bios2_1x, sizeof(BITMAPINFOOS2_1X_HEADER), 1, handle); + #ifdef FREEIMAGE_BIGENDIAN + SwapOS21XHeader(&bios2_1x); + #endif +@@ -1005,9 +1000,9 @@ + } + } + } catch(const char *message) { +- if(dib) ++ if (dib) { + FreeImage_Unload(dib); +- ++ } + FreeImage_OutputMessageProc(s_format_id, message); + } + +@@ -1090,19 +1085,20 @@ + BITMAPFILEHEADER bitmapfileheader; + DWORD type = 0; + +- // we use this offset value to make seemingly absolute seeks relative in the file +- ++ // we use this offset value to make seemingly absolute seeks relative in the file + long offset_in_file = io->tell_proc(handle); + + // read the fileheader ++ memset(&bitmapfileheader, 0, sizeof(BITMAPFILEHEADER)); ++ if (io->read_proc(&bitmapfileheader, sizeof(BITMAPFILEHEADER), 1, handle) != 1) { ++ return NULL; ++ } + +- io->read_proc(&bitmapfileheader, sizeof(BITMAPFILEHEADER), 1, handle); + #ifdef FREEIMAGE_BIGENDIAN + SwapFileHeader(&bitmapfileheader); + #endif + + // check the signature +- + if((bitmapfileheader.bfType != 0x4D42) && (bitmapfileheader.bfType != 0x4142)) { + FreeImage_OutputMessageProc(s_format_id, FI_MSG_ERROR_MAGIC_NUMBER); + return NULL; +@@ -1109,9 +1105,9 @@ + } + + // read the first byte of the infoheader +- + io->read_proc(&type, sizeof(DWORD), 1, handle); + io->seek_proc(handle, 0 - (long)sizeof(DWORD), SEEK_CUR); ++ + #ifdef FREEIMAGE_BIGENDIAN + SwapLong(&type); + #endif +@@ -1138,7 +1134,7 @@ + break; + } + +- FreeImage_OutputMessageProc(s_format_id, "unknown bmp subtype with id %d", type); ++ FreeImage_OutputMessageProc(s_format_id, "Unknown bmp subtype with id %d", type); + } + + return NULL; +@@ -1418,6 +1414,7 @@ + } + + free(buffer); ++ + #ifdef FREEIMAGE_BIGENDIAN + } else if (dst_bpp == 16) { + int padding = dst_pitch - dst_width * sizeof(WORD); +@@ -1439,6 +1436,7 @@ + } + } + #endif ++ + #if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_RGB + } else if (dst_bpp == 24) { + int padding = dst_pitch - dst_width * sizeof(FILE_BGR); diff --git a/meta-ros-common/recipes-graphics/freeimage/freeimage/r1836-improved-BMP-plugin-when-working-with-malicious-images.patch b/meta-ros-common/recipes-graphics/freeimage/freeimage/r1836-improved-BMP-plugin-when-working-with-malicious-images.patch new file mode 100644 index 00000000000..27b5a45c332 --- /dev/null +++ b/meta-ros-common/recipes-graphics/freeimage/freeimage/r1836-improved-BMP-plugin-when-working-with-malicious-images.patch @@ -0,0 +1,159 @@ +Origin: upstream, r1836 +Index: Source/FreeImage/PluginBMP.cpp +--- +diff --git a/Source/FreeImage/PluginBMP.cpp b/Source/FreeImage/PluginBMP.cpp +--- a/Source/FreeImage/PluginBMP.cpp (revision 1835) ++++ b/Source/FreeImage/PluginBMP.cpp (revision 1836) +@@ -139,6 +139,75 @@ + // -------------------------------------------------------------------------- + + /** ++Check if a BITMAPINFOHEADER is valid ++@return Returns TRUE if successful, returns FALSE otherwise ++*/ ++static BOOL ++CheckBitmapInfoHeader(BITMAPINFOHEADER *bih) { ++ if (bih->biSize != sizeof(BITMAPINFOHEADER)) { ++ // The size, in bytes, of the image.This may be set to zero for BI_RGB bitmaps. ++ // If biCompression is BI_JPEG or BI_PNG, biSizeImage indicates the size of the JPEG or PNG image buffer, respectively. ++ if ((bih->biSize == 0) && (bih->biCompression != BI_RGB)) { ++ return FALSE; ++ } ++ else if ((bih->biCompression == BI_JPEG) || (bih->biCompression == BI_PNG)) { ++ // JPEG or PNG is not yet supported ++ return FALSE; ++ } ++ else { ++ return FALSE; ++ } ++ } ++ if (bih->biWidth < 0) { ++ return FALSE; ++ } ++ if (bih->biHeight < 0) { ++ // If biHeight is negative, indicating a top-down DIB, biCompression must be either BI_RGB or BI_BITFIELDS. ++ // Top-down DIBs cannot be compressed. ++ // If biCompression is BI_JPEG or BI_PNG, the biHeight member specifies the height of the decompressed JPEG or PNG image file, respectively. ++ if ((bih->biCompression != BI_RGB) && (bih->biCompression != BI_BITFIELDS)) { ++ return FALSE; ++ } ++ } ++ if (bih->biPlanes != 1) { ++ // The number of planes for the target device. This value must be set to 1. ++ return FALSE; ++ } ++ switch (bih->biBitCount) { ++ case 0: ++ // The number of bits-per-pixel is specified or is implied by the JPEG or PNG format. ++ // JPEG or PNG is not yet supported ++ return FALSE; ++ break; ++ case 1: ++ case 4: ++ case 8: ++ case 16: ++ case 24: ++ case 32: ++ break; ++ default: ++ // Unsupported bitdepth ++ return FALSE; ++ } ++ switch (bih->biCompression) { ++ case BI_RGB: ++ case BI_RLE8: ++ case BI_RLE4: ++ case BI_BITFIELDS: ++ break; ++ case BI_JPEG: ++ case BI_PNG: ++ default: ++ return FALSE; ++ } ++ ++ return TRUE; ++} ++ ++// -------------------------------------------------------------------------- ++ ++/** + Load uncompressed image pixels for 1-, 4-, 8-, 16-, 24- and 32-bit dib + @param io FreeImage IO + @param handle FreeImage IO handle +@@ -458,6 +527,10 @@ + SwapInfoHeader(&bih); + #endif + ++ if (CheckBitmapInfoHeader(&bih) == FALSE) { ++ throw FI_MSG_ERROR_INVALID_FORMAT; ++ } ++ + // keep some general information about the bitmap + + unsigned used_colors = bih.biClrUsed; +@@ -555,10 +628,18 @@ + case 16 : + { + int use_bitfields = 0; +- if (bih.biCompression == BI_BITFIELDS) use_bitfields = 3; +- else if (bih.biCompression == BI_ALPHABITFIELDS) use_bitfields = 4; +- else if (type == 52) use_bitfields = 3; +- else if (type >= 56) use_bitfields = 4; ++ if (bih.biCompression == BI_BITFIELDS) { ++ use_bitfields = 3; ++ } ++ else if (bih.biCompression == BI_ALPHABITFIELDS) { ++ use_bitfields = 4; ++ } ++ else if (type == 52) { ++ use_bitfields = 3; ++ } ++ else if (type >= 56) { ++ use_bitfields = 4; ++ } + + if (use_bitfields > 0) { + DWORD bitfields[4]; +@@ -595,10 +676,18 @@ + case 32 : + { + int use_bitfields = 0; +- if (bih.biCompression == BI_BITFIELDS) use_bitfields = 3; +- else if (bih.biCompression == BI_ALPHABITFIELDS) use_bitfields = 4; +- else if (type == 52) use_bitfields = 3; +- else if (type >= 56) use_bitfields = 4; ++ if (bih.biCompression == BI_BITFIELDS) { ++ use_bitfields = 3; ++ } ++ else if (bih.biCompression == BI_ALPHABITFIELDS) { ++ use_bitfields = 4; ++ } ++ else if (type == 52) { ++ use_bitfields = 3; ++ } ++ else if (type >= 56) { ++ use_bitfields = 4; ++ } + + if (use_bitfields > 0) { + DWORD bitfields[4]; +@@ -676,6 +765,10 @@ + SwapInfoHeader(&bih); + #endif + ++ if (CheckBitmapInfoHeader(&bih) == FALSE) { ++ throw FI_MSG_ERROR_INVALID_FORMAT; ++ } ++ + // keep some general information about the bitmap + + unsigned used_colors = bih.biClrUsed; +@@ -780,7 +873,7 @@ + + case 16 : + { +- if (bih.biCompression == 3) { ++ if (bih.biCompression == BI_BITFIELDS) { + DWORD bitfields[3]; + + io->read_proc(bitfields, 3 * sizeof(DWORD), 1, handle); diff --git a/meta-ros-common/recipes-graphics/freeimage/freeimage/r1848-improved-PFM-plugin-against-malicious-images.patch b/meta-ros-common/recipes-graphics/freeimage/freeimage/r1848-improved-PFM-plugin-against-malicious-images.patch new file mode 100644 index 00000000000..8d2a580d25d --- /dev/null +++ b/meta-ros-common/recipes-graphics/freeimage/freeimage/r1848-improved-PFM-plugin-against-malicious-images.patch @@ -0,0 +1,227 @@ +Origin: upstream, r1848 +Index: Source/FreeImage/PluginPFM.cpp +--- +diff --git a/Source/FreeImage/PluginPFM.cpp b/Source/FreeImage/PluginPFM.cpp +--- a/Source/FreeImage/PluginPFM.cpp (revision 1847) ++++ b/Source/FreeImage/PluginPFM.cpp (revision 1848) +@@ -23,6 +23,12 @@ + #include "Utilities.h" + + // ========================================================== ++// Plugin Interface ++// ========================================================== ++ ++static int s_format_id; ++ ++// ========================================================== + // Internal functions + // ========================================================== + +@@ -59,6 +65,9 @@ + + /** + Get an integer value from the actual position pointed by handle ++@param io ++@param handle ++@return Returns -1 in case of failure, returns the found number otherwise + */ + static int + pfm_get_int(FreeImageIO *io, fi_handle handle) { +@@ -65,70 +74,72 @@ + char c = 0; + BOOL bFirstChar; + +- // skip forward to start of next number ++ try { + +- if(!io->read_proc(&c, 1, 1, handle)) { +- throw FI_MSG_ERROR_PARSING; +- } ++ // skip forward to start of next number + +- while (1) { +- // eat comments ++ if (io->read_proc(&c, 1, 1, handle) != 1) { ++ throw FI_MSG_ERROR_PARSING; ++ } + +- if (c == '#') { +- // if we're at a comment, read to end of line ++ while (1) { ++ // eat comments + +- bFirstChar = TRUE; ++ if (c == '#') { ++ // if we're at a comment, read to end of line + +- while (1) { +- if(!io->read_proc(&c, 1, 1, handle)) { +- throw FI_MSG_ERROR_PARSING; +- } ++ bFirstChar = TRUE; + +- if (bFirstChar && c == ' ') { +- // loop off 1 sp after # +- bFirstChar = FALSE; +- } else if (c == '\n') { +- break; ++ while (1) { ++ if (io->read_proc(&c, 1, 1, handle) != 1) { ++ throw FI_MSG_ERROR_PARSING; ++ } ++ ++ if (bFirstChar && c == ' ') { ++ // loop off 1 sp after # ++ bFirstChar = FALSE; ++ } ++ else if (c == '\n') { ++ break; ++ } + } + } +- } + +- if (c >= '0' && c <='9') { +- // we've found what we were looking for +- break; +- } ++ if (c >= '0' && c <= '9') { ++ // we've found what we were looking for ++ break; ++ } + +- if(!io->read_proc(&c, 1, 1, handle)) { +- throw FI_MSG_ERROR_PARSING; ++ if (io->read_proc(&c, 1, 1, handle) != 1) { ++ throw FI_MSG_ERROR_PARSING; ++ } + } +- } + +- // we're at the start of a number, continue until we hit a non-number ++ // we're at the start of a number, continue until we hit a non-number + +- int i = 0; ++ int i = 0; + +- while (1) { +- i = (i * 10) + (c - '0'); ++ while (1) { ++ i = (i * 10) + (c - '0'); + +- if(!io->read_proc(&c, 1, 1, handle)) { +- throw FI_MSG_ERROR_PARSING; +- } ++ if (io->read_proc(&c, 1, 1, handle) != 1) { ++ throw FI_MSG_ERROR_PARSING; ++ } + +- if (c < '0' || c > '9') { +- break; ++ if (c < '0' || c > '9') { ++ break; ++ } + } +- } + +- return i; ++ return i; ++ } ++ catch (const char *message) { ++ FreeImage_OutputMessageProc(s_format_id, message); ++ return -1; ++ } + } + + // ========================================================== +-// Plugin Interface +-// ========================================================== +- +-static int s_format_id; +- +-// ========================================================== + // Plugin Implementation + // ========================================================== + +@@ -230,8 +241,12 @@ + } + + // Read the header information: width, height and the scale value +- unsigned width = (unsigned) pfm_get_int(io, handle); +- unsigned height = (unsigned) pfm_get_int(io, handle); ++ int width = pfm_get_int(io, handle); ++ int height = pfm_get_int(io, handle); ++ if ((width <= 0) || (height <= 0)) { ++ throw FI_MSG_ERROR_PARSING; ++ } ++ + float scalefactor = 1; + + BOOL bResult = pfm_get_line(io, handle, line_buffer, PFM_MAXLINE); +@@ -262,7 +277,7 @@ + throw FI_MSG_ERROR_MEMORY; + } + +- for (unsigned y = 0; y < height; y++) { ++ for (int y = 0; y < height; y++) { + FIRGBF *bits = (FIRGBF*)FreeImage_GetScanLine(dib, height - 1 - y); + + if(io->read_proc(lineBuffer, sizeof(float), lineWidth, handle) != lineWidth) { +@@ -271,7 +286,7 @@ + float *channel = lineBuffer; + if(scalefactor > 0) { + // MSB +- for (unsigned x = 0; x < width; x++) { ++ for (int x = 0; x < width; x++) { + REVERSEBYTES(channel++, &bits[x].red); + REVERSEBYTES(channel++, &bits[x].green); + REVERSEBYTES(channel++, &bits[x].blue); +@@ -278,7 +293,7 @@ + } + } else { + // LSB +- for (unsigned x = 0; x < width; x++) { ++ for (int x = 0; x < width; x++) { + bits[x].red = *channel++; + bits[x].green = *channel++; + bits[x].blue = *channel++; +@@ -296,7 +311,7 @@ + throw FI_MSG_ERROR_MEMORY; + } + +- for (unsigned y = 0; y < height; y++) { ++ for (int y = 0; y < height; y++) { + float *bits = (float*)FreeImage_GetScanLine(dib, height - 1 - y); + + if(io->read_proc(lineBuffer, sizeof(float), lineWidth, handle) != lineWidth) { +@@ -305,12 +320,12 @@ + float *channel = lineBuffer; + if(scalefactor > 0) { + // MSB - File is Big endian +- for (unsigned x = 0; x < width; x++) { ++ for (int x = 0; x < width; x++) { + REVERSEBYTES(channel++, &bits[x]); + } + } else { + // LSB - File is Little Endian +- for (unsigned x = 0; x < width; x++) { ++ for (int x = 0; x < width; x++) { + bits[x] = *channel++; + } + } +@@ -323,9 +338,12 @@ + return dib; + + } catch (const char *text) { +- if(lineBuffer) free(lineBuffer); +- if(dib) FreeImage_Unload(dib); +- ++ if (lineBuffer) { ++ free(lineBuffer); ++ } ++ if (dib) { ++ FreeImage_Unload(dib); ++ } + if(NULL != text) { + FreeImage_OutputMessageProc(s_format_id, text); + } diff --git a/meta-ros-common/recipes-graphics/freeimage/freeimage/r1877-improved-DDS-plugin-against-malicious-images.patch b/meta-ros-common/recipes-graphics/freeimage/freeimage/r1877-improved-DDS-plugin-against-malicious-images.patch new file mode 100644 index 00000000000..af79c7b866e --- /dev/null +++ b/meta-ros-common/recipes-graphics/freeimage/freeimage/r1877-improved-DDS-plugin-against-malicious-images.patch @@ -0,0 +1,15 @@ +Origin: upstream, r1877 +Index: Source/FreeImage/PluginDDS.cpp +=================================================================== +diff --git a/Source/FreeImage/PluginDDS.cpp b/Source/FreeImage/PluginDDS.cpp +--- a/Source/FreeImage/PluginDDS.cpp (revision 1876) ++++ b/Source/FreeImage/PluginDDS.cpp (revision 1877) +@@ -617,7 +617,7 @@ + // read the file + // ------------------------------------------------------------------------- + +- const int line = CalculateLine(width, bpp); ++ const int line = CalculateLine(width, FreeImage_GetBPP(dib)); + const int filePitch = ((desc->dwFlags & DDSD_PITCH) == DDSD_PITCH) ? (int)desc->dwPitchOrLinearSize : line; + const long delta = (long)filePitch - (long)line; + diff --git a/meta-ros-common/recipes-graphics/freeimage/freeimage/revert-xtiff.patch b/meta-ros-common/recipes-graphics/freeimage/freeimage/revert-xtiff.patch new file mode 100644 index 00000000000..240bb8e81ae --- /dev/null +++ b/meta-ros-common/recipes-graphics/freeimage/freeimage/revert-xtiff.patch @@ -0,0 +1,114 @@ +From: Ghislain Antony Vaillant +Date: Tue, 3 Nov 2015 14:39:33 +0000 +Subject: (Revert) Disable vendored dependencies. + +Revert changes to XTIFF from previous Debian patch. + +Index: freeimage-3.18.0+ds2/Source/Metadata/XTIFF.cpp +=================================================================== +--- freeimage-3.18.0+ds2.orig/Source/Metadata/XTIFF.cpp ++++ freeimage-3.18.0+ds2/Source/Metadata/XTIFF.cpp +@@ -224,33 +224,6 @@ tiff_write_geotiff_profile(TIFF *tif, FI + // TIFF EXIF tag reading & writing + // ---------------------------------------------------------- + +-static uint32 exif_tag_ids[] = { +- EXIFTAG_EXPOSURETIME, EXIFTAG_FNUMBER, EXIFTAG_EXPOSUREPROGRAM, +- EXIFTAG_SPECTRALSENSITIVITY, EXIFTAG_ISOSPEEDRATINGS, EXIFTAG_OECF, +- EXIFTAG_EXIFVERSION, EXIFTAG_DATETIMEORIGINAL, EXIFTAG_DATETIMEDIGITIZED, +- EXIFTAG_COMPONENTSCONFIGURATION, EXIFTAG_COMPRESSEDBITSPERPIXEL, +- EXIFTAG_SHUTTERSPEEDVALUE, EXIFTAG_APERTUREVALUE, +- EXIFTAG_BRIGHTNESSVALUE, EXIFTAG_EXPOSUREBIASVALUE, +- EXIFTAG_MAXAPERTUREVALUE, EXIFTAG_SUBJECTDISTANCE, EXIFTAG_METERINGMODE, +- EXIFTAG_LIGHTSOURCE, EXIFTAG_FLASH, EXIFTAG_FOCALLENGTH, +- EXIFTAG_SUBJECTAREA, EXIFTAG_MAKERNOTE, EXIFTAG_USERCOMMENT, +- EXIFTAG_SUBSECTIME, EXIFTAG_SUBSECTIMEORIGINAL, +- EXIFTAG_SUBSECTIMEDIGITIZED, EXIFTAG_FLASHPIXVERSION, EXIFTAG_COLORSPACE, +- EXIFTAG_PIXELXDIMENSION, EXIFTAG_PIXELYDIMENSION, +- EXIFTAG_RELATEDSOUNDFILE, EXIFTAG_FLASHENERGY, +- EXIFTAG_SPATIALFREQUENCYRESPONSE, EXIFTAG_FOCALPLANEXRESOLUTION, +- EXIFTAG_FOCALPLANEYRESOLUTION, EXIFTAG_FOCALPLANERESOLUTIONUNIT, +- EXIFTAG_SUBJECTLOCATION, EXIFTAG_EXPOSUREINDEX, EXIFTAG_SENSINGMETHOD, +- EXIFTAG_FILESOURCE, EXIFTAG_SCENETYPE, EXIFTAG_CFAPATTERN, +- EXIFTAG_CUSTOMRENDERED, EXIFTAG_EXPOSUREMODE, EXIFTAG_WHITEBALANCE, +- EXIFTAG_DIGITALZOOMRATIO, EXIFTAG_FOCALLENGTHIN35MMFILM, +- EXIFTAG_SCENECAPTURETYPE, EXIFTAG_GAINCONTROL, EXIFTAG_CONTRAST, +- EXIFTAG_SATURATION, EXIFTAG_SHARPNESS, EXIFTAG_DEVICESETTINGDESCRIPTION, +- EXIFTAG_SUBJECTDISTANCERANGE, EXIFTAG_GAINCONTROL, EXIFTAG_GAINCONTROL, +- EXIFTAG_IMAGEUNIQUEID +-}; +-static int nExifTags = sizeof(exif_tag_ids) / sizeof(exif_tag_ids[0]); +- + /** + Read a single Exif tag + +@@ -575,10 +602,43 @@ tiff_read_exif_tags(TIFF *tif, TagLib::M + + // loop over all Core Directory Tags + // ### uses private data, but there is no other way +- // -> Fedora: Best we can do without private headers is to hard-code a list of known EXIF tags and read those + if(md_model == TagLib::EXIF_MAIN) { ++ const TIFFDirectory *td = &tif->tif_dir; ++ ++ uint32 lastTag = 0; //<- used to prevent reading some tags twice (as stored in tif_fieldinfo) ++ ++ for (int fi = 0, nfi = (int)tif->tif_nfields; nfi > 0; nfi--, fi++) { ++ const TIFFField *fld = tif->tif_fields[fi]; ++ ++ const uint32 tag_id = TIFFFieldTag(fld); ++ ++ if(tag_id == lastTag) { ++ continue; ++ } ++ ++ // test if tag value is set ++ // (lifted directly from LibTiff _TIFFWriteDirectory) ++ ++ if( fld->field_bit == FIELD_CUSTOM ) { ++ int is_set = FALSE; ++ ++ for(int ci = 0; ci < td->td_customValueCount; ci++ ) { ++ is_set |= (td->td_customValues[ci].info == fld); ++ } ++ ++ if( !is_set ) { ++ continue; ++ } ++ ++ } else if(!TIFFFieldSet(tif, fld->field_bit)) { ++ continue; ++ } ++ ++ // process *all* other tags (some will be ignored) ++ ++ tiff_read_exif_tag(tif, tag_id, dib, md_model); ++ ++ lastTag = tag_id; +- for (int i = 0; i < nExifTags; ++i) { +- tiff_read_exif_tag(tif, exif_tag_ids[i], dib, md_model); + } + + } +@@ -723,9 +717,10 @@ tiff_write_exif_tags(TIFF *tif, TagLib:: + + TagLib& tag_lib = TagLib::instance(); + ++ for (int fi = 0, nfi = (int)tif->tif_nfields; nfi > 0; nfi--, fi++) { ++ const TIFFField *fld = tif->tif_fields[fi]; ++ ++ const uint32 tag_id = TIFFFieldTag(fld); +- for (int fi = 0, nfi = nExifTags; nfi > 0; nfi--, fi++) { +- const uint32 tag_id = exif_tag_ids[fi]; +- const TIFFField *fld = TIFFFieldWithTag(tif, tag_id); + + if(skip_write_field(tif, tag_id)) { + // skip tags that are already handled by the LibTIFF writing process +@@ -749,7 +742,7 @@ tiff_write_exif_tags(TIFF *tif, TagLib:: + continue; + } + // type of storage may differ (e.g. rationnal array vs float array type) ++ if((unsigned)_TIFFDataSize(tif_tag_type) != FreeImage_TagDataWidth(tag_type)) { +- if((unsigned)TIFFFieldSetGetSize(fld) != FreeImage_TagDataWidth(tag_type)) { + // skip tag or _TIFFmemcpy will fail + continue; + } diff --git a/meta-ros-common/recipes-graphics/freeimage/freeimage_3.18.0-2.bb b/meta-ros-common/recipes-graphics/freeimage/freeimage_3.18.0-2.bb new file mode 100644 index 00000000000..0832dcc537c --- /dev/null +++ b/meta-ros-common/recipes-graphics/freeimage/freeimage_3.18.0-2.bb @@ -0,0 +1,85 @@ +LICENSE = "GPL-2.0-or-later | GPL-3.0-or-later | FIPL-1.0" +LIC_FILES_CHKSUM = "file://Wrapper/Delphi/license.txt;md5=d9993e75dec47df89dbb5da6c939d046 \ + file://license-fi.txt;md5=8e1438cab62c8f655288588dc43daaf6 \ + file://license-gplv2.txt;md5=1fbed70be9d970d3da399f33dae9cc51" + +SRC_URI = " \ + git://salsa.debian.org/science-team/freeimage.git;protocol=https;branch=debian/sid \ + file://Disable-vendored-dependencies.patch \ + file://Use-system-dependencies.patch \ + file://Fix-macro-redefinition-for-64-bit-integer-types.patch \ + file://Fix-compatibility-with-system-libpng.patch \ + file://Disable-usage-of-HTML-timestamps-in-doxygen.patch \ + file://Disable-testing-of-JPEG-transform.patch \ + file://Disable-testing-of-JXR-MemIO.patch \ + file://Fix-encoding-of-fi-header.patch \ + file://Enable-substitution-of-pkg-config.patch \ + file://CVE-2019-12211-13.patch \ + file://Fix_compilation_external-static.patch \ + file://Fix-libraw-compilation.patch \ + file://Use-system-jpeg_read_icc_profile.patch \ + file://Fix-big-endian.patch \ + file://r1830-minor-refactoring.patch \ + file://r1832-improved-BMP-plugin-when-working-with-malicious-images.patch \ + file://r1836-improved-BMP-plugin-when-working-with-malicious-images.patch \ + file://r1848-improved-PFM-plugin-against-malicious-images.patch \ + file://r1877-improved-DDS-plugin-against-malicious-images.patch \ + file://fix-include-dirs.patch \ +" + +PV = "3.18.0-2+git${SRCPV}" +SRCREV = "10780151a1fb824a7fc9f58ca3014624605a50b3" + +S = "${WORKDIR}/git" + +CFLAGS:append = " -fPIC" +CXXFLAGS:append = " -fPIC" + +inherit pkgconfig + +DEPENDS = " \ + dos2unix-native \ + libjpeg-turbo \ + libpng \ + libraw \ + libwebp \ + jxrlib \ + openjpeg \ + openexr \ + tiff \ + zlib \ +" + +do_configure () { + # From Debian rules gen-src-list target + sh gensrclist.sh + oe_runmake -f Makefile.gnu dos2unix + sh genfipsrclist.sh + oe_runmake -f Makefile.fip dos2unix +} + +do_compile () { + oe_runmake +} + +do_install () { + install -d ${D}${includedir} ${D}${libdir} + install -m 644 Source/FreeImage.h ${D}${includedir} + install -m 644 libfreeimage.a ${D}${libdir} + install -m 755 libfreeimage-3.18.0.so ${D}${libdir} + ln -sf libfreeimage-3.18.0.so ${D}${libdir}/libfreeimage.so.3 + ln -sf libfreeimage.so.3 ${D}${libdir}/libfreeimage.so +} + +FILES:${PN} = " \ + ${libdir}/libfreeimage-3.18.0.so \ +" + +FILES:${PN}-dev = " \ + ${libdir}/libfreeimage.so \ + ${libdir}/libfreeimage.so.3 \ + ${libdir}/libfreeimage.a \ + ${includedir}/FreeImage.h \ +" + +BBCLASSEXTEND = "native nativesdk" From 8ca01ab71c2df30269217a4689d8975227b5beb0 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 10:39:03 -0700 Subject: [PATCH 13/60] {common} mongo-cxx-driver-legacy: Add new recipe This recipe is required by warehouse-ros-mongo which uses mongodb. Debian is being used as the upstream source including patches. Additional patches were required to provide bitbake variables to the Scons build system. Fixes to the Scons SConstruct file were also required to use Python3. Signed-off-by: Rob Woolley --- .../1001_set_soname.patch | 35 +++++++++ .../1002_openssl_1.1_compat.patch | 49 +++++++++++++ .../1003_C++11_compat.patch | 43 +++++++++++ .../1004_fix_ftbfs_with_gcc6.1.patch | 18 +++++ ...001_use_system_libraries_if_possible.patch | 69 ++++++++++++++++++ .../2002_add-latomic-for-mips32.patch | 45 ++++++++++++ .../Add-octal-prefix-to-umask.patch | 35 +++++++++ ...-import-of-modules-in-same-directory.patch | 15 ++++ .../Fix-python-syntax.patch | 22 ++++++ .../Open-generated-files-as-text.patch | 22 ++++++ .../Remove-reference-to-urllib2.patch | 12 +++ .../Use-PATH-envvar.patch | 12 +++ .../Use-Python3-queue.patch | 31 ++++++++ .../boost-1.67-compat.patch | 21 ++++++ .../mongo-cxx-driver-legacy_1.1.3-1.bb | 73 +++++++++++++++++++ 15 files changed, 502 insertions(+) create mode 100644 meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/1001_set_soname.patch create mode 100644 meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/1002_openssl_1.1_compat.patch create mode 100644 meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/1003_C++11_compat.patch create mode 100644 meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/1004_fix_ftbfs_with_gcc6.1.patch create mode 100644 meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/2001_use_system_libraries_if_possible.patch create mode 100644 meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/2002_add-latomic-for-mips32.patch create mode 100644 meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Add-octal-prefix-to-umask.patch create mode 100644 meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Fix-import-of-modules-in-same-directory.patch create mode 100644 meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Fix-python-syntax.patch create mode 100644 meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Open-generated-files-as-text.patch create mode 100644 meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Remove-reference-to-urllib2.patch create mode 100644 meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Use-PATH-envvar.patch create mode 100644 meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Use-Python3-queue.patch create mode 100644 meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/boost-1.67-compat.patch create mode 100644 meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy_1.1.3-1.bb diff --git a/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/1001_set_soname.patch b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/1001_set_soname.patch new file mode 100644 index 00000000000..690d0c599e8 --- /dev/null +++ b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/1001_set_soname.patch @@ -0,0 +1,35 @@ +Description: fix some issues + Fix the following issues: + - adding missing soname to installed shared libraries +Author: Giulio Paci +Forwarded: yes +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/src/SConscript.client ++++ b/src/SConscript.client +@@ -370,7 +370,7 @@ + mongoClientSharedLib = None + + if buildShared: +- ++ EnsureSConsVersion(2, 3, 0) + # TODO: When we are ready to set a SONAME for mongoclient, set SHLIBVERSION=x.y.z in this + # environment to enable SCons versioned shared library support, and then change the two + # 'Install' calls in this block to 'InstallVersionedLibrary'. SHLIBVERSION and +@@ -388,6 +388,7 @@ + if not windows: + sharedLibEnv.AppendUnique(CCFLAGS="-fvisibility=hidden") + sharedLibEnv.AppendUnique(SHLINKFLAGS="-fvisibility=hidden") ++ sharedLibEnv.AppendUnique(SHLIBVERSION="0.0.0") + + mongoClientSharedLib = sharedLibEnv.SharedLibrary(sharedLibName, clientSource) + libEnv.Alias('driver', mongoClientSharedLib) +@@ -402,7 +403,7 @@ + mongoClientSharedLib[0].abspath + )) + +- mongoClientSharedLibPrefixInstall = sharedLibEnv.Install( ++ mongoClientSharedLibPrefixInstall = sharedLibEnv.InstallVersionedLib( + '$INSTALL_DIR/lib', mongoClientSharedLib) + if darwin: + sharedLibEnv.AddPostAction( diff --git a/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/1002_openssl_1.1_compat.patch b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/1002_openssl_1.1_compat.patch new file mode 100644 index 00000000000..b0c4be477b4 --- /dev/null +++ b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/1002_openssl_1.1_compat.patch @@ -0,0 +1,49 @@ +Author: Apollon Oikonomopoulos +Description: Fix build with OpenSSL 1.1 + Largely based on https://jira.mongodb.org/browse/SERVER-26781 +Forwarded: no (legacy, see https://jira.mongodb.org/browse/CXX-922) +Last-Update: 2016-11-09 +--- a/src/mongo/util/net/ssl_manager.cpp ++++ b/src/mongo/util/net/ssl_manager.cpp +@@ -628,7 +628,7 @@ + + bool SSLManager::_setSubjectName(const std::string& keyFile, std::string& subjectName) { + // Read the certificate subject name and store it +- BIO* in = BIO_new(BIO_s_file_internal()); ++ BIO* in = BIO_new(BIO_s_file()); + if (NULL == in) { + error() << "failed to allocate BIO object: " << getSSLErrorMessage(ERR_get_error()) << endl; + return false; +--- a/src/mongo/crypto/crypto_openssl.cpp ++++ b/src/mongo/crypto/crypto_openssl.cpp +@@ -34,19 +34,24 @@ + * Computes a SHA-1 hash of 'input'. + */ + bool sha1(const unsigned char* input, const size_t inputLen, unsigned char* output) { +- EVP_MD_CTX digestCtx; +- EVP_MD_CTX_init(&digestCtx); +- ON_BLOCK_EXIT(EVP_MD_CTX_cleanup, &digestCtx); ++ EVP_MD_CTX *digestCtx; ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ EVP_MD_CTX_init(digestCtx); ++ ON_BLOCK_EXIT(EVP_MD_CTX_cleanup, digestCtx); ++#else ++ digestCtx = EVP_MD_CTX_new(); ++ ON_BLOCK_EXIT(EVP_MD_CTX_free, digestCtx); ++#endif + +- if (1 != EVP_DigestInit_ex(&digestCtx, EVP_sha1(), NULL)) { ++ if (1 != EVP_DigestInit_ex(digestCtx, EVP_sha1(), NULL)) { + return false; + } + +- if (1 != EVP_DigestUpdate(&digestCtx, input, inputLen)) { ++ if (1 != EVP_DigestUpdate(digestCtx, input, inputLen)) { + return false; + } + +- return (1 == EVP_DigestFinal_ex(&digestCtx, output, NULL)); ++ return (1 == EVP_DigestFinal_ex(digestCtx, output, NULL)); + } + + /* diff --git a/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/1003_C++11_compat.patch b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/1003_C++11_compat.patch new file mode 100644 index 00000000000..d4b0694cb2e --- /dev/null +++ b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/1003_C++11_compat.patch @@ -0,0 +1,43 @@ +Author: Apollon Oikonomopoulos +Description: Use C++11's std::regex instead of boost::regex +Forwarded: no (legacy) +Last-Update: 2016-11-09 +--- a/src/mongo/client/dbclient.cpp ++++ b/src/mongo/client/dbclient.cpp +@@ -51,10 +51,10 @@ + #include + #include + #include +-#include + + #include + #include ++#include + + #ifdef MONGO_SSL + #include "mongo/client/native_sasl_client_session.h" +@@ -380,10 +380,10 @@ + } + + ConnectionString ConnectionString::_parseURL(const string& url, string& errmsg) { +- const boost::regex mongoUrlRe(kMongoDBURL); ++ const std::regex mongoUrlRe(kMongoDBURL); + +- boost::smatch matches; +- if (!boost::regex_match(url, matches, mongoUrlRe)) { ++ std::smatch matches; ++ if (!std::regex_match(url, matches, mongoUrlRe)) { + errmsg = "Failed to parse mongodb:// URL: " + url; + return ConnectionString(); + } +--- a/SConstruct ++++ b/SConstruct +@@ -393,7 +393,7 @@ + + printLocalInfo() + +-boostLibs = [ "regex", "thread" , "system" ] ++boostLibs = [ "thread" , "system" ] + + linux64 = False + force32 = has_option( "force32" ) diff --git a/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/1004_fix_ftbfs_with_gcc6.1.patch b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/1004_fix_ftbfs_with_gcc6.1.patch new file mode 100644 index 00000000000..5980736b63c --- /dev/null +++ b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/1004_fix_ftbfs_with_gcc6.1.patch @@ -0,0 +1,18 @@ +Author: Apollon Oikonomopoulos +Description: Fix FTBFS (test failure) with GCC 6.1 + Hex float constants are part of C++17 (and only GNU extensions in C++11) + and GCC 6.1 errors out when src/mongo/base/parse_number_test.cpp is + compiled using -std=c++11. +Last-Update: 2016-11-11 +Forwarded: no (legacy) +--- a/src/mongo/base/parse_number_test.cpp ++++ b/src/mongo/base/parse_number_test.cpp +@@ -279,7 +279,7 @@ + + ASSERT_PARSES(double, "0xff", 0xff); + ASSERT_PARSES(double, "-0xff", -0xff); +- ASSERT_PARSES(double, "0xabcab.defdefP-10", 0xabcab.defdefP-10); ++ //ASSERT_PARSES(double, "0xabcab.defdefP-10", 0xabcab.defdefP-10); + #endif + } + diff --git a/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/2001_use_system_libraries_if_possible.patch b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/2001_use_system_libraries_if_possible.patch new file mode 100644 index 00000000000..17ee7906f52 --- /dev/null +++ b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/2001_use_system_libraries_if_possible.patch @@ -0,0 +1,69 @@ +Description: use system libraries if possible + This patch tries to allow the usage of system libraries whenever possible. + Unfortunately it is not easy to perform relevant checks in a proper way, + so, while functional, this patch is not suitable to be sent upstream as + it is likely to create troubles on non-Debian systems. +Author: Giulio Paci +Forwarded: no +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +--- a/src/mongo/SConscript ++++ b/src/mongo/SConscript +@@ -3,6 +3,7 @@ + testEnv = env.Clone() + conf = Configure(testEnv) + conf.CheckLibWithHeader('curl', 'curl/curl.h', 'c') ++conf.CheckLibWithHeader('jsoncpp', 'jsoncpp/json/json.h', 'C++') + testEnv = conf.Finish() + + staticClientEnv = testEnv.Clone() +@@ -35,7 +36,6 @@ + target='integration_test_main', + source=[ + '../third_party/restclient/restclient.cpp', +- '../third_party/jsoncpp/jsoncpp.cpp', + 'orchestration/resource.cpp', + 'orchestration/mongo_resource.cpp', + 'orchestration/server.cpp', +--- a/SConstruct ++++ b/SConstruct +@@ -932,7 +932,10 @@ + except OSError: + pass + +-env.Prepend(CPPPATH=['$VARIANT_DIR/third_party/gtest-1.7.0/include']) ++conf = Configure(env) ++if not conf.CheckCXXHeader('gtest/gtest.h'): ++ env.Prepend(CPPPATH=['$VARIANT_DIR/third_party/gtest-1.7.0/include']) ++env = conf.Finish() + + boostSuffixList = ["-mt", ""] + if get_option("boost-lib-search-suffixes") is not None: +--- a/src/mongo/orchestration/resource.h ++++ b/src/mongo/orchestration/resource.h +@@ -19,7 +19,7 @@ + #include + #include + +-#include "third_party/jsoncpp/json.h" ++#include "jsoncpp/json/json.h" + #include "third_party/restclient/restclient.h" + + // Notes: +--- a/src/third_party/gtest-1.7.0/SConscript ++++ b/src/third_party/gtest-1.7.0/SConscript +@@ -1,7 +1,13 @@ + Import('env') + + gtestEnv = env.Clone() +-gtestEnv.AppendUnique(CPPPATH=['$VARIANT_DIR/third_party/gtest-1.7.0']) ++gtestEnv.AppendUnique(CPPPATH=['/usr/src/gtest']) ++conf = Configure(gtestEnv) ++if not conf.CheckCXXHeader('src/gtest-all.cc'): ++ gtestEnv.AppendUnique(CPPPATH=['$VARIANT_DIR/third_party/gtest-1.7.0']) ++else: ++ gtestEnv.VariantDir('.', '/usr/src/gtest/', duplicate=0) ++gtestEnv = conf.Finish() + + libGTestStatic = gtestEnv.StaticLibrary( + target='gtest', diff --git a/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/2002_add-latomic-for-mips32.patch b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/2002_add-latomic-for-mips32.patch new file mode 100644 index 00000000000..cff0a89feb9 --- /dev/null +++ b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/2002_add-latomic-for-mips32.patch @@ -0,0 +1,45 @@ +--- mongo-cxx-driver-legacy-1.1.2.orig/SConstruct ++++ mongo-cxx-driver-legacy-1.1.2/SConstruct +@@ -686,7 +686,10 @@ if darwin: + elif linux: + + env.Append( LIBS=['m'] ) +- ++ ++ if 'mips' in os.uname()[4] and '32bit' in py_platform.architecture(): ++ env.Append( LIBS=['atomic'] ) ++ + if os.uname()[4] == "x86_64" and not force32: + linux64 = True + nixLibPrefix = "lib64" +@@ -1597,7 +1600,7 @@ def doConfigure(myenv): + test_body = """ + #include + int main(int argc, char **argv) { +- std::atomic a(0); ++ std::atomic a(0); + return a.fetch_add(1); + } + """ +@@ -1609,9 +1612,9 @@ def doConfigure(myenv): + def CheckGCCAtomicBuiltins(context): + test_body = """ + int main(int argc, char **argv) { +- int a = 0; +- int b = 0; +- int c = 0; ++ long long a = 0; ++ long long b = 0; ++ long long c = 0; + + __atomic_compare_exchange(&a, &b, &c, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); + return 0; +@@ -1625,7 +1628,7 @@ def doConfigure(myenv): + def CheckGCCSyncBuiltins(context): + test_body = """ + int main(int argc, char **argv) { +- int a = 0; ++ long long a = 0; + return __sync_fetch_and_add(&a, 1); + } + diff --git a/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Add-octal-prefix-to-umask.patch b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Add-octal-prefix-to-umask.patch new file mode 100644 index 00000000000..eb500370046 --- /dev/null +++ b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Add-octal-prefix-to-umask.patch @@ -0,0 +1,35 @@ +diff --git a/SConstruct b/SConstruct +index ed89571..dfb5686 100644 +--- a/SConstruct ++++ b/SConstruct +@@ -928,7 +928,7 @@ if debugBuild: + env.Append( CPPDEFINES=["MONGO_DEBUG_BUILD"] ); + + try: +- umask = os.umask(022) ++ umask = os.umask(0o022) + except OSError: + pass + +Index: git/src/SConscript.client +=================================================================== +--- git.orig/src/SConscript.client ++++ git/src/SConscript.client +@@ -3,7 +3,7 @@ + # This SConscript describes build and install rules for the Mongo C++ driver and associated exmaple + # programs. + import buildscripts.git +-import httplib ++import http.client + import json + import os + import re +@@ -414,7 +414,7 @@ if buildShared: + mongoClientPrefixInstalls.append(mongoClientSharedLibPrefixInstall) + + inst = libEnv.InstallAs(['$INSTALL_DIR/include/' + x for x in clientHeaders], clientHeaders) +-libEnv.AddPostAction(inst, Chmod('$TARGET', 0644)) ++libEnv.AddPostAction(inst, Chmod('$TARGET', 0o0644)) + mongoClientPrefixInstalls.append(inst); + + diff --git a/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Fix-import-of-modules-in-same-directory.patch b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Fix-import-of-modules-in-same-directory.patch new file mode 100644 index 00000000000..f398c71e197 --- /dev/null +++ b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Fix-import-of-modules-in-same-directory.patch @@ -0,0 +1,15 @@ +Index: git/site_scons/buildscripts/lint.py +=================================================================== +--- git.orig/site_scons/buildscripts/lint.py ++++ git/site_scons/buildscripts/lint.py +@@ -2,8 +2,8 @@ + import sys + import codecs + +-import cpplint +-import utils ++from buildscripts import cpplint ++from buildscripts import utils + + + def run_lint( paths, nudgeOn=False ): diff --git a/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Fix-python-syntax.patch b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Fix-python-syntax.patch new file mode 100644 index 00000000000..5fd74d7313f --- /dev/null +++ b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Fix-python-syntax.patch @@ -0,0 +1,22 @@ +Index: git/SConstruct +=================================================================== +--- git.orig/SConstruct ++++ git/SConstruct +@@ -388,7 +388,7 @@ SConsignFile(str(sconsDataDir.File('scon + def printLocalInfo(): + import sys, SCons + print( "scons version: " + SCons.__version__ ) +- print( "python version: " + " ".join( [ `i` for i in sys.version_info ] ) ) ++ print( "python version: " + ".".join( [ str(i) for i in sys.version_info ][:3] ) ) + + printLocalInfo() + +@@ -1119,7 +1119,7 @@ def doConfigure(myenv): + # to make them real errors. + cloned.Append(CCFLAGS=['-Werror']) + conf = Configure(cloned, help=False, custom_tests = { +- 'CheckFlag' : lambda(ctx) : CheckFlagTest(ctx, tool, extension, flag) ++ 'CheckFlag' : lambda ctx : CheckFlagTest(ctx, tool, extension, flag) + }) + available = conf.CheckFlag() + conf.Finish() diff --git a/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Open-generated-files-as-text.patch b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Open-generated-files-as-text.patch new file mode 100644 index 00000000000..fb9fa50ac0b --- /dev/null +++ b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Open-generated-files-as-text.patch @@ -0,0 +1,22 @@ +Index: git/src/mongo/base/generate_error_codes.py +=================================================================== +--- git.orig/src/mongo/base/generate_error_codes.py ++++ git/src/mongo/base/generate_error_codes.py +@@ -115,7 +115,7 @@ def generate_header(filename, error_code + predicate_declarations = ';\n '.join( + 'static bool is%s(Error err)' % ec[0] for ec in error_classes) + +- open(filename, 'wb').write(header_template % dict( ++ open(filename, 'w').write(header_template % dict( + error_code_enum_declarations=enum_declarations, + error_code_class_predicate_declarations=predicate_declarations)) + +@@ -129,7 +129,7 @@ def generate_source(filename, error_code + 'case %s: return %s' % (ec[0], ec[0]) for ec in error_codes) + predicate_definitions = '\n '.join( + generate_error_class_predicate_definition(*ec) for ec in error_classes) +- open(filename, 'wb').write(source_template % dict( ++ open(filename, 'w').write(source_template % dict( + symbol_to_string_cases=symbol_to_string_cases, + string_to_symbol_cases=string_to_symbol_cases, + int_to_symbol_cases=int_to_symbol_cases, diff --git a/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Remove-reference-to-urllib2.patch b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Remove-reference-to-urllib2.patch new file mode 100644 index 00000000000..7a6fe989804 --- /dev/null +++ b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Remove-reference-to-urllib2.patch @@ -0,0 +1,12 @@ +Index: git/SConstruct +=================================================================== +--- git.orig/SConstruct ++++ git/SConstruct +@@ -13,7 +13,6 @@ import sys + import textwrap + import types + import urllib +-import urllib2 + + import buildscripts.utils + import buildscripts.docs diff --git a/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Use-PATH-envvar.patch b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Use-PATH-envvar.patch new file mode 100644 index 00000000000..8f4c10624d1 --- /dev/null +++ b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Use-PATH-envvar.patch @@ -0,0 +1,12 @@ +Index: git/SConstruct +=================================================================== +--- git.orig/SConstruct ++++ git/SConstruct +@@ -507,6 +507,7 @@ if windows: + envDict['MSVC_USE_SCRIPT'] = msvc_script + + env = Environment(variables=env_vars, **envDict) ++env.PrependENVPath('PATH', os.getenv('PATH')) + del envDict + + def fatal_error(env, msg, *args): diff --git a/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Use-Python3-queue.patch b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Use-Python3-queue.patch new file mode 100644 index 00000000000..35d2c4dee8d --- /dev/null +++ b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/Use-Python3-queue.patch @@ -0,0 +1,31 @@ +Index: git/site_scons/buildscripts/clang_format.py +=================================================================== +--- git.orig/site_scons/buildscripts/clang_format.py ++++ git/site_scons/buildscripts/clang_format.py +@@ -9,7 +9,7 @@ A script that provides: + """ + from __future__ import print_function, absolute_import + +-import Queue ++import queue + import difflib + import itertools + import os +@@ -318,7 +318,7 @@ def parallel_process(items, func): + + # print("Running across %d cpus" % (cpus)) + +- task_queue = Queue.Queue() ++ task_queue = queue.Queue() + + # Use a list so that worker function will capture this variable + pp_event = threading.Event() +@@ -331,7 +331,7 @@ def parallel_process(items, func): + while not pp_event.is_set(): + try: + item = task_queue.get_nowait() +- except Queue.Empty: ++ except queue.Empty: + # if the queue is empty, exit the worker thread + pp_event.set() + return diff --git a/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/boost-1.67-compat.patch b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/boost-1.67-compat.patch new file mode 100644 index 00000000000..4b90c1962c7 --- /dev/null +++ b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy/boost-1.67-compat.patch @@ -0,0 +1,21 @@ +Author: Apollon Oikonomopoulos +Description: Fix build against Boost 1.67 + In Boost 1.67, boost::next and boost::prior were moved from utility.hpp to + next_prior.hpp. Fix this by including next_prior.hpp for Boost 1.67 and + onwards. +Last-Update: 2018-12-06 +Forwarded: no (EOL upstream) +Bug-Debian: https://bugs.debian.org/911888 +--- a/src/mongo/util/net/message_port.h ++++ b/src/mongo/util/net/message_port.h +@@ -21,6 +21,10 @@ + + #include + #include ++#include ++#if BOOST_VERSION >= 106700 ++#include ++#endif + #include + + #include "mongo/util/net/message.h" diff --git a/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy_1.1.3-1.bb b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy_1.1.3-1.bb new file mode 100644 index 00000000000..cef748e49ca --- /dev/null +++ b/meta-ros-common/recipes-support/mongodb/mongo-cxx-driver-legacy_1.1.3-1.bb @@ -0,0 +1,73 @@ +LICENSE = "Apache-2.0 & Zlib & BSD-3-Clause & MIT" +LIC_FILES_CHKSUM = "file://APACHE-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57 \ + file://THIRD-PARTY-NOTICES;md5=f5e9031fc85d11004366eb2ceba66306 \ + file://debian/copyright;md5=d0ec59a33bf93f1e2dd7c0688c0cccbc \ + file://src/third_party/gtest-1.7.0/LICENSE;md5=cbbd27594afd089daa160d3a16dd515a \ + file://src/third_party/restclient/LICENSE;md5=875d6e9ec1cb59099f4d9da1e81d1e91" + +SRC_URI = "git://salsa.debian.org/mongodb-team/mongo-cxx-driver-legacy.git;protocol=https;branch=debian \ + file://Add-octal-prefix-to-umask.patch \ + file://Use-Python3-queue.patch \ + file://Open-generated-files-as-text.patch \ + file://Fix-import-of-modules-in-same-directory.patch \ + file://Remove-reference-to-urllib2.patch \ + file://Use-PATH-envvar.patch \ + file://Fix-python-syntax.patch \ + file://1001_set_soname.patch \ + file://1002_openssl_1.1_compat.patch \ + file://1003_C++11_compat.patch \ + file://1004_fix_ftbfs_with_gcc6.1.patch \ + file://2001_use_system_libraries_if_possible.patch \ + file://2002_add-latomic-for-mips32.patch \ + file://boost-1.67-compat.patch \ +" + +SRCREV = "f007ec261210eb1495838fc0522666b4302e0583" +S = "${WORKDIR}/git" + +inherit python3native + +DEPENDS += " \ + boost \ + python3-scons-native \ +" + +EXTRA_OESCONS = " \ + --prefix="${prefix}" \ + --build-dir="${B}" \ + --directory="${S}" \ + --install-sandbox="${D}" \ + --cxx-use-shell-environment \ + --cc-use-shell-environment \ + CFLAGS="${CFLAGS}" \ + CXXFLAGS="${CXXFLAGS}" \ + LINKFLAGS="${LDFLAGS}" \ +" + +# time_support.cpp:198:49: error: 'snprintf' output may be truncated before the last format character [-Werror=format-truncation=] +CXXFLAGS += "-Wno-error=format-truncation" +# assert_util.h:231:28: error: 'nonnull' argument 'this' compared to NULL [-Werror=nonnull-compare] +CXXFLAGS += "-Wno-error=nonnull-compare" + +do_configure() { + if [ -n "${CONFIGURESTAMPFILE}" -a "${S}" = "${B}" ]; then + if [ -e "${CONFIGURESTAMPFILE}" -a "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a "${CLEANBROKEN}" != "1" ]; then + ${STAGING_BINDIR_NATIVE}/scons --clean ${EXTRA_OESCONS} + fi + + mkdir -p `dirname ${CONFIGURESTAMPFILE}` + echo ${BB_TASKHASH} > ${CONFIGURESTAMPFILE} + fi +} + +do_compile() { + ${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} ${EXTRA_OESCONS} || \ + die "scons build execution failed." +} + +do_install() { + ${STAGING_BINDIR_NATIVE}/scons ${EXTRA_OESCONS} install || \ + die "scons install execution failed." +} + +FILES:${PN}-dev += "${includedir}/mango" From 712be624e477528c51974bd87eeefa1d5be8499f Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 10:43:49 -0700 Subject: [PATCH 14/60] {common} openexr: Add new recipe Add openexr as a dependency for freeimage and ogre. Signed-off-by: Rob Woolley --- .../recipes-graphics/openexr/openexr_3.2.1.bb | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 meta-ros-common/recipes-graphics/openexr/openexr_3.2.1.bb diff --git a/meta-ros-common/recipes-graphics/openexr/openexr_3.2.1.bb b/meta-ros-common/recipes-graphics/openexr/openexr_3.2.1.bb new file mode 100644 index 00000000000..a6d738eed47 --- /dev/null +++ b/meta-ros-common/recipes-graphics/openexr/openexr_3.2.1.bb @@ -0,0 +1,20 @@ +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE.md;md5=b0f98dc4bafd54ae93bbd833040c68a3" + +SRC_URI = "git://github.com/AcademySoftwareFoundation/openexr.git;protocol=https;branch=main" + +PV = "3.2.1+git${SRCPV}" +SRCREV = "6258740337bf3859ed8abcf8d99a1671b2cdd06d" + +S = "${WORKDIR}/git" + +DEPENDS += " \ + doxygen \ + libdeflate \ + imath \ + clang-native \ +" + +inherit cmake python3-dir python3native pkgconfig + +BBCLASSEXTEND = "native nativesdk" From dd4672a495c2ecf8b99c141de5e29666474a8649 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 10:45:12 -0700 Subject: [PATCH 15/60] {common} gts: Add new recipe Add gts as a dependency for Gazebo and Ignition. Signed-off-by: Rob Woolley --- .../recipes-graphics/gts/gts_0.7.6.bb | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 meta-ros-common/recipes-graphics/gts/gts_0.7.6.bb diff --git a/meta-ros-common/recipes-graphics/gts/gts_0.7.6.bb b/meta-ros-common/recipes-graphics/gts/gts_0.7.6.bb new file mode 100644 index 00000000000..de38e8671be --- /dev/null +++ b/meta-ros-common/recipes-graphics/gts/gts_0.7.6.bb @@ -0,0 +1,20 @@ +LICENSE = "LGPL-2.0-only & Unknown" +LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \ + file://debian/copyright;md5=98f2cb72cc54864f096332707c784f81" + +SRC_URI = "git://salsa.debian.org/science-team/gts.git;protocol=https;branch=master \ + file://fix-includes.patch \ + file://fix-predicates_init.patch \ +" +SRC_URI:append:class-native = "file://ignore-libm-native.patch" + +PV = "0.7.6+git${SRCPV}" +SRCREV = "7cfcef0d9fc44f4fe424455027e78b73864590ec" + +S = "${WORKDIR}/git" + +DEPENDS = "glib-2.0" + +inherit autotools pkgconfig + +BBCLASSEXTEND = "native nativesdk" From 05db6c8e1d541edb6bda1d3b5aecd721cb49b1a9 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 10:47:49 -0700 Subject: [PATCH 16/60] {common} python3-colorcet: Add dependencies for caret-analyze Python3 colorcet is required by caret-analyze. Colorcet also depends on param and pyct. Signed-off-by: Rob Woolley --- .../python/python3-colorcet_3.0.1.bb | 17 +++++++++++++++++ .../python/python3-param_1.13.0.bb | 17 +++++++++++++++++ .../python/python3-pyct_0.5.0.bb | 14 ++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 meta-ros-common/recipes-devtools/python/python3-colorcet_3.0.1.bb create mode 100644 meta-ros-common/recipes-devtools/python/python3-param_1.13.0.bb create mode 100644 meta-ros-common/recipes-devtools/python/python3-pyct_0.5.0.bb diff --git a/meta-ros-common/recipes-devtools/python/python3-colorcet_3.0.1.bb b/meta-ros-common/recipes-devtools/python/python3-colorcet_3.0.1.bb new file mode 100644 index 00000000000..4c9620348af --- /dev/null +++ b/meta-ros-common/recipes-devtools/python/python3-colorcet_3.0.1.bb @@ -0,0 +1,17 @@ +SUMMARY = "Collection of perceptually uniform colormaps" +DESCRIPTION = "Colorcet is a collection of perceptually uniform colormaps for \ + use with Python plotting programs like bokeh, matplotlib, holoviews, and \ + datashader based on the set of perceptually uniform colormaps created by \ + Peter Kovesi at the Center for Exploration Targeting." +HOMEPAGE = "https://colorcet.holoviz.org/" + +LICENSE = "CC-BY-4.0" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=b443afaf131aa64a6644f9bd3383f208" + +PYPI_PACKAGE = "colorcet" + +inherit pypi setuptools3 + +DEPENDS += "python3-pyct-native python3-param-native" + +SRC_URI[sha256sum] = "51455a20353d12fac91f953772d8409f2474e6a0db1af3fa4f7005f405a2480b" diff --git a/meta-ros-common/recipes-devtools/python/python3-param_1.13.0.bb b/meta-ros-common/recipes-devtools/python/python3-param_1.13.0.bb new file mode 100644 index 00000000000..c280b661eae --- /dev/null +++ b/meta-ros-common/recipes-devtools/python/python3-param_1.13.0.bb @@ -0,0 +1,17 @@ +SUMMARY = "Make your Python code clearer and more reliable by declaring Parameters." +DESCRIPTION = "Param is a library providing Parameters: Python attributes \ + extended to have features such as type and range checking, dynamically \ + generated values, documentation strings, default values, etc., each of \ + which is inherited from parent classes if not specified in a subclass." +HOMEPAGE = "https://pypi.org/project/param/" + +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=120197d29d1cf583abd283ef26669576" + +PYPI_PACKAGE = "param" + +inherit pypi setuptools3 + +SRC_URI[sha256sum] = "59d55048d42a85e148a69837df42bd11c3391d47fad15ba57d118e145f001ef2" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-ros-common/recipes-devtools/python/python3-pyct_0.5.0.bb b/meta-ros-common/recipes-devtools/python/python3-pyct_0.5.0.bb new file mode 100644 index 00000000000..d9913a39c3b --- /dev/null +++ b/meta-ros-common/recipes-devtools/python/python3-pyct_0.5.0.bb @@ -0,0 +1,14 @@ +SUMMARY = "Python package common tasks for users (e.g. copy examples, fetch data, ...)" +DESCRIPTION = "A utility package that includes pyct.cmd and pyct.build" +HOMEPAGE = "https://github.com/pyviz-dev/pyct" + +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=a5a58acaa3e8f6b6011f5a17eacc6e1e" + +PYPI_PACKAGE = "pyct" + +inherit pypi setuptools3 + +SRC_URI[sha256sum] = "dd9f4ac5cbd8e37c352c04036062d3c5f67efec76d404761ef16b0cbf26aa6a0" + +BBCLASSEXTEND = "native nativesdk" From c1494399945fec2f24f0d95b5eef056ea83459a9 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 10:53:52 -0700 Subject: [PATCH 17/60] {common} assimp: Explicitly add branch name Signed-off-by: Rob Woolley --- meta-ros-common/recipes-graphics/assimp/assimp_5.2.5.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-ros-common/recipes-graphics/assimp/assimp_5.2.5.bb b/meta-ros-common/recipes-graphics/assimp/assimp_5.2.5.bb index 6fd03946590..e2245df30b7 100644 --- a/meta-ros-common/recipes-graphics/assimp/assimp_5.2.5.bb +++ b/meta-ros-common/recipes-graphics/assimp/assimp_5.2.5.bb @@ -8,7 +8,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=d9d5275cab4fb13ae624d42ce64865de" DEPENDS = "zlib" -SRC_URI = "git://github.com/assimp/assimp.git;protocol=https" +SRC_URI = "git://github.com/assimp/assimp.git;protocol=https;branch=master" UPSTREAM_CHECK_GITTAGREGEX = "v(?P(\d+(\.\d+)+))" SRCREV = "9519a62dd20799c5493c638d1ef5a6f484e5faf1" From 6b988bc58b69aa648f7e495673c39cc35802f7a0 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 10:57:45 -0700 Subject: [PATCH 18/60] {common} assimp: Update recipe to 5.4.0 Signed-off-by: Rob Woolley --- .../assimp/{assimp_5.2.5.bb => assimp_5.4.0.bb} | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) rename meta-ros-common/recipes-graphics/assimp/{assimp_5.2.5.bb => assimp_5.4.0.bb} (71%) diff --git a/meta-ros-common/recipes-graphics/assimp/assimp_5.2.5.bb b/meta-ros-common/recipes-graphics/assimp/assimp_5.4.0.bb similarity index 71% rename from meta-ros-common/recipes-graphics/assimp/assimp_5.2.5.bb rename to meta-ros-common/recipes-graphics/assimp/assimp_5.4.0.bb index e2245df30b7..035bf4bbf6f 100644 --- a/meta-ros-common/recipes-graphics/assimp/assimp_5.2.5.bb +++ b/meta-ros-common/recipes-graphics/assimp/assimp_5.4.0.bb @@ -11,12 +11,17 @@ DEPENDS = "zlib" SRC_URI = "git://github.com/assimp/assimp.git;protocol=https;branch=master" UPSTREAM_CHECK_GITTAGREGEX = "v(?P(\d+(\.\d+)+))" -SRCREV = "9519a62dd20799c5493c638d1ef5a6f484e5faf1" +SRCREV = "8b9ed34eaa3e6ad24254cb7e058fb9150f66b865" S = "${WORKDIR}/git" inherit cmake -EXTRA_OECMAKE = "-DASSIMP_BUILD_ASSIMP_TOOLS=OFF -DASSIMP_BUILD_TESTS=OFF -DASSIMP_LIB_INSTALL_DIR=${baselib}" +EXTRA_OECMAKE = " \ + -DASSIMP_BUILD_ASSIMP_TOOLS=OFF \ + -DASSIMP_BUILD_TESTS=OFF \ + -DASSIMP_LIB_INSTALL_DIR=${baselib} \ + -DASSIMP_BUILD_ZLIB=ON \ +" BBCLASSEXTEND = "native nativesdk" From 4651f508d0c04674bd6c3001dea49e8a19edbe1a Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 10:59:58 -0700 Subject: [PATCH 19/60] {common} jasper: Set the math library name We can't use CMake's find_library() macro to find libm in OpenEmbedded when building native recipes. CMake is intentionally configured to not look in the host library paths. As a result, we must ensure that CMake is provided with a suitable default value for the name of the math library. Upstream-Status: Pending Signed-off-by: Rob Woolley --- .../jasper/Set-MATH_LIBRARY-default.patch | 17 +++++++++++++++++ .../recipes-graphics/jasper/jasper_%.bbappend | 5 +++++ 2 files changed, 22 insertions(+) create mode 100644 meta-ros-common/recipes-graphics/jasper/jasper/Set-MATH_LIBRARY-default.patch create mode 100644 meta-ros-common/recipes-graphics/jasper/jasper_%.bbappend diff --git a/meta-ros-common/recipes-graphics/jasper/jasper/Set-MATH_LIBRARY-default.patch b/meta-ros-common/recipes-graphics/jasper/jasper/Set-MATH_LIBRARY-default.patch new file mode 100644 index 00000000000..d643cf8a2e9 --- /dev/null +++ b/meta-ros-common/recipes-graphics/jasper/jasper/Set-MATH_LIBRARY-default.patch @@ -0,0 +1,17 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 230d88c..fd36868 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -276,7 +276,11 @@ endif() + + find_library(MATH_LIBRARY m) + if (NOT MATH_LIBRARY) +- set(MATH_LIBRARY "") ++ if (UNIX) ++ set(MATH_LIBRARY "m") ++ else() ++ set(MATH_LIBRARY "") ++ endif() + endif() + + ################################################################################ diff --git a/meta-ros-common/recipes-graphics/jasper/jasper_%.bbappend b/meta-ros-common/recipes-graphics/jasper/jasper_%.bbappend new file mode 100644 index 00000000000..896a46857ab --- /dev/null +++ b/meta-ros-common/recipes-graphics/jasper/jasper_%.bbappend @@ -0,0 +1,5 @@ +# Copyright (c) 2024 Wind River Systems, Inc. +BBCLASSEXTEND = "native nativesdk" + +FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" +SRC_URI += "file://Set-MATH_LIBRARY-default.patch" From b634016832bbad249eb9289d9fffa25699986372 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 11:06:35 -0700 Subject: [PATCH 20/60] {common} sdformat9: Add new recipe Add sdformat9 for Ignition or Gazebo recipes that require the older version. Signed-off-by: Rob Woolley --- .../sdformat/sdformat9_9.10.1.bb | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 meta-ros-common/recipes-support/sdformat/sdformat9_9.10.1.bb diff --git a/meta-ros-common/recipes-support/sdformat/sdformat9_9.10.1.bb b/meta-ros-common/recipes-support/sdformat/sdformat9_9.10.1.bb new file mode 100644 index 00000000000..b3293edf40c --- /dev/null +++ b/meta-ros-common/recipes-support/sdformat/sdformat9_9.10.1.bb @@ -0,0 +1,35 @@ +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=2a461be67a1edf991251f85f3aadd1d0" + +SRC_URI = "git://github.com/gazebosim/sdformat.git;protocol=https;branch=main" + +PV = "9.10.1" +SRCREV = "1774642ee6ac2d46f9fb335470dd7e881d0e6cc5" + +S = "${WORKDIR}/git" + +inherit cmake pkgconfig +inherit ${@bb.utils.contains('BBFILE_COLLECTIONS', 'qt5-layer', 'cmake_qt5', '', d)} + +DEPENDS = " \ + ignition-cmake2 \ + ignition-math6 \ + ignition-tools1 \ + ignition-utils1 \ + libtinyxml2 \ + urdfdom \ + python3-psutil-native \ + ruby-native \ +" + +FILES:${PN} += " \ + ${libdir}/ruby/ignition/cmdsdformat9.rb \ + ${datadir}/ignition/sdformat9.yaml \ + ${datadir}/sdformat9/* \ + ${datadir}/gz/gz1.completion.d/sdf.bash_completion.sh \ +" + +# *.cmake files have hardcoded sysroot-s in them. +SSTATE_SCAN_FILES:append = " *.cmake" + +BBCLASSEXTEND = "nativesdk native" From 26dd71cfdd64ffee4d0771d40c9e645cfd20202f Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 11:07:37 -0700 Subject: [PATCH 21/60] {common} sdformat12: Add new recipe Add sdformat12 for Ignition or Gazebo recipes that require the newer version. Signed-off-by: Rob Woolley --- .../sdformat/sdformat12_12.0.0.bb | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 meta-ros-common/recipes-support/sdformat/sdformat12_12.0.0.bb diff --git a/meta-ros-common/recipes-support/sdformat/sdformat12_12.0.0.bb b/meta-ros-common/recipes-support/sdformat/sdformat12_12.0.0.bb new file mode 100644 index 00000000000..ba6c049b0a3 --- /dev/null +++ b/meta-ros-common/recipes-support/sdformat/sdformat12_12.0.0.bb @@ -0,0 +1,34 @@ +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://COPYING;md5=2a461be67a1edf991251f85f3aadd1d0 \ + file://LICENSE;md5=881ceadb4a5b6db70a8a48a5f5f0050f" + +SRC_URI = "git://github.com/gazebosim/sdformat.git;protocol=https;branch=main" + +PV = "12.0.0" +SRCREV = "c9494fbeaa36f45f085921f2b509a4074f3984ca" + +S = "${WORKDIR}/git" + +inherit cmake pkgconfig + +DEPENDS = " \ + ignition-cmake2 \ + ignition-math6 \ + ignition-tools1 \ + ignition-utils1 \ + libtinyxml2 \ + urdfdom \ + python3-psutil-native \ + ruby-native \ +" + +PROVIDES = "sdformat" + +FILES:${PN} += " \ + ${libdir}/ruby/ignition/cmdsdformat12.rb \ + ${datadir}/ignition/sdformat12.yaml \ + ${datadir}/sdformat12/* \ +" + +# *.cmake files have hardcoded sysroot-s in them. +SSTATE_SCAN_FILES:append = " *.cmake" From 25348d19fce568a6aef454f08e814535b4460e54 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 11:09:00 -0700 Subject: [PATCH 22/60] {common} imath: Add new recipe The imath package is a dependency of openexr. Signed-off-by: Rob Woolley --- .../recipes-support/imath/imath_3.1.9.bb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 meta-ros-common/recipes-support/imath/imath_3.1.9.bb diff --git a/meta-ros-common/recipes-support/imath/imath_3.1.9.bb b/meta-ros-common/recipes-support/imath/imath_3.1.9.bb new file mode 100644 index 00000000000..2d1940de202 --- /dev/null +++ b/meta-ros-common/recipes-support/imath/imath_3.1.9.bb @@ -0,0 +1,18 @@ +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE.md;md5=0f34c2a8b1c102d683feca7a5835e921" + +SRC_URI = "git://github.com/AcademySoftwareFoundation/Imath.git;protocol=https;branch=main" + +PV = "3.1.9" +SRCREV = "642312b48e4c054198a3887b9e4e53da08fb7531" + +S = "${WORKDIR}/git" + +DEPENDS = " \ + boost \ + python3-pybind11 \ +" + +inherit cmake python3native + +BBCLASSEXTEND = "native nativesdk" From c13f5a7ee4f9eccc34588828a0ca167340dd4c73 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 11:10:26 -0700 Subject: [PATCH 23/60] {common} gts: Add missing patches Signed-off-by: Rob Woolley --- .../gts/gts/fix-includes.patch | 37 +++++++++++++++++++ .../gts/gts/fix-predicates_init.patch | 22 +++++++++++ .../gts/gts/ignore-libm-native.patch | 11 ++++++ 3 files changed, 70 insertions(+) create mode 100644 meta-ros-common/recipes-graphics/gts/gts/fix-includes.patch create mode 100644 meta-ros-common/recipes-graphics/gts/gts/fix-predicates_init.patch create mode 100644 meta-ros-common/recipes-graphics/gts/gts/ignore-libm-native.patch diff --git a/meta-ros-common/recipes-graphics/gts/gts/fix-includes.patch b/meta-ros-common/recipes-graphics/gts/gts/fix-includes.patch new file mode 100644 index 00000000000..dd8630cc662 --- /dev/null +++ b/meta-ros-common/recipes-graphics/gts/gts/fix-includes.patch @@ -0,0 +1,37 @@ +# | cc1: warning: include location "/usr/include" is unsafe for cross-compilation [-Wpoison-system-directories] +Index: git/examples/Makefile.am +=================================================================== +--- git.orig/examples/Makefile.am ++++ git/examples/Makefile.am +@@ -1,6 +1,6 @@ + ## Process this file with automake to produce Makefile.in + +-INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src -I$(includedir)\ ++INCLUDES = -I$(top_builddir) -I$(top_srcdir)/src -I$(top_builddir)/src \ + -DG_LOG_DOMAIN=\"Gts-examples\" + LDADD = $(top_builddir)/src/libgts.la -lm + DEPS = $(top_builddir)/src/libgts.la +Index: git/src/Makefile.am +=================================================================== +--- git.orig/src/Makefile.am ++++ git/src/Makefile.am +@@ -1,6 +1,6 @@ + ## Process this file with automake to produce Makefile.in + +-INCLUDES = -I$(top_srcdir) -I$(includedir) -DG_LOG_DOMAIN=\"Gts\" ++INCLUDES = -I$(top_builddir) -DG_LOG_DOMAIN=\"Gts\" + + bin_SCRIPTS=gts-config + +Index: git/tools/Makefile.am +=================================================================== +--- git.orig/tools/Makefile.am ++++ git/tools/Makefile.am +@@ -1,6 +1,6 @@ + ## Process this file with automake to produce Makefile.in + +-INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src -I$(includedir)\ ++INCLUDES = -I$(top_builddir) -I$(top_srcdir)/src -I$(top_builddir)/src \ + -DG_LOG_DOMAIN=\"Gts-tools\" + LDADD = $(top_builddir)/src/libgts.la -lm + DEPS = $(top_builddir)/src/libgts.la diff --git a/meta-ros-common/recipes-graphics/gts/gts/fix-predicates_init.patch b/meta-ros-common/recipes-graphics/gts/gts/fix-predicates_init.patch new file mode 100644 index 00000000000..8763b770d55 --- /dev/null +++ b/meta-ros-common/recipes-graphics/gts/gts/fix-predicates_init.patch @@ -0,0 +1,22 @@ +# /bin/bash: line 1: ./predicates_init: No such file or directory +Index: git/src/Makefile.am +=================================================================== +--- git.orig/src/Makefile.am ++++ git/src/Makefile.am +@@ -63,13 +63,13 @@ include_HEADERS = \ + gts.h gtsconfig.h + + predicates.o: predicates.c predicates_init.h predicates.h +- $(COMPILE) -c $(srcdir)/predicates.c ++ $(BUILD_CC) $(INCLUDES) $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) -c $(srcdir)/predicates.c + + predicates_init: predicates_init.c rounding.h +- $(COMPILE) $(srcdir)/predicates_init.c -o $(srcdir)/predicates_init ++ $(BUILD_CC) $(INCLUDES) $(BUILD_CPPFLAGS) $(BUILD_CFLAGS) $(srcdir)/predicates_init.c -o $(builddir)/predicates_init + + predicates_init.h: predicates_init +- ./predicates_init > $(srcdir)/predicates_init.h ++ $(builddir)/predicates_init > $(srcdir)/predicates_init.h + + CLEANFILES = $(BUILT_SOURCES) + diff --git a/meta-ros-common/recipes-graphics/gts/gts/ignore-libm-native.patch b/meta-ros-common/recipes-graphics/gts/gts/ignore-libm-native.patch new file mode 100644 index 00000000000..4a6bddab8a7 --- /dev/null +++ b/meta-ros-common/recipes-graphics/gts/gts/ignore-libm-native.patch @@ -0,0 +1,11 @@ +diff --git a/gts.pc.in b/gts.pc.in +index 39626d7..bcd4014 100644 +--- a/gts.pc.in ++++ b/gts.pc.in +@@ -7,5 +7,5 @@ Name: GTS + Description: GNU Triangulated Surface Library + Version: @VERSION@ + Requires: glib-2.0,gthread-2.0,gmodule-2.0 +-Libs: -L${libdir} @LIBS@ -lgts -lm ++Libs: -L${libdir} @LIBS@ -lgts + Cflags: -I${includedir} From da7a79ba97cd7770faedf7616414698ca94b6a60 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 11:11:19 -0700 Subject: [PATCH 24/60] {humble} spinnaker-camera-driver: Add build tool dependencies Signed-off-by: Rob Woolley --- .../spinnaker-camera-driver_2.1.15-1.bbappend | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 meta-ros2-humble/recipes-bbappends/flir-camera-driver/spinnaker-camera-driver_2.1.15-1.bbappend diff --git a/meta-ros2-humble/recipes-bbappends/flir-camera-driver/spinnaker-camera-driver_2.1.15-1.bbappend b/meta-ros2-humble/recipes-bbappends/flir-camera-driver/spinnaker-camera-driver_2.1.15-1.bbappend new file mode 100644 index 00000000000..b4af7f30b45 --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/flir-camera-driver/spinnaker-camera-driver_2.1.15-1.bbappend @@ -0,0 +1,9 @@ +# Copyright (c) 2023 Wind River Systems, Inc. + +ROS_BUILDTOOL_DEPENDS += " \ + ament-cmake-ros \ + ament-cmake-gmock \ + ament-cmake-gtest \ + ament-cmake-pytest \ + rosidl-default-generators-native \ +" From 369aeada9f21293a2be3653d0e8ea254516b89c6 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 11:11:48 -0700 Subject: [PATCH 25/60] {humble} pangolin: Add missing zstd dependency Signed-off-by: Rob Woolley --- .../recipes-bbappends/pangolin/pangolin_0.9.1-1.bbappend | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 meta-ros2-humble/recipes-bbappends/pangolin/pangolin_0.9.1-1.bbappend diff --git a/meta-ros2-humble/recipes-bbappends/pangolin/pangolin_0.9.1-1.bbappend b/meta-ros2-humble/recipes-bbappends/pangolin/pangolin_0.9.1-1.bbappend new file mode 100644 index 00000000000..9d0f9bc9d5e --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/pangolin/pangolin_0.9.1-1.bbappend @@ -0,0 +1,3 @@ +# Copyright (c) 2024 Wind River Systems, Inc. + +DEPENDS += "zstd" From 1bc961340838f9647743ea996a6ba3734c188c8e Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 11:12:17 -0700 Subject: [PATCH 26/60] {humble} ros-gz-bridge: Add build tool dependency Signed-off-by: Rob Woolley --- .../ros-gz/ros-gz-bridge_0.244.14-1.bbappend | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 meta-ros2-humble/recipes-bbappends/ros-gz/ros-gz-bridge_0.244.14-1.bbappend diff --git a/meta-ros2-humble/recipes-bbappends/ros-gz/ros-gz-bridge_0.244.14-1.bbappend b/meta-ros2-humble/recipes-bbappends/ros-gz/ros-gz-bridge_0.244.14-1.bbappend new file mode 100644 index 00000000000..b51de7f85e0 --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/ros-gz/ros-gz-bridge_0.244.14-1.bbappend @@ -0,0 +1,5 @@ +# Copyright (c) 2023 Wind River Systems, Inc. + +ROS_BUILDTOOL_DEPENDS += " \ + rosidl-cmake-native \ +" From 4f90d5772b7e89a9c3082974dc8785c51d914637 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 11:12:41 -0700 Subject: [PATCH 27/60] {humble} turtlebot4-ignition-gui-plugins: Resolve dependencies Add CMake support for Qt5 and limit ignition-gui6 as a build dependency that doesn't require building natively. Signed-off-by: Rob Woolley --- .../turtlebot4-ignition-gui-plugins_1.0.2-1.bbappend | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 meta-ros2-humble/recipes-bbappends/turtlebot4-simulator/turtlebot4-ignition-gui-plugins_1.0.2-1.bbappend diff --git a/meta-ros2-humble/recipes-bbappends/turtlebot4-simulator/turtlebot4-ignition-gui-plugins_1.0.2-1.bbappend b/meta-ros2-humble/recipes-bbappends/turtlebot4-simulator/turtlebot4-ignition-gui-plugins_1.0.2-1.bbappend new file mode 100644 index 00000000000..6eb02fa148b --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/turtlebot4-simulator/turtlebot4-ignition-gui-plugins_1.0.2-1.bbappend @@ -0,0 +1,8 @@ +# Copyright (c) 2023-2024 Wind River Systems, Inc. + +# CMake Warning at turtlebot4-ignition-gui-plugins/1.0.2-1-r0/recipe-sysroot/usr/lib/cmake/Qt5/Qt5Config.cmake:7 (message): +# SkippingbecauseOE_QMAKE_PATH_EXTERNAL_HOST_BINSisnotdefined +inherit ${@bb.utils.contains('BBFILE_COLLECTIONS', 'qt5-layer', 'cmake_qt5', '', d)} + +ROS_BUILDTOOL_DEPENDS:remove = "ignition-gui6-native" +ROS_BUILD_DEPENDS:append = "ignition-gui6" From d139cb3283a07d886654a9a39d3520588e38aa11 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 11:14:21 -0700 Subject: [PATCH 28/60] {humble} mrt-cmake-modules: Add missing patch Signed-off-by: Rob Woolley --- .../mrt-cmake-modules/add-lanelet2-core.patch | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 meta-ros2-humble/recipes-bbappends/mrt-cmake-modules/mrt-cmake-modules/add-lanelet2-core.patch diff --git a/meta-ros2-humble/recipes-bbappends/mrt-cmake-modules/mrt-cmake-modules/add-lanelet2-core.patch b/meta-ros2-humble/recipes-bbappends/mrt-cmake-modules/mrt-cmake-modules/add-lanelet2-core.patch new file mode 100644 index 00000000000..fb394e1ed1d --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/mrt-cmake-modules/mrt-cmake-modules/add-lanelet2-core.patch @@ -0,0 +1,17 @@ +diff --git a/yaml/cmake.yaml b/yaml/cmake.yaml +index 9e3516e..3cac390 100644 +--- a/yaml/cmake.yaml ++++ b/yaml/cmake.yaml +@@ -79,6 +79,12 @@ gtest: + include_dirs: [gtest_INCLUDE_DIRS] + libraries: [gtest_LIBRARIES] + name: gtest ++lanelet2_core: ++ components: [] ++ include_dirs: [lanelet2_core_INCLUDE_DIRS] ++ libraries: [lanelet2_core_LIBRARIES] ++ library_dirs: [] ++ name: lanelet2_core + libann-dev: + components: [] + include_dirs: [ANN_INCLUDE_DIR] From 4be413afbcfed7323c58cd1f979c2c8a8afe017e Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 11:16:19 -0700 Subject: [PATCH 29/60] {humble} ignition-cmake2-vendor: Add missing dependencies Signed-off-by: Rob Woolley --- .../ignition-cmake2-vendor_0.0.2-2.bbappend | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 meta-ros2-humble/recipes-bbappends/ignition-cmake2-vendor/ignition-cmake2-vendor_0.0.2-2.bbappend diff --git a/meta-ros2-humble/recipes-bbappends/ignition-cmake2-vendor/ignition-cmake2-vendor_0.0.2-2.bbappend b/meta-ros2-humble/recipes-bbappends/ignition-cmake2-vendor/ignition-cmake2-vendor_0.0.2-2.bbappend new file mode 100644 index 00000000000..1666f7c6725 --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/ignition-cmake2-vendor/ignition-cmake2-vendor_0.0.2-2.bbappend @@ -0,0 +1,18 @@ +# Copyright (c) 2023 Wind River Systems, Inc. + +inherit python3native + +ROS_BUILDTOOL_DEPENDS = " \ + ament-copyright-native \ + ament-lint-cmake-native \ + ament-package-native \ + ament-xmllint-native \ +" + +ROS_BUILD_DEPENDS = " \ + ament-cmake-lint-cmake \ + ament-cmake-copyright \ + ament-cmake-core \ + ament-cmake-test \ + ament-cmake-xmllint \ +" From 59f343a80cb93d2ca257cc678cb159400d97afb6 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 11:16:44 -0700 Subject: [PATCH 30/60] {humble} ignition-math6-vendor: Add missing dependencies Signed-off-by: Rob Woolley --- .../ignition-math6-vendor_0.0.2-2.bbappend | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 meta-ros2-humble/recipes-bbappends/ignition-math6-vendor/ignition-math6-vendor_0.0.2-2.bbappend diff --git a/meta-ros2-humble/recipes-bbappends/ignition-math6-vendor/ignition-math6-vendor_0.0.2-2.bbappend b/meta-ros2-humble/recipes-bbappends/ignition-math6-vendor/ignition-math6-vendor_0.0.2-2.bbappend new file mode 100644 index 00000000000..4e75d2679bb --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/ignition-math6-vendor/ignition-math6-vendor_0.0.2-2.bbappend @@ -0,0 +1,10 @@ +# Copyright (c) 2023 Wind River Systems, Inc. + +inherit python3native + +ROS_BUILDTOOL_DEPENDS += " \ + ament-copyright-native \ + ament-lint-cmake-native \ + ament-package-native \ + ament-xmllint-native \ +" From 993856c0199ba5575e05fbae7e332b60e36b67bf Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 11:17:14 -0700 Subject: [PATCH 31/60] {humble} rviz-rendering: Add CMake Qt5 configuration Signed-off-by: Rob Woolley --- .../recipes-bbappends/rviz/rviz-rendering_%.bbappend | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 meta-ros2-humble/recipes-bbappends/rviz/rviz-rendering_%.bbappend diff --git a/meta-ros2-humble/recipes-bbappends/rviz/rviz-rendering_%.bbappend b/meta-ros2-humble/recipes-bbappends/rviz/rviz-rendering_%.bbappend new file mode 100644 index 00000000000..9f7468bc212 --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/rviz/rviz-rendering_%.bbappend @@ -0,0 +1,8 @@ +# Copyright (c) 2021 LG Electronics, Inc. + +# CMake Warning at /jenkins/mjansa/build/ros/ros2-foxy-dunfell/tmp-glibc/work/core2-64-oe-linux/rviz-rendering/8.2.0-1-r0/recipe-sysroot/usr/lib/cmake/Qt5/Qt5Config.cmake:7 (message): +# SkippingbecauseOE_QMAKE_PATH_EXTERNAL_HOST_BINSisnotdefined +# ... +# CMake Error at CMakeLists.txt:65 (qt5_wrap_cpp): +# Unknown CMake command "qt5_wrap_cpp". +inherit ${@bb.utils.contains_any('ROS_WORLD_SKIP_GROUPS', ['qt5', 'pyqt5'], '', 'cmake_qt5', d)} From fccda1e68c193d3a2b5284b76bbbc96b249c427a Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 11:17:47 -0700 Subject: [PATCH 32/60] {humble} warsehouse-ros-mongo: Add new recipe Signed-off-by: Rob Woolley --- .../warehouse-ros-mongo_2.0.3.bb | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 meta-ros2-humble/recipes-support/warehouse-ros-mongo/warehouse-ros-mongo_2.0.3.bb diff --git a/meta-ros2-humble/recipes-support/warehouse-ros-mongo/warehouse-ros-mongo_2.0.3.bb b/meta-ros2-humble/recipes-support/warehouse-ros-mongo/warehouse-ros-mongo_2.0.3.bb new file mode 100644 index 00000000000..396dce3490f --- /dev/null +++ b/meta-ros2-humble/recipes-support/warehouse-ros-mongo/warehouse-ros-mongo_2.0.3.bb @@ -0,0 +1,78 @@ +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=2711a5d3f3f7dac3923e893f23bf6df3" + +ROS_CN = "warehouse-ros-mongo" +ROS_BPN = "warehouse-ros-mongo" + +ROS_BUILD_DEPENDS = " \ + class-loader \ + mongodb \ + mongo-cxx-driver-legacy \ + rclcpp \ + rclpy \ + rosidl-adapter \ + rosidl-typesupport-c \ + std-msgs \ + warehouse-ros \ +" +# rosidl-typesupport-cpp +# rosidl-typesupport-c +# rosidl-typesupport-fastrtps-c +# rosidl-typesupport-fastrtps-cpp +# rosidl-typesupport-interface +# rosidl-typesupport-introspection-c +# rosidl-typesupport-introspection-cpp +# ament-index-cpp +# ament-index-python +# ament-cmake-test +# ament-cmake-python +# boost +# rclpy +# rosidl-typesupport-cpp + +ROS_BUILDTOOL_DEPENDS = " \ + ament-cmake-native \ +" + +ROS_EXPORT_DEPENDS = "" + +ROS_BUILDTOOL_EXPORT_DEPENDS = "" + +ROS_EXEC_DEPENDS = "" + +# Currently informational only -- see http://www.ros.org/reps/rep-0149.html#dependency-tags. +ROS_TEST_DEPENDS = "" + +DEPENDS = "${ROS_BUILD_DEPENDS} ${ROS_BUILDTOOL_DEPENDS}" +# Bitbake doesn't support the "export" concept, so build them as if we needed them to build this package (even though we actually +# don't) so that they're guaranteed to have been staged should this package appear in another's DEPENDS. +DEPENDS += "${ROS_EXPORT_DEPENDS} ${ROS_BUILDTOOL_EXPORT_DEPENDS}" + +RDEPENDS:${PN} += "${ROS_EXEC_DEPENDS}" + +ROS_BRANCH ?= "branch=ros2" +SRC_URI = "git://github.com/ros-planning/warehouse_ros_mongo.git;${ROS_BRANCH};protocol=https" +SRCREV = "55f7e9f8d1893abb566275f8dc609785684407e5" +S = "${WORKDIR}/git" + +ROS_BUILD_TYPE = "ament_cmake" + +inherit ros_${ROS_BUILD_TYPE} + +do_install:append() { + mv ${D}${includedir}/database_connection.h ${D}${includedir}/warehouse_ros_mongo/database_connection.h + mv ${D}${includedir}/metadata.h ${D}${includedir}/warehouse_ros_mongo/metadata.h + mv ${D}${includedir}/message_collection.h ${D}${includedir}/warehouse_ros_mongo/message_collection.h + mv ${D}${includedir}/query_results.h ${D}${includedir}/warehouse_ros_mongo/query_results.h +} + +FILES:${PN} = " \ + ${datadir}/warehouse_ros_mongo \ + ${libdir}/warehouse_ros_mongo \ + ${libdir}/libwarehouse_ros_mongo.so \ + ${includedir}/warehouse_ros_mongo \ + ${PYTHON_SITEPACKAGES_DIR}/warehouse_ros_mongo \ + ${PYTHON_SITEPACKAGES_DIR}/warehouse_ros_mongo-2.0.3-py3.10.egg-info \ +" + +FILES:${PN}-dev = "${includedir}/warehouse_ros_mongo" From 6cc2a6dba1655d34bf3fc9d3b967bb5a605767c0 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 11:19:06 -0700 Subject: [PATCH 33/60] {common} ogre: Add new recipe This is the older version of the Ogre 3d engine that is needed by Gazebo Classic. Signed-off-by: Rob Woolley --- .../recipes-devtools/ogre/ogre_14.2.5.bb | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 meta-ros-common/recipes-devtools/ogre/ogre_14.2.5.bb diff --git a/meta-ros-common/recipes-devtools/ogre/ogre_14.2.5.bb b/meta-ros-common/recipes-devtools/ogre/ogre_14.2.5.bb new file mode 100644 index 00000000000..93046fa2462 --- /dev/null +++ b/meta-ros-common/recipes-devtools/ogre/ogre_14.2.5.bb @@ -0,0 +1,77 @@ +# Copyright (c) 2020 LG Electronics, Inc. +# Copyright (c) 2024 Wind River Systems, Inc. + +DESCRIPTION = "Extensible Modelica-based platform for optimization, simulation and analysis of complex dynamic systems." +HOMEPAGE = "https://ogrecave.github.io/" +SECTION = "devel" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=41bb7e40692720ea7d7b034dc4afd191" + +# matches with tag v14.2.5 +SRCREV_ogre = "0d90297a387f5eb0d6cfa9e5ab17879bb0123316" +# matches with tag v1.90.4 +SRCREV_imgui = "277ae93c41314ba5f4c7444f37c4319cdf07e8cf" +SRCREV_FORMAT = "ogre_imgui" + +SRC_URI = "git://github.com/OGRECave/ogre;protocol=https;name=ogre;branch=master \ + git://github.com/ocornut/imgui.git;protocol=https;name=imgui;subdir=imgui;branch=master \ + file://0001-CMakeLists.txt-don-t-set-RPATH.patch \ +" + +S = "${WORKDIR}/git" + +inherit cmake features_check pkgconfig python3native + +REQUIRED_DISTRO_FEATURES = "x11" + +DEPENDS = " \ + assimp \ + doxygen \ + freetype \ + freeimage \ + glslang \ + libsdl2 \ + libx11 \ + openexr \ + pugixml \ + spirv-tools \ + swig-native \ + vulkan-headers \ + zlib \ + ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'virtual/libgl libglu', '', d)} \ +" + +# extra flags from rviz-ogre-vendor ExternalProject_Add in: +# https://github.com/ros2/rviz/blob/16ad728224246ac8361e7073e1c89baec5a0eaf1/rviz_ogre_vendor/CMakeLists.txt#L162 +EXTRA_OECMAKE_RVIZ_OGRE_VENDOR = " \ + -DOGRE_STATIC:BOOL=OFF \ + -DOGRE_INSTALL_PDB:BOOL=OFF \ + -DOGRE_BUILD_DEPENDENCIES:BOOL=OFF \ + -DOGRE_BUILD_TESTS:BOOL=OFF \ + -DOGRE_BUILD_SAMPLES:BOOL=FALSE \ + -DOGRE_INSTALL_SAMPLES:BOOL=FALSE \ + -DOGRE_INSTALL_SAMPLES_SOURCE:BOOL=FALSE \ + -DOGRE_CONFIG_THREADS:STRING=0 \ + -DOGRE_RESOURCEMANAGER_STRICT:STRING=2 \ + -DOGRE_BUILD_LIBS_AS_FRAMEWORKS:BOOL=OFF \ + -DOGRE_BUILD_COMPONENT_PYTHON:BOOL=FALSE \ + -DOGRE_BUILD_COMPONENT_JAVA:BOOL=FALSE \ + -DOGRE_BUILD_COMPONENT_CSHARP:BOOL=FALSE \ + -DOGRE_BUILD_COMPONENT_BITES:BOOL=FALSE \ + -DDOGRE_BUILD_PLUGIN_GLSLANG:BOOL=ON \ + -DOGRE_BUILD_RENDERSYSTEM_GLES2:BOOL=TRUE \ + -DOGRE_GLSUPPORT_USE_EGL=ON \ + -DOGRE_BUILD_RENDERSYSTEM_VULKAN=ON \ + -DOGRE_BUILD_PLUGIN_GLSLANG=ON \ + -DIMGUI_DIR=${WORKDIR}/imgui \ +" + +EXTRA_OECMAKE += "${EXTRA_OECMAKE_RVIZ_OGRE_VENDOR}" + +# Make the OGRE private headers public for Gazebo Classic +do_install:append() { + install -m 644 ${S}/Components/RTShaderSystem/src/OgreShaderGLSLProgramWriter.h ${D}${includedir}/OGRE/RTShaderSystem/ +} + +FILES:${PN}-dev += "${libdir}/OGRE/cmake ${libdir}/OGRE/*${SOLIBSDEV}" +FILES:${PN} += "${datadir}/OGRE* ${libdir}/OGRE" From 4c942b254978f0cb69a984f0d48539892ac5d6cb Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 11:20:03 -0700 Subject: [PATCH 34/60] {common} ogre-next: Add new recipe This is the newer version of the Ogre 3D engine which is used by newer versions of Gazebo. Signed-off-by: Rob Woolley --- .../0001-Fixed-compile-error-2.2.0.patch | 75 +++++++++++ .../0001-Fixed-compile-error-2.3.3.patch | 118 ++++++++++++++++++ .../ogre-next/0001-Fixed-macOS-build.patch | 53 ++++++++ ...01-Neon-is-architectural-for-AArch64.patch | 25 ++++ ...2-Use_OGRE_NEXT_prefix_for_libraries.patch | 75 +++++++++++ .../ogre-next/ogre-next_2.2.0.bb | 68 ++++++++++ .../ogre-next/ogre-next_2.3.3.bb | 47 +++++++ 7 files changed, 461 insertions(+) create mode 100644 meta-ros-common/recipes-devtools/ogre-next/ogre-next/0001-Fixed-compile-error-2.2.0.patch create mode 100644 meta-ros-common/recipes-devtools/ogre-next/ogre-next/0001-Fixed-compile-error-2.3.3.patch create mode 100644 meta-ros-common/recipes-devtools/ogre-next/ogre-next/0001-Fixed-macOS-build.patch create mode 100644 meta-ros-common/recipes-devtools/ogre-next/ogre-next/0001-Neon-is-architectural-for-AArch64.patch create mode 100644 meta-ros-common/recipes-devtools/ogre-next/ogre-next/0002-Use_OGRE_NEXT_prefix_for_libraries.patch create mode 100644 meta-ros-common/recipes-devtools/ogre-next/ogre-next_2.2.0.bb create mode 100644 meta-ros-common/recipes-devtools/ogre-next/ogre-next_2.3.3.bb diff --git a/meta-ros-common/recipes-devtools/ogre-next/ogre-next/0001-Fixed-compile-error-2.2.0.patch b/meta-ros-common/recipes-devtools/ogre-next/ogre-next/0001-Fixed-compile-error-2.2.0.patch new file mode 100644 index 00000000000..9aae8066b48 --- /dev/null +++ b/meta-ros-common/recipes-devtools/ogre-next/ogre-next/0001-Fixed-compile-error-2.2.0.patch @@ -0,0 +1,75 @@ +Upstream-Status: Submitted [https://github.com/OGRECave/ogre-next/issues/430] + +From 480fb368e288f0a4e1c73f6b0a60f27743d5cb63 Mon Sep 17 00:00:00 2001 +From: bchoi +Date: Mon, 22 Jan 2024 16:22:31 +0900 +Subject: [PATCH] Fixed compile error + +--- + .../Hlms/Pbs/src/Vct/OgreVctCascadedVoxelizer.cpp | 2 +- + .../include/Math/Array/NEON/Single/OgreMathlibNEON.h | 2 +- + OgreMain/src/OgreDefaultSceneQueries.cpp | 2 +- + OgreMain/src/OgreMovableObject.cpp | 2 +- + Samples/2.0/ApiUsage/AnimationTagPoint/CMakeLists.txt | 6 ++++-- + 4 files changed, 17 insertions(+), 7 deletions(-) + +Index: git/OgreMain/include/Math/Array/NEON/Single/OgreMathlibNEON.h +=================================================================== +--- git.orig/OgreMain/include/Math/Array/NEON/Single/OgreMathlibNEON.h ++++ git/OgreMain/include/Math/Array/NEON/Single/OgreMathlibNEON.h +@@ -645,7 +645,7 @@ namespace Ogre + //Netwon-Raphson, 2 iterations. + ArrayReal fStep0 = vrsqrteq_f32( f ); + //Nuke NaN when f == 0 +- fStep0 = vreinterpretq_f32_u32( vandq_u32( vtstq_u32( f, f ), ++ fStep0 = vreinterpretq_f32_u32( vandq_u32( vtstq_u32((uint32x4_t)f, (uint32x4_t)f ), + vreinterpretq_u32_f32( fStep0 ) ) ); + // step fStep0 = 1 / sqrt(x) + const ArrayReal fStepParm0 = vmulq_f32( f, fStep0 ); +Index: git/OgreMain/src/OgreDefaultSceneQueries.cpp +=================================================================== +--- git.orig/OgreMain/src/OgreDefaultSceneQueries.cpp ++++ git/OgreMain/src/OgreDefaultSceneQueries.cpp +@@ -535,7 +535,7 @@ namespace Ogre { + { + //For each volume test all planes and AND the dot product. + //If one is false, then we dont intersect with this volume +- ArrayMaskR singleVolumeMask = CastIntToReal( Mathlib::SetAll( 0xffffffff ) ); ++ ArrayMaskR singleVolumeMask = (ArrayMaskR) CastIntToReal( Mathlib::SetAll( 0xffffffff ) ); + ArrayReal dotResult; + ArrayVector3 centerPlusFlippedHS; + +Index: git/OgreMain/src/OgreMovableObject.cpp +=================================================================== +--- git.orig/OgreMain/src/OgreMovableObject.cpp ++++ git/OgreMain/src/OgreMovableObject.cpp +@@ -472,7 +472,7 @@ namespace Ogre { + planes[i].planeNegD = Mathlib::SetAll( -frustumPlanes[i].d ); + } + +- const ArrayMaskR ignoreRenderingDistance = CastIntToReal( ++ const ArrayMaskR ignoreRenderingDistance = (ArrayMaskR) CastIntToReal( + Mathlib::SetAll( lodCamera->getUseRenderingDistance() ? 0 : 0xffffffff ) ); + + //TODO: Profile whether we should use XOR to flip the sign or simple multiplication. +Index: git/Samples/2.0/ApiUsage/AnimationTagPoint/CMakeLists.txt +=================================================================== +--- git.orig/Samples/2.0/ApiUsage/AnimationTagPoint/CMakeLists.txt ++++ git/Samples/2.0/ApiUsage/AnimationTagPoint/CMakeLists.txt +@@ -11,12 +11,14 @@ macro( add_recursive dir retVal ) + file( GLOB_RECURSE ${retVal} ${dir}/*.h ${dir}/*.cpp ${dir}/*.c ) + endmacro() + ++set(OGRE_LIBRARIES ${OGRE_LIBRARIES} OgreMain) ++ + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) + + add_recursive( ./ SOURCE_FILES ) + +-ogre_add_executable(Sample_AnimationTagPoint WIN32 MACOSX_BUNDLE ${SOURCE_FILES} ${SAMPLE_COMMON_RESOURCES}) ++ogre_add_executable(Sample_AnimationTagPoint ${SOURCE_FILES} ${SAMPLE_COMMON_RESOURCES}) + +-target_link_libraries(Sample_AnimationTagPoint ${OGRE_LIBRARIES} ${OGRE_SAMPLES_LIBRARIES}) ++target_link_libraries(Sample_AnimationTagPoint ${OGRE_SAMPLES_LIBRARIES} ${OGRE_LIBRARIES}) + ogre_config_sample_lib(Sample_AnimationTagPoint) + ogre_config_sample_pkg(Sample_AnimationTagPoint) diff --git a/meta-ros-common/recipes-devtools/ogre-next/ogre-next/0001-Fixed-compile-error-2.3.3.patch b/meta-ros-common/recipes-devtools/ogre-next/ogre-next/0001-Fixed-compile-error-2.3.3.patch new file mode 100644 index 00000000000..fc6593d67d2 --- /dev/null +++ b/meta-ros-common/recipes-devtools/ogre-next/ogre-next/0001-Fixed-compile-error-2.3.3.patch @@ -0,0 +1,118 @@ +Upstream-Status: Submitted [https://github.com/OGRECave/ogre-next/issues/430] + +From 480fb368e288f0a4e1c73f6b0a60f27743d5cb63 Mon Sep 17 00:00:00 2001 +From: bchoi +Date: Mon, 22 Jan 2024 16:22:31 +0900 +Subject: [PATCH] Fixed compile error + +--- + .../Hlms/Pbs/src/Vct/OgreVctCascadedVoxelizer.cpp | 2 +- + .../include/Math/Array/NEON/Single/OgreMathlibNEON.h | 2 +- + OgreMain/src/OgreDefaultSceneQueries.cpp | 2 +- + OgreMain/src/OgreMovableObject.cpp | 2 +- + Samples/2.0/ApiUsage/AnimationTagPoint/CMakeLists.txt | 6 ++++-- + Tools/CmgenToCubemap/CMakeLists.txt | 10 +++++++++- + 6 files changed, 17 insertions(+), 7 deletions(-) + +diff --git a/Components/Hlms/Pbs/src/Vct/OgreVctCascadedVoxelizer.cpp b/Components/Hlms/Pbs/src/Vct/OgreVctCascadedVoxelizer.cpp +index 797f3d68a8..852dab96ec 100644 +--- a/Components/Hlms/Pbs/src/Vct/OgreVctCascadedVoxelizer.cpp ++++ b/Components/Hlms/Pbs/src/Vct/OgreVctCascadedVoxelizer.cpp +@@ -29,8 +29,8 @@ THE SOFTWARE. + #include "OgreStableHeaders.h" + + #include "Vct/OgreVctCascadedVoxelizer.h" +- + #include "Compositor/OgreCompositorManager2.h" ++#include "Math/Array/OgreMathlib.h" + #include "Math/Array/OgreBooleanMask.h" + #include "OgreItem.h" + #include "OgreSceneManager.h" +diff --git a/OgreMain/include/Math/Array/NEON/Single/OgreMathlibNEON.h b/OgreMain/include/Math/Array/NEON/Single/OgreMathlibNEON.h +index 94f7bdfd1d..6cfea95135 100644 +--- a/OgreMain/include/Math/Array/NEON/Single/OgreMathlibNEON.h ++++ b/OgreMain/include/Math/Array/NEON/Single/OgreMathlibNEON.h +@@ -601,7 +601,7 @@ namespace Ogre + //Netwon-Raphson, 2 iterations. + ArrayReal fStep0 = vrsqrteq_f32( f ); + //Nuke NaN when f == 0 +- fStep0 = vreinterpretq_f32_u32( vandq_u32( vtstq_u32( f, f ), ++ fStep0 = vreinterpretq_f32_u32( vandq_u32( vtstq_u32((uint32x4_t)f, (uint32x4_t)f ), + vreinterpretq_u32_f32( fStep0 ) ) ); + // step fStep0 = 1 / sqrt(x) + const ArrayReal fStepParm0 = vmulq_f32( f, fStep0 ); +diff --git a/OgreMain/src/OgreDefaultSceneQueries.cpp b/OgreMain/src/OgreDefaultSceneQueries.cpp +index b275a7df66..3dee473700 100644 +--- a/OgreMain/src/OgreDefaultSceneQueries.cpp ++++ b/OgreMain/src/OgreDefaultSceneQueries.cpp +@@ -537,7 +537,7 @@ namespace Ogre { + { + //For each volume test all planes and AND the dot product. + //If one is false, then we dont intersect with this volume +- ArrayMaskR singleVolumeMask = CastIntToReal( Mathlib::SetAll( 0xffffffff ) ); ++ ArrayMaskR singleVolumeMask = (ArrayMaskR) CastIntToReal( Mathlib::SetAll( 0xffffffff ) ); + ArrayReal dotResult; + ArrayVector3 centerPlusFlippedHS; + +diff --git a/OgreMain/src/OgreMovableObject.cpp b/OgreMain/src/OgreMovableObject.cpp +index 860e405c9a..16fcd67f1c 100644 +--- a/OgreMain/src/OgreMovableObject.cpp ++++ b/OgreMain/src/OgreMovableObject.cpp +@@ -500,7 +500,7 @@ namespace Ogre { + planes[i].planeNegD = Mathlib::SetAll( -frustumPlanes[i].d ); + } + +- const ArrayMaskR ignoreRenderingDistance = CastIntToReal( ++ const ArrayMaskR ignoreRenderingDistance = (ArrayMaskR) CastIntToReal( + Mathlib::SetAll( lodCamera->getUseRenderingDistance() ? 0 : 0xffffffff ) ); + + //TODO: Profile whether we should use XOR to flip the sign or simple multiplication. +diff --git a/Samples/2.0/ApiUsage/AnimationTagPoint/CMakeLists.txt b/Samples/2.0/ApiUsage/AnimationTagPoint/CMakeLists.txt +index c19bdd5cce..8b9a115aab 100644 +--- a/Samples/2.0/ApiUsage/AnimationTagPoint/CMakeLists.txt ++++ b/Samples/2.0/ApiUsage/AnimationTagPoint/CMakeLists.txt +@@ -11,12 +11,14 @@ macro( add_recursive dir retVal ) + file( GLOB_RECURSE ${retVal} ${dir}/*.h ${dir}/*.cpp ${dir}/*.c ) + endmacro() + ++set(OGRE_LIBRARIES ${OGRE_LIBRARIES} OgreMain) ++ + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) + + add_recursive( ./ SOURCE_FILES ) + +-ogre_add_executable(Sample_AnimationTagPoint WIN32 MACOSX_BUNDLE ${SOURCE_FILES} ${SAMPLE_COMMON_RESOURCES}) ++ogre_add_executable(Sample_AnimationTagPoint ${SOURCE_FILES} ${SAMPLE_COMMON_RESOURCES}) + +-target_link_libraries(Sample_AnimationTagPoint ${OGRE_LIBRARIES} ${OGRE_SAMPLES_LIBRARIES}) ++target_link_libraries(Sample_AnimationTagPoint ${OGRE_SAMPLES_LIBRARIES} ${OGRE_LIBRARIES}) + ogre_config_sample_lib(Sample_AnimationTagPoint) + ogre_config_sample_pkg(Sample_AnimationTagPoint) +diff --git a/Tools/CmgenToCubemap/CMakeLists.txt b/Tools/CmgenToCubemap/CMakeLists.txt +index c3d67a6c0c..c55fa27bf4 100644 +--- a/Tools/CmgenToCubemap/CMakeLists.txt ++++ b/Tools/CmgenToCubemap/CMakeLists.txt +@@ -13,11 +13,19 @@ macro( add_recursive dir retVal ) + file( GLOB_RECURSE ${retVal} ${dir}/*.h ${dir}/*.cpp ${dir}/*.c ) + endmacro() + ++find_package(JPEG REQUIRED) ++find_package(PNG REQUIRED) ++find_package(TIFF REQUIRED) ++find_package(ZLIB REQUIRED) ++ ++set(PICTURE_LIBS ${JPEG} ${PNG} ${TIFF} ${ZLIB}) ++set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${OGRE_NEXT}Main) ++ + add_recursive( ./ SOURCE_FILES ) + + ogre_add_executable(OgreCmgenToCubemap ${SOURCE_FILES}) + +-target_link_libraries(OgreCmgenToCubemap ${OGRE_LIBRARIES}) ++target_link_libraries(OgreCmgenToCubemap ${OGRE_LIBRARIES} ${PICTURE_LIBS}) + + if (APPLE) + set_target_properties(OgreCmgenToCubemap PROPERTIES +-- +2.25.1 + diff --git a/meta-ros-common/recipes-devtools/ogre-next/ogre-next/0001-Fixed-macOS-build.patch b/meta-ros-common/recipes-devtools/ogre-next/ogre-next/0001-Fixed-macOS-build.patch new file mode 100644 index 00000000000..08855c450a7 --- /dev/null +++ b/meta-ros-common/recipes-devtools/ogre-next/ogre-next/0001-Fixed-macOS-build.patch @@ -0,0 +1,53 @@ +From 16e2bd3c06fee6039d411c9f2867985fd931e492 Mon Sep 17 00:00:00 2001 +From: Eugene Golushkov +Date: Thu, 3 Dec 2020 12:35:58 +0200 +Subject: [PATCH] Fixed macOS build + +--- + OgreMain/src/OgrePlatformInformation.cpp | 27 +++++++----------------- + 1 file changed, 8 insertions(+), 19 deletions(-) + +Index: git/OgreMain/src/OgrePlatformInformation.cpp +=================================================================== +--- git.orig/OgreMain/src/OgrePlatformInformation.cpp ++++ git/OgreMain/src/OgrePlatformInformation.cpp +@@ -39,31 +39,19 @@ THE SOFTWARE. + #elif (OGRE_COMPILER == OGRE_COMPILER_GNUC || OGRE_COMPILER == OGRE_COMPILER_CLANG) && OGRE_PLATFORM != OGRE_PLATFORM_NACL + #include + #include +-#if OGRE_PLATFORM != OGRE_PLATFORM_WIN32 +- #if OGRE_PLATFORM == OGRE_PLATFORM_ANDROID +- #include +- #else +- #include +- #endif + #endif + +- #if OGRE_PLATFORM == OGRE_PLATFORM_ANDROID +- #include +- #elif OGRE_CPU == OGRE_CPU_ARM +- #if __MACH__ +- #include +- #ifndef CPU_SUBTYPE_ARM64_V8 +- #define CPU_SUBTYPE_ARM64_V8 ((cpu_subtype_t) 1) +- #endif +- #ifndef CPU_SUBTYPE_ARM_V8 +- #define CPU_SUBTYPE_ARM_V8 ((cpu_subtype_t) 13) +- #endif +- #endif +- #endif ++#if OGRE_PLATFORM == OGRE_PLATFORM_ANDROID ++ #include ++ #include ++#endif ++#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE || OGRE_PLATFORM == OGRE_PLATFORM_APPLE_IOS ++ #include ++ #include + #endif + + #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WINRT +- #include "windows.h" ++ #include + #endif + + // Yes, I know, this file looks very ugly, but there aren't other ways to do it better. diff --git a/meta-ros-common/recipes-devtools/ogre-next/ogre-next/0001-Neon-is-architectural-for-AArch64.patch b/meta-ros-common/recipes-devtools/ogre-next/ogre-next/0001-Neon-is-architectural-for-AArch64.patch new file mode 100644 index 00000000000..d5a160942bc --- /dev/null +++ b/meta-ros-common/recipes-devtools/ogre-next/ogre-next/0001-Neon-is-architectural-for-AArch64.patch @@ -0,0 +1,25 @@ +From f2769df973af39e56538c70ebf2950929135f777 Mon Sep 17 00:00:00 2001 +From: Eugene Golushkov +Date: Mon, 15 Nov 2021 19:41:27 +0200 +Subject: [PATCH] Neon is architectural for AArch64 + +--- + OgreMain/include/OgrePlatform.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/OgreMain/include/OgrePlatform.h b/OgreMain/include/OgrePlatform.h +index 8a9826bd80..c94904aebe 100644 +--- a/OgreMain/include/OgrePlatformInformation.h ++++ b/OgreMain/include/OgrePlatformInformation.h +@@ -101,7 +101,7 @@ + + /* Define whether or not Ogre compiled with NEON support. + */ +- #if OGRE_DOUBLE_PRECISION == 0 && OGRE_CPU == OGRE_CPU_ARM && (OGRE_COMPILER == OGRE_COMPILER_GNUC || OGRE_COMPILER == OGRE_COMPILER_CLANG) && defined(__ARM_NEON__) ++ #if OGRE_DOUBLE_PRECISION == 0 && OGRE_CPU == OGRE_CPU_ARM && ( defined(__aarch64__) || defined(__ARM_NEON__) ) + # define __OGRE_HAVE_NEON 1 + #endif + #endif +-- +2.43.0 + diff --git a/meta-ros-common/recipes-devtools/ogre-next/ogre-next/0002-Use_OGRE_NEXT_prefix_for_libraries.patch b/meta-ros-common/recipes-devtools/ogre-next/ogre-next/0002-Use_OGRE_NEXT_prefix_for_libraries.patch new file mode 100644 index 00000000000..440f07251cc --- /dev/null +++ b/meta-ros-common/recipes-devtools/ogre-next/ogre-next/0002-Use_OGRE_NEXT_prefix_for_libraries.patch @@ -0,0 +1,75 @@ +Index: git/CMake/Templates/OGREConfig.cmake.in +=================================================================== +--- git.orig/CMake/Templates/OGREConfig.cmake.in ++++ git/CMake/Templates/OGREConfig.cmake.in +@@ -21,7 +21,7 @@ include(FindPackageMessage) + set(OGRE_PREFIX_DIR "@CMAKE_INSTALL_PREFIX@") + get_filename_component(OGRE_LIBRARY_DIRS "${OGRE_PREFIX_DIR}/lib" ABSOLUTE) + get_filename_component(OGRE_INCLUDE_DIRS "${OGRE_PREFIX_DIR}/include/OGRE" ABSOLUTE) +-set(OGRE_LIBRARIES "OgreMain") ++set(OGRE_LIBRARIES "@OGRE_NEXT@Main") + + message(STATUS "Found OGRE") + message(STATUS " libraries : '${OGRE_LIBRARIES}' from ${OGRE_LIBRARY_DIRS}") +Index: git/Samples/2.0/ApiUsage/AnimationTagPoint/CMakeLists.txt +=================================================================== +--- git.orig/Samples/2.0/ApiUsage/AnimationTagPoint/CMakeLists.txt ++++ git/Samples/2.0/ApiUsage/AnimationTagPoint/CMakeLists.txt +@@ -11,7 +11,7 @@ macro( add_recursive dir retVal ) + file( GLOB_RECURSE ${retVal} ${dir}/*.h ${dir}/*.cpp ${dir}/*.c ) + endmacro() + +-set(OGRE_LIBRARIES ${OGRE_LIBRARIES} OgreMain) ++set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${OGRE_NEXT}Main) + + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) + +Index: git/Tests/CMakeLists.txt +=================================================================== +--- git.orig/Tests/CMakeLists.txt ++++ git/Tests/CMakeLists.txt +@@ -113,7 +113,7 @@ if (OGRE_BUILD_TESTS) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Components/Paging/include) + ogre_add_component_include_dir(Paging) + +- set(OGRE_LIBRARIES ${OGRE_LIBRARIES} OgrePaging) ++ set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${OGRE_NEXT}Paging) + list(APPEND HEADER_FILES Components/Paging/include/PageCoreTests.h) + list(APPEND SOURCE_FILES Components/Paging/src/PageCoreTests.cpp) + endif () +@@ -121,7 +121,7 @@ if (OGRE_BUILD_TESTS) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Components/MeshLodGenerator/include) + ogre_add_component_include_dir(MeshLodGenerator) + +- set(OGRE_LIBRARIES ${OGRE_LIBRARIES} OgreMeshLodGenerator) ++ set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${OGRE_NEXT}MeshLodGenerator) + list(APPEND HEADER_FILES Components/MeshLodGenerator/include/MeshLodTests.h) + list(APPEND SOURCE_FILES Components/MeshLodGenerator/src/MeshLodTests.cpp) + endif () +@@ -129,7 +129,7 @@ if (OGRE_BUILD_TESTS) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Components/Terrain/include) + ogre_add_component_include_dir(Terrain) + +- set(OGRE_LIBRARIES ${OGRE_LIBRARIES} OgreTerrain) ++ set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${OGRE_NEXT}Terrain) + list(APPEND HEADER_FILES Components/Terrain/include/TerrainTests.h) + list(APPEND SOURCE_FILES Components/Terrain/src/TerrainTests.cpp) + endif () +@@ -137,7 +137,7 @@ if (OGRE_BUILD_TESTS) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Components/Property/include + ${OGRE_SOURCE_DIR}/Components/Property/include) + +- set(OGRE_LIBRARIES ${OGRE_LIBRARIES} OgreProperty) ++ set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${OGRE_NEXT}Property) + list(APPEND HEADER_FILES Components/Property/include/PropertyTests.h) + list(APPEND SOURCE_FILES Components/Property/src/PropertyTests.cpp) + endif () +@@ -265,7 +265,7 @@ if (OGRE_BUILD_TESTS) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Components/MeshLodGenerator/include) + ogre_add_component_include_dir(MeshLodGenerator) + +- set(OGRE_LIBRARIES ${OGRE_LIBRARIES} OgreMeshLodGenerator) ++ set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${OGRE_NEXT}MeshLodGenerator) + list(APPEND HEADER_FILES Components/MeshLodGenerator/include/MeshLodTests.h) + list(APPEND SOURCE_FILES Components/MeshLodGenerator/src/MeshLodTests.cpp) + endif () diff --git a/meta-ros-common/recipes-devtools/ogre-next/ogre-next_2.2.0.bb b/meta-ros-common/recipes-devtools/ogre-next/ogre-next_2.2.0.bb new file mode 100644 index 00000000000..09e5f600b5f --- /dev/null +++ b/meta-ros-common/recipes-devtools/ogre-next/ogre-next_2.2.0.bb @@ -0,0 +1,68 @@ +# Copyright (c) 2023 Wind River Systems, Inc. + +LICENSE = "MIT & Unknown" +LIC_FILES_CHKSUM = "file://CMake/Templates/DemoLicense.rtf;md5=2711c49576d18cf781ec81aad76f40d6 \ + file://COPYING;md5=65d1ee510d57bbd05663424f2ff8d660 \ + file://OgreMain/src/nedmalloc/License.txt;md5=e4224ccaecb14d942c71d31bef20d78c \ + file://Samples/Media/DeferredShadingMedia/COPYING;md5=e3b8d8073136f13f04ebb6f8b84efba6 \ + file://Samples/Media/materials/textures/Cubemaps/License.txt;md5=81b3db517e68c27c535791b2276d5ffd \ + file://Tools/Common/setup/License.rtf;md5=e1311ad52d6fe736b3819ce831a2a595 \ + file://Tools/MaterialEditor/wxscintilla_1.69.2/src/scintilla/License.txt;md5=d680acd8db69807fdfb587a342690eac \ + file://Tools/MilkshapeExport/setup/License.rtf;md5=e1311ad52d6fe736b3819ce831a2a595 \ + file://Tools/XSIExport/setup/License.rtf;md5=e1311ad52d6fe736b3819ce831a2a595" + +SRC_URI = "git://github.com/OGRECave/ogre-next.git;protocol=https;branch=master \ + file://0001-Fixed-compile-error-2.2.0.patch \ + file://0001-Neon-is-architectural-for-AArch64.patch \ + file://0001-Fixed-macOS-build.patch \ +" + +PV = "2.2.0" +SRCREV = "6a814a02e69dfe3c006baf8ec6399aeb611452ca" + +S = "${WORKDIR}/git" + +inherit cmake features_check pkgconfig + +DEPENDS = " \ + cppunit \ + doxygen-native \ + freeimage \ + freetype \ + libsdl2 \ + libx11 \ + libxaw \ + rapidjson \ + renderdoc \ + tbb \ + libtinyxml \ + zlib \ + ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'virtual/libgl libglu', '', d)} \ +" + +FILES:${PN}-dev += "${libdir}/OGRE-Next/cmake ${libdir}/OGRE-Next/*${SOLIBSDEV}" +FILES:${PN} += "${datadir}/OGRE-Next ${libdir}/OGRE-Next" + +REQUIRED_DISTRO_FEATURES = "x11" + +EXTRA_OECMAKE += " \ + -DOGRE_SIMD_NEON:BOOL=FALSE \ + -DOGRE_SIMD_SSE2:BOOL=FALSE \ +" + +do_install:append() { + # pkgconfig + sed -i -e "s|/OGRE|/OGRE-Next|g" ${D}${libdir}/pkgconfig/*.pc + + # CMake + sed -i -e "s|share/OGRE/media|share/OGRE-Next/media|g" ${D}${libdir}/OGRE/cmake/FindOGRE.cmake + mv ${D}${libdir}/OGRE/cmake/FindOGRE.cmake ${D}${libdir}/OGRE/cmake/FindOGRE2.cmake + + # Data files + sed -i -e "s|${datadir}/OGRE|${datadir}/OGRE-Next|g" ${D}${datadir}/OGRE/resources.cfg + sed -i -e "s|share/OGRE/docs|share/OGRE-Next/docs|g" ${D}${datadir}/OGRE/docs/CMakeLists.txt + + mv ${D}${datadir}/OGRE ${D}${datadir}/OGRE-Next + + mv ${D}${libdir}/OGRE ${D}${libdir}/OGRE-Next +} diff --git a/meta-ros-common/recipes-devtools/ogre-next/ogre-next_2.3.3.bb b/meta-ros-common/recipes-devtools/ogre-next/ogre-next_2.3.3.bb new file mode 100644 index 00000000000..bc0fa233b86 --- /dev/null +++ b/meta-ros-common/recipes-devtools/ogre-next/ogre-next_2.3.3.bb @@ -0,0 +1,47 @@ +# Copyright (c) 2023 Wind River Systems, Inc. + +LICENSE = "MIT & Unknown" +LIC_FILES_CHKSUM = "file://CMake/Templates/DemoLicense.rtf;md5=2711c49576d18cf781ec81aad76f40d6 \ + file://COPYING;md5=65d1ee510d57bbd05663424f2ff8d660 \ + file://OgreMain/src/nedmalloc/License.txt;md5=e4224ccaecb14d942c71d31bef20d78c \ + file://Samples/Media/DeferredShadingMedia/COPYING;md5=e3b8d8073136f13f04ebb6f8b84efba6 \ + file://Samples/Media/materials/textures/Cubemaps/License.txt;md5=81b3db517e68c27c535791b2276d5ffd \ + file://Tools/Common/setup/License.rtf;md5=e1311ad52d6fe736b3819ce831a2a595 \ + file://Tools/MaterialEditor/wxscintilla_1.69.2/src/scintilla/License.txt;md5=d680acd8db69807fdfb587a342690eac \ + file://Tools/MilkshapeExport/setup/License.rtf;md5=e1311ad52d6fe736b3819ce831a2a595 \ + file://Tools/XSIExport/setup/License.rtf;md5=e1311ad52d6fe736b3819ce831a2a595" + +SRC_URI = "git://github.com/OGRECave/ogre-next.git;protocol=https;branch=master \ + file://0001-Fixed-compile-error-2.3.3.patch \ + file://0002-Use_OGRE_NEXT_prefix_for_libraries.patch" + +PV = "2.3.3" +SRCREV = "8d4daeaf46d7d8f85f1833f17daedd7dac05daec" + +S = "${WORKDIR}/git" + +inherit cmake features_check pkgconfig + +DEPENDS = " \ + cppunit \ + doxygen-native \ + freeimage \ + freetype \ + libsdl2 \ + libx11 \ + libxaw \ + rapidjson \ + renderdoc \ + tbb \ + libtinyxml \ + zlib \ + ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'virtual/libgl libglu', '', d)} \ +" + +EXTRA_OECMAKE += "-DOGRE_USE_NEW_PROJECT_NAME=ON" + +FILES:${PN}-dev += "${libdir}/OGRE-Next/cmake ${libdir}/OGRE-Next/*${SOLIBSDEV}" +FILES:${PN} += "${datadir}/OGRE-Next ${libdir}/OGRE-Next" + + +REQUIRED_DISTRO_FEATURES = "x11" From becb3a4e1ca106137a3669320c9da380ed64b944 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 11:22:44 -0700 Subject: [PATCH 35/60] {common} ogre: Remove old recipe Signed-off-by: Rob Woolley --- .../recipes-devtools/ogre/ogre_1.12.12.bb | 46 ------------------- 1 file changed, 46 deletions(-) delete mode 100644 meta-ros-common/recipes-devtools/ogre/ogre_1.12.12.bb diff --git a/meta-ros-common/recipes-devtools/ogre/ogre_1.12.12.bb b/meta-ros-common/recipes-devtools/ogre/ogre_1.12.12.bb deleted file mode 100644 index 18a5225ab4d..00000000000 --- a/meta-ros-common/recipes-devtools/ogre/ogre_1.12.12.bb +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) 2020 LG Electronics, Inc. -# Copyright (c) 2024 Wind River Systems, Inc. - -DESCRIPTION = "Extensible Modelica-based platform for optimization, simulation and analysis of complex dynamic systems." -HOMEPAGE = "https://ogrecave.github.io/" -SECTION = "devel" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://LICENSE;md5=41bb7e40692720ea7d7b034dc4afd191" - -# matches with tag v1.12.12 -SRCREV = "be8c2a225ecae636c8e669a12129b603db6b0e3c" -SRC_URI = "git://github.com/OGRECave/ogre;protocol=https;branch=master \ - file://0001-CMakeLists.txt-don-t-set-RPATH.patch \ -" - -S = "${WORKDIR}/git" - -inherit cmake features_check - -REQUIRED_DISTRO_FEATURES = "x11" - -DEPENDS = "zlib libx11 pugixml freetype ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'virtual/libgl libglu', '', d)}" - -# extra flags from rviz-ogre-vendor ExternalProject_Add in: -# https://github.com/ros2/rviz/blob/16ad728224246ac8361e7073e1c89baec5a0eaf1/rviz_ogre_vendor/CMakeLists.txt#L162 -EXTRA_OECMAKE_RVIZ_OGRE_VENDOR = " \ - -DOGRE_STATIC:BOOL=OFF \ - -DOGRE_INSTALL_PDB:BOOL=OFF \ - -DOGRE_BUILD_DEPENDENCIES:BOOL=OFF \ - -DOGRE_BUILD_TESTS:BOOL=OFF \ - -DOGRE_BUILD_SAMPLES:BOOL=FALSE \ - -DOGRE_INSTALL_SAMPLES:BOOL=FALSE \ - -DOGRE_INSTALL_SAMPLES_SOURCE:BOOL=FALSE \ - -DOGRE_CONFIG_THREADS:STRING=0 \ - -DOGRE_RESOURCEMANAGER_STRICT:STRING=2 \ - -DOGRE_BUILD_LIBS_AS_FRAMEWORKS:BOOL=OFF \ - -DOGRE_BUILD_COMPONENT_PYTHON:BOOL=FALSE \ - -DOGRE_BUILD_COMPONENT_JAVA:BOOL=FALSE \ - -DOGRE_BUILD_COMPONENT_CSHARP:BOOL=FALSE \ - -DOGRE_BUILD_COMPONENT_BITES:BOOL=FALSE \ -" - -EXTRA_OECMAKE += "${EXTRA_OECMAKE_RVIZ_OGRE_VENDOR}" - -FILES:${PN}-dev += "${libdir}/OGRE/cmake ${libdir}/OGRE/*${SOLIBSDEV}" -FILES:${PN} += "${datadir}/OGRE ${libdir}/OGRE" From 97ba67587b18497cf055540c5ce67b0ae3a07120 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 11:26:21 -0700 Subject: [PATCH 36/60] {humble} Set preferred versions for ogre and ogre-next Signed-off-by: Rob Woolley --- .../ros-distro/include/humble/ros-distro-preferred-versions.inc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meta-ros2-humble/conf/ros-distro/include/humble/ros-distro-preferred-versions.inc b/meta-ros2-humble/conf/ros-distro/include/humble/ros-distro-preferred-versions.inc index ce2142d4f8a..26b66fe1387 100644 --- a/meta-ros2-humble/conf/ros-distro/include/humble/ros-distro-preferred-versions.inc +++ b/meta-ros2-humble/conf/ros-distro/include/humble/ros-distro-preferred-versions.inc @@ -4,3 +4,5 @@ # Set PREFERRED_VERSION_ here for non-platform packages for which the layers provide multiple versions and to override those # set in ros-distro-platform-preferred-versions.inc . +PREFERRED_VERSION_ogre = "1.12.12" +PREFERRED_VERSION_ogre-next = "2.2.0" From 4f434949843b3fda46655ad8dc0fd3fffe0ee064 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 11:28:07 -0700 Subject: [PATCH 37/60] {humble} Remove skip_recipe entries for mongo-cxx-driver-legacy Signed-off-by: Rob Woolley --- .../ros-distro/include/humble/ros-distro-recipe-blacklist.inc | 2 -- 1 file changed, 2 deletions(-) diff --git a/meta-ros2-humble/conf/ros-distro/include/humble/ros-distro-recipe-blacklist.inc b/meta-ros2-humble/conf/ros-distro/include/humble/ros-distro-recipe-blacklist.inc index b1445077b6e..8b6ee3b33c0 100644 --- a/meta-ros2-humble/conf/ros-distro/include/humble/ros-distro-recipe-blacklist.inc +++ b/meta-ros2-humble/conf/ros-distro/include/humble/ros-distro-recipe-blacklist.inc @@ -154,7 +154,6 @@ SKIP_RECIPE[rtabmap] ?= "${@bb.utils.contains_any('ROS_WORLD_SKIP_GROUPS', ['ope SKIP_RECIPE[rti-connext-dds-cmake-module] ?= "${@bb.utils.contains('ROS_WORLD_SKIP_GROUPS', 'connext', 'connext: depends on rti-connext-dds which is not available', '', d)}" SKIP_RECIPE[run-move-group] ?= "${@bb.utils.contains_any('ROS_WORLD_SKIP_GROUPS', ['qt5', 'pyqt5', 'opengl', 'x11'], 'qt5: rdepends on moveit-resources-panda-moveit-config which rdepends on joint-state-publisher-gui which depends on python-qt-binding which depends on qtbase; pyqt5: rdepends on moveit-resources-panda-moveit-config which rdepends on joint-state-publisher-gui which depends on python-qt-binding which depends on python3-pyqt5 which requires pyqt5; opengl: depends on rviz2 which depends on rviz-ogre-vendor which depends on mesa which is not available because of missing opengl or vulkan in DISTRO_FEATURES; x11: depends on rviz2 which depends on rviz-rendering which depends on rviz-ogre-vendor which depends on libx11,libxrandr,libxaw which require x11 in DISTRO_FEATURES', '', d)}" SKIP_RECIPE[run-moveit-cpp] ?= "${@bb.utils.contains_any('ROS_WORLD_SKIP_GROUPS', ['qt5', 'pyqt5', 'opengl', 'x11'], 'qt5: rdepends on moveit-resources-panda-moveit-config which rdepends on joint-state-publisher-gui which depends on python-qt-binding which depends on qtbase; pyqt5: rdepends on moveit-resources-panda-moveit-config which rdepends on joint-state-publisher-gui which depends on python-qt-binding which depends on python3-pyqt5 which requires pyqt5; opengl: depends on rviz2 which depends on rviz-ogre-vendor which depends on mesa which is not available because of missing opengl or vulkan in DISTRO_FEATURES; x11: depends on rviz2 which depends on rviz-rendering which depends on rviz-ogre-vendor which depends on libx11,libxrandr,libxaw which require x11 in DISTRO_FEATURES', '', d)}" -SKIP_RECIPE[run-ompl-constrained-planning] ?= "${@bb.utils.contains_any('ROS_WORLD_SKIP_GROUPS', ['mongodb', 'mongodb-legacy-cxx-driver'], 'mongodb: rdepends on warehouse-ros-mongo which requires mongodb; mongodb-legacy-cxx-driver: rdepends on warehouse-ros-mongo which requires unavailable mongo-cxx-driver-legacy', '', d)}" SKIP_RECIPE[rviz2] ?= "${@bb.utils.contains_any('ROS_WORLD_SKIP_GROUPS', ['qt5', 'opengl', 'x11', 'ignition'], 'qt5: depends on qtbase; opengl: depends on rviz-ogre-vendor which depends on mesa which is not available because of missing opengl or vulkan in DISTRO_FEATURES; x11: depends on rviz-rendering which depends on rviz-ogre-vendor which depends on libx11,libxrandr,libxaw which require x11 in DISTRO_FEATURES; ignition: depends on rviz-default-plugins which depends on unavailable ROS_UNRESOLVED_DEP-ignition-math6', '', d)}" SKIP_RECIPE[rviz-common] ?= "${@bb.utils.contains_any('ROS_WORLD_SKIP_GROUPS', ['qt5', 'opengl', 'x11'], 'qt5: depends on qtbase; opengl: depends on rviz-ogre-vendor which depends on mesa which is not available because of missing opengl or vulkan in DISTRO_FEATURES; x11: depends on rviz-rendering which depends on rviz-ogre-vendor which depends on libx11,libxrandr,libxaw which require x11 in DISTRO_FEATURES', '', d)}" SKIP_RECIPE[rviz-default-plugins] ?= "${@bb.utils.contains_any('ROS_WORLD_SKIP_GROUPS', ['qt5', 'opengl', 'x11', 'ignition'], 'qt5: depends on qtbase; opengl: depends on rviz-common which depends on mesa which is not available because of missing opengl or vulkan in DISTRO_FEATURES; x11: depends on rviz-rendering which depends on rviz-ogre-vendor which depends on libx11,libxrandr,libxaw which require x11 in DISTRO_FEATURES; ignition: depends on unavailable ROS_UNRESOLVED_DEP-ignition-math6', '', d)}" @@ -178,7 +177,6 @@ SKIP_RECIPE[turtle-tf2-py] ?= "${@bb.utils.contains_any('ROS_WORLD_SKIP_GROUPS', SKIP_RECIPE[ur-description] ?= "${@bb.utils.contains_any('ROS_WORLD_SKIP_GROUPS', ['qt5', 'opengl', 'x11', 'ignition'], 'qt5: depends on qtbase; opengl: depends on rviz-ogre-vendor which depends on mesa which is not available because of missing opengl or vulkan in DISTRO_FEATURES; x11: depends on rviz-rendering which depends on rviz-ogre-vendor which depends on libx11,libxrandr,libxaw which require x11 in DISTRO_FEATURES; ignition: depends on rviz2 which depends on rviz-default-plugins which depends on unavailable ROS_UNRESOLVED_DEP-ignition-math6', '', d)}" SKIP_RECIPE[ur-robot-driver] ?= "${@bb.utils.contains_any('ROS_WORLD_SKIP_GROUPS', ['qt5', 'opengl', 'x11', 'ignition'], 'qt5: depends on qtbase; opengl: depends on rviz-ogre-vendor which depends on mesa which is not available because of missing opengl or vulkan in DISTRO_FEATURES; x11: depends on rviz-rendering which depends on rviz-ogre-vendor which depends on libx11,libxrandr,libxaw which require x11 in DISTRO_FEATURES; ignition: depends on rviz2 which depends on rviz-default-plugins which depends on unavailable ROS_UNRESOLVED_DEP-ignition-math6', '', d)}" SKIP_RECIPE[usb-cam] ?= "${@bb.utils.contains_any('ROS_WORLD_SKIP_GROUPS', ['ffmpeg', 'x264'], 'ffmpeg: Depends on ffmpeg which requires commercial license; x264: Depends on ffmpeg which depends on x264 which requires commercial license', '', d)}" -SKIP_RECIPE[warehouse-ros-mongo] ?= "${@bb.utils.contains_any('ROS_WORLD_SKIP_GROUPS', ['mongodb', 'mongodb-legacy-cxx-driver'], 'Requires mongodb; mongodb-legacy-cxx-driver: requires unavailable mongo-cxx-driver-legacy', '', d)}" SKIP_RECIPE[webots-ros2-abb] ?= "${@bb.utils.contains('ROS_WORLD_SKIP_GROUPS', 'webots-python-modules', 'webots-python-modules: rdepends on webots-ros2-core which requires python-transforms3d-pip which is not available in OE yet', '', d)}" SKIP_RECIPE[webots-ros2] ?= "${@bb.utils.contains_any('ROS_WORLD_SKIP_GROUPS', ['qt5', 'opengl', 'x11', 'webots-python-modules'], 'qt5: rdepends on webots-ros2-universal-robot,webots-ros2-tiago which rdepends on rviz2 which depends on qtbase; opengl: rdepends on webots-ros2-universal-robot,webots-ros2-tiago which rdepends on rviz2 which depends on rviz-rendering which depends on rviz-ogre-vendor which depends on mesa which is not available because of missing opengl or vulkan in DISTRO_FEATURES; x11: rdepends on webots-ros2-universal-robot,webots-ros2-tiago which rdepends on rviz2 which depends on rviz-rendering which depends on rviz-ogre-vendor which depends on libx11,libxrandr,libxaw which require x11 in DISTRO_FEATURES; webots-python-modules: rdepends on webots-ros2-core which requires python-transforms3d-pip which is not available in OE yet and webots-ros2-importer which requires python3-collada-pip, urdf2webots-pip which are not available in OE yet', '', d)}" SKIP_RECIPE[webots-ros2-core] ?= "${@bb.utils.contains('ROS_WORLD_SKIP_GROUPS', 'webots-python-modules', 'webots-python-modules: requires python-transforms3d-pip which is not available in OE yet', '', d)}" From 63825e9c240cacdbf52025cd66739c2d2890f6a7 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 11:29:01 -0700 Subject: [PATCH 38/60] {humble} List geoemtry-msgs-native as build tool Signed-off-by: Rob Woolley --- meta-ros2-humble/conf/ros-distro/include/humble/ros-distro.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-ros2-humble/conf/ros-distro/include/humble/ros-distro.inc b/meta-ros2-humble/conf/ros-distro/include/humble/ros-distro.inc index 6eb6a0aaf83..946c3ad930d 100644 --- a/meta-ros2-humble/conf/ros-distro/include/humble/ros-distro.inc +++ b/meta-ros2-humble/conf/ros-distro/include/humble/ros-distro.inc @@ -31,6 +31,7 @@ ROS_SUPERFLORE_GENERATED_BUILDTOOLS += " \ fastrtps-native \ foonathan-memory-vendor-native \ generate-parameter-library-py-native \ + geometry-msgs-native \ iceoryx-binding-c-native \ iceoryx-hoofs-native \ iceoryx-posh-native \ From e6fe358416483dd2d26da28f0019ad03e73ffe3d Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 11:30:01 -0700 Subject: [PATCH 39/60] {humble} Remove unnecessary ROS_WORLD_SKIP_GROUPS The gazebo, ignition, and mongo-legacy-cxx-driver recipes are now present. We should no longer skip them by default. Signed-off-by: Rob Woolley --- .../conf/ros-distro/include/humble/ros-distro.inc | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/meta-ros2-humble/conf/ros-distro/include/humble/ros-distro.inc b/meta-ros2-humble/conf/ros-distro/include/humble/ros-distro.inc index 946c3ad930d..405b2f00103 100644 --- a/meta-ros2-humble/conf/ros-distro/include/humble/ros-distro.inc +++ b/meta-ros2-humble/conf/ros-distro/include/humble/ros-distro.inc @@ -139,22 +139,9 @@ ROS_WORLD_SKIP_GROUPS += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '', 'gl # ERROR: Nothing RPROVIDES 'ROS_UNRESOLVED_DEP-python3-collada-pip' (but meta-ros2-rolling/generated-recipes/webots-ros2-desktop/webots-ros2-importer_0.0.3-1.bb RDEPENDS on or otherwise requires it) ROS_WORLD_SKIP_GROUPS += "webots-python-modules" -# recipes depending on gazebo-rosdev -ROS_WORLD_SKIP_GROUPS += "gazebo" - # recipes depending on libqglviewer (https://packages.debian.org/source/stretch/libqglviewer https://packages.debian.org/stretch/libqglviewer2-qt5) ROS_WORLD_SKIP_GROUPS += "libqglviewer" -# recipes depending on ignition-* (ROS_UNRESOLVED_DEP-ignition-gazebo5, ROS_UNRESOLVED_DEP-ignition-math6, ROS_UNRESOLVED_DEP-ignition-msgs7, ROS_UNRESOLVED_DEP-ignition-transport10, ROS_UNRESOLVED_DEP-ignition-rendering5, ROS_UNRESOLVED_DEP-ignition-common4, ROS_UNRESOLVED_DEP-ignition-gui5) -ROS_WORLD_SKIP_GROUPS += "ignition" - -# recipes depending on legacy mongo-cxx-driver (https://packages.debian.org/source/stretch/mongo-cxx-driver-legacy) -# the mongodb recipe in meta-oe installs just the binaries mongoc, mongos, install_compass -# the header files searched by mongo-store, warehouse-ros-mongo cmake files cmake/FindMongoClient.cmake and cmake/FindMongoDB.cmake -# aren't even part of current version of mongo-cxx-driver -# src/mongo/client/dbclient.h and src/mongo/client/dbclientinterface.h are only in the legacy branches -ROS_WORLD_SKIP_GROUPS += "mongodb-legacy-cxx-driver" - # recipes depending on ros1 ROS_WORLD_SKIP_GROUPS += "${@bb.utils.contains('BBFILE_COLLECTIONS', 'ros1-layer', '', 'ros1', d)}" From 6799e3d124a06b83345ea0ded943037e8d64344a Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 11:32:34 -0700 Subject: [PATCH 40/60] {humble} Resolve missing ROS_UNRESOLVED_DEP entries Signed-off-by: Rob Woolley --- .../ros-distro/include/humble/ros-distro.inc | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/meta-ros2-humble/conf/ros-distro/include/humble/ros-distro.inc b/meta-ros2-humble/conf/ros-distro/include/humble/ros-distro.inc index 405b2f00103..3522ac82e63 100644 --- a/meta-ros2-humble/conf/ros-distro/include/humble/ros-distro.inc +++ b/meta-ros2-humble/conf/ros-distro/include/humble/ros-distro.inc @@ -295,14 +295,16 @@ ROS_UNRESOLVED_DEP-ignition-transport11 = "ignition-transport11" ROS_UNRESOLVED_DEP-ignition-msgs8 = "ignition-msgs8" -ROS_UNRESOLVED_DEP-ignition-plugin = "ignition-plugin" +ROS_UNRESOLVED_DEP-ignition-plugin = "ignition-plugin1" ROS_UNRESOLVED_DEP-ignition-gazebo6 = "ignition-gazebo6" +ROS_UNRESOLVED_DEP-gz-sim6 = "ignition-gazebo6" + ROS_UNRESOLVED_DEP-ignition-common4 = "ignition-common4" ROS_UNRESOLVED_DEP-gazebo = "gazebo" -ROS_UNRESOLVED_DEP-gazebo11 = "gazebo-rosdev" +ROS_UNRESOLVED_DEP-gazebo11 = "gazebo11" ROS_UNRESOLVED_DEP-ignition-gazebo6 = "ignition-gazebo6" ROS_UNRESOLVED_DEP-libgazebo11 = "gazebo11" ROS_UNRESOLVED_DEP-libgazebo11-dev = "gazebo11" @@ -328,7 +330,7 @@ ROS_UNRESOLVED_DEP-black = "python3-black" ROS_UNRESOLVED_DEP-black-native = "python3-black-native" ROS_UNRESOLVED_DEP-libdraco-dev = "draco" -ROS_UNRESOLVED_DEP-sdformat12 = "sdformat" +ROS_UNRESOLVED_DEP-sdformat12 = "sdformat12" ROS_UNRESOLVED_DEP-hdf5-tools-native = "hdf5-native" ROS_UNRESOLVED_DEP-libopenscenegraph = "openscenegraph" @@ -346,5 +348,17 @@ ROS_UNRESOLVED_DEP-ignition-fuel-tools7 = "ignition-fuel-tools7" ROS_UNRESOLVED_DEP-libserial = "libserial" ROS_UNRESOLVED_DEP-libserial-dev = "libserial" ROS_UNRESOLVED_DEP-python3-uvloop = "python3-uvloop" -ROS_UNRESOLVED_DEP-gz-plugin = "gz-plugin" +ROS_UNRESOLVED_DEP-gz-plugin = "ignition-plugin1" ROS_UNRESOLVED_DEP-libgdal-dev = "gdal" + +ROS_UNRESOLVED_DEP-python3-tabulate = "python3-tabulate" +ROS_UNRESOLVED_DEP-python3-graphviz = "python3-graphviz" +ROS_UNRESOLVED_DEP-graphviz-dev = "graphviz" +ROS_UNRESOLVED_DEP-python3-tqdm = "python3-tqdm" +ROS_UNRESOLVED_DEP-python3-smbus = "python3-smbus" +ROS_UNRESOLVED_DEP-libopus = "libopus" +ROS_UNRESOLVED_DEP-libopus-dev = "libopus" +ROS_UNRESOLVED_DEP-python3-colorcet = "python3-colorcet" +ROS_UNRESOLVED_DEP-libxkbcommon-dev = "libxkbcommon" + +ROS_UNRESOLVED_DEP-libavdevice-dev = "ffmpeg" From 630641c57e9df4711b3a21e29e762153449a03f8 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 11:33:20 -0700 Subject: [PATCH 41/60] {humble} Remove spinnaker camera driver from packagegroup This depends on downloading a binary driver from the vendor. Signed-off-by: Rob Woolley --- .../recipes-core/packagegroups/packagegroup-ros-world-humble.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-ros2-humble/recipes-core/packagegroups/packagegroup-ros-world-humble.bb b/meta-ros2-humble/recipes-core/packagegroups/packagegroup-ros-world-humble.bb index 44fa2ec999a..51f88fd2ab5 100644 --- a/meta-ros2-humble/recipes-core/packagegroups/packagegroup-ros-world-humble.bb +++ b/meta-ros2-humble/recipes-core/packagegroups/packagegroup-ros-world-humble.bb @@ -955,6 +955,7 @@ RDEPENDS:${PN}:remove = "usb-cam" # spinnaker-camera-driver requires the spinnaker SDK RDEPENDS:${PN}:remove = "spinnaker-camera-driver" +RDEPENDS:${PN}:remove = "spinnaker-synchronized-camera-driver" # septentrio-gnss-driver RDEPENDS:${PN}:remove = "septentrio-gnss-driver" From 4e40779536ed11e2dd9dc8238a59044fff7bf2bb Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 11:34:23 -0700 Subject: [PATCH 42/60] {humble} gazebomsgsout-native: Add new recipe The Gazebo package needs gazebomsgs_out as a native-compiled build tool. Instead of building all of Gazebo natively, we add customized CMakeLists.txt files that just compile gazebomsgs_out and nothing else. Signed-off-by: Rob Woolley --- .../gazebo/gazebomsgsout-native_11.14.0.bb | 33 +++++ .../gazebomsgs_out-CMakeLists.txt | 136 ++++++++++++++++++ .../gazebomsgs_out-gazebo-msgs-CMakeLists.txt | 51 +++++++ 3 files changed, 220 insertions(+) create mode 100644 meta-ros-common/recipes-devtools/gazebo/gazebomsgsout-native_11.14.0.bb create mode 100644 meta-ros-common/recipes-devtools/gazebo/gazebomsgsout/gazebomsgs_out-CMakeLists.txt create mode 100644 meta-ros-common/recipes-devtools/gazebo/gazebomsgsout/gazebomsgs_out-gazebo-msgs-CMakeLists.txt diff --git a/meta-ros-common/recipes-devtools/gazebo/gazebomsgsout-native_11.14.0.bb b/meta-ros-common/recipes-devtools/gazebo/gazebomsgsout-native_11.14.0.bb new file mode 100644 index 00000000000..f372ffba5e1 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/gazebomsgsout-native_11.14.0.bb @@ -0,0 +1,33 @@ +LICENSE = "Apache-2.0 & GPL-2.0-only & LGPL-2.1-only & LGPL-3.0-only & Unknown" +LIC_FILES_CHKSUM = "file://COPYING;md5=2a461be67a1edf991251f85f3aadd1d0 \ + file://LICENSE;md5=622f4fcdd9e66304dcb89897348be7b0 \ + file://cmake/GPL-2;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +# A native built version of gazebomsgs_out is necessary to cross-compilegazebo11 +SRC_URI = "git://github.com/gazebosim/gazebo-classic.git;protocol=https;branch=gazebo11 \ + file://gazebomsgs_out-CMakeLists.txt \ + file://gazebomsgs_out-gazebo-msgs-CMakeLists.txt" + +# Modify these as desired +PV = "11.14.0" +SRCREV = "9b72949304e409d5f33150e87e6b348c54b5c015" + +S = "${WORKDIR}/git" + +EXTRA_OECMAKE = " -DINSTALL_GAZEBOMSGS_OUT_EXECUTABLE:BOOL=ON" + +inherit cmake pkgconfig + +DEPENDS += " \ + boost-native \ + ignition-math6-native \ + protobuf-native \ + protobuf-c-native \ +" + +do_configure:prepend() { + cp ${WORKDIR}/gazebomsgs_out-CMakeLists.txt ${S}/CMakeLists.txt + cp ${WORKDIR}/gazebomsgs_out-gazebo-msgs-CMakeLists.txt ${S}/gazebo/msgs/CMakeLists.txt +} + +inherit native diff --git a/meta-ros-common/recipes-devtools/gazebo/gazebomsgsout/gazebomsgs_out-CMakeLists.txt b/meta-ros-common/recipes-devtools/gazebo/gazebomsgsout/gazebomsgs_out-CMakeLists.txt new file mode 100644 index 00000000000..eaf79b5eb96 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/gazebomsgsout/gazebomsgs_out-CMakeLists.txt @@ -0,0 +1,136 @@ +cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR) + +if(COMMAND CMAKE_POLICY) + CMAKE_POLICY(SET CMP0003 NEW) + CMAKE_POLICY(SET CMP0004 NEW) +endif(COMMAND CMAKE_POLICY) + +if(POLICY CMP0100) + cmake_policy(SET CMP0100 NEW) +endif() + +project (gazebomsgs_out) +set (GAZEBO_MAJOR_VERSION 11) +set (GAZEBO_MINOR_VERSION 14) +# The patch version may have been bumped for prerelease purposes; be sure to +# check gazebo-release/ubuntu/debian/changelog@default to determine what the +# next patch version should be for a regular release. +set (GAZEBO_PATCH_VERSION 0) + +set (GAZEBO_VERSION ${GAZEBO_MAJOR_VERSION}.${GAZEBO_MINOR_VERSION}) +set (GAZEBO_VERSION_FULL ${GAZEBO_MAJOR_VERSION}.${GAZEBO_MINOR_VERSION}.${GAZEBO_PATCH_VERSION}) + +set (gazebo_cmake_dir ${PROJECT_SOURCE_DIR}/cmake CACHE PATH "Location of CMake scripts") + +# Use GNUInstallDirst to get canonical paths +include(GNUInstallDirs) + +######################################## +# Find ignition math library +find_package(ignition-math6 QUIET) +if (NOT ignition-math6_FOUND) + message(STATUS "Looking for ignition-math6-config.cmake - not found") + BUILD_ERROR ("Missing: Ignition math (libignition-math6-dev)") +else() + message(STATUS "Looking for ignition-math6-config.cmake - found") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ignition-math6_CXX_FLAGS}") + include_directories(${ignition-math6_INCLUDE_DIRS}) + link_directories(${ignition-math6_LIBRARY_DIRS}) +endif() + +######################################## +execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --modversion protobuf + OUTPUT_VARIABLE PROTOBUF_VERSION + RESULT_VARIABLE protobuf_modversion_failed) + +######################################## +if (PROTOBUF_VERSION LESS 2.3.0) + BUILD_ERROR("Incorrect version: Gazebo requires protobuf version 2.3.0 or greater") +endif() + +######################################## +# The Google Protobuf library for message generation + serialization + +# Protobuf >= 22 requires to link abseil, so we are constrained to use +# find_package(Protobuf) and link to protobuf::libprotobuf, +# see https://github.com/conda-forge/conda-forge-pinning-feedstock/issues/4075#issuecomment-1569242816 +if (DEFINED PROTOBUF_VERSION AND PROTOBUF_VERSION GREATER_EQUAL 22.0) + set(GZ_PROTOBUF_USE_CMAKE_CONFIG_DEFAULT ON) +else() + set(GZ_PROTOBUF_USE_CMAKE_CONFIG_DEFAULT OFF) +endif() +option(GZ_PROTOBUF_USE_CMAKE_CONFIG "If true use protobuf-config.cmake to find protobuf" ${GZ_PROTOBUF_USE_CMAKE_CONFIG_DEFAULT}) +mark_as_advanced(GZ_PROTOBUF_USE_CMAKE_CONFIG) + +if(NOT GZ_PROTOBUF_USE_CMAKE_CONFIG) + find_package(Protobuf REQUIRED) + if (NOT PROTOBUF_FOUND) + BUILD_ERROR ("Missing: Google Protobuf (libprotobuf-dev)") + endif() + if (NOT PROTOBUF_PROTOC_EXECUTABLE) + BUILD_ERROR ("Missing: Google Protobuf Compiler (protobuf-compiler)") + endif() + if (NOT PROTOBUF_PROTOC_LIBRARY) + BUILD_ERROR ("Missing: Google Protobuf Compiler Library (libprotoc-dev)") + endif() + if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + set (GZ_PROTOBUF_LIBRARY ${PROTOBUF_LIBRARY_DEBUG}) + set (GZ_PROTOBUF_PROTOC_LIBRARY ${PROTOBUF_PROTOC_LIBRARY_DEBUG}) + else() + set (GZ_PROTOBUF_LIBRARY ${PROTOBUF_LIBRARY}) + set (GZ_PROTOBUF_PROTOC_LIBRARY ${PROTOBUF_PROTOC_LIBRARY}) + endif() +else() + find_package(Protobuf CONFIG REQUIRED) + set (GZ_PROTOBUF_LIBRARY protobuf::libprotobuf) + set (GZ_PROTOBUF_PROTOC_LIBRARY protobuf::libprotoc) + if(NOT DEFINED PROTOBUF_PROTOC_EXECUTABLE) + get_target_property(PROTOBUF_PROTOC_EXECUTABLE protobuf::protoc LOCATION) + endif() +endif() + +######################################## +# Find Boost, if not specified manually +include(FindBoost) +find_package(Boost ${MIN_BOOST_VERSION} REQUIRED thread system filesystem program_options regex iostreams date_time) + +if (NOT Boost_FOUND) + set (BUILD_GAZEBO OFF CACHE INTERNAL "Build Gazebo" FORCE) + BUILD_ERROR ("Boost not found. Please install thread system filesystem program_options regex iostreams date_time boost version ${MIN_BOOST_VERSION} or higher.") +endif() + +### ######################################## +### # set boost pkgconfig cflags +### set (Boost_PKGCONFIG_CFLAGS ${Boost_INCLUDE_DIRS}) +### if (NOT "${Boost_PKGCONFIG_CFLAGS}" STREQUAL "") +### set (Boost_PKGCONFIG_CFLAGS "-I${Boost_PKGCONFIG_CFLAGS}") +### endif (NOT "${Boost_PKGCONFIG_CFLAGS}" STREQUAL "") +### string (REPLACE ";" " -I" Boost_PKGCONFIG_CFLAGS "${Boost_PKGCONFIG_CFLAGS}") +### +### # set boost pkgconfig libs +### set (Boost_PKGCONFIG_LIBS ${Boost_LIBRARY_DIRS}) +### if (NOT "${Boost_PKGCONFIG_LIBS}" STREQUAL "") +### set (Boost_PKGCONFIG_LIBS "-L${Boost_PKGCONFIG_LIBS}") +### endif(NOT "${Boost_PKGCONFIG_LIBS}" STREQUAL "") +### string (REPLACE ";" " -L" Boost_PKGCONFIG_LIBS "${Boost_PKGCONFIG_LIBS}") +### +### foreach (b ${Boost_LIBRARIES}) +### get_filename_component(bname ${b} NAME_WE) +### # Prefix -l if not already prefixed +### string(FIND ${bname} "-l" lprefix) +### if (NOT ${lprefix} EQUAL 0 ) +### set (bname "-l${bname}") +### endif() +### # Remove the prefix lib (not always present, like in pthread) +### string (REPLACE "lib" "" bname "${bname}") +### # Some boost versions add the Boost:: component to cmake, need to change that to boost_ prefix +### string (REPLACE "Boost::" "boost_" bname "${bname}") +### set (Boost_PKGCONFIG_LIBS "${Boost_PKGCONFIG_LIBS} ${bname}") +### endforeach(b) + +# Main includes for compilation +include_directories(${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR}) +include_directories(SYSTEM ${IGNITION-MATH_INCLUDE_DIRS}) + +add_custom_target(tests) +add_subdirectory(gazebo/msgs) diff --git a/meta-ros-common/recipes-devtools/gazebo/gazebomsgsout/gazebomsgs_out-gazebo-msgs-CMakeLists.txt b/meta-ros-common/recipes-devtools/gazebo/gazebomsgsout/gazebomsgs_out-gazebo-msgs-CMakeLists.txt new file mode 100644 index 00000000000..cfdce9c80e2 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/gazebomsgsout/gazebomsgs_out-gazebo-msgs-CMakeLists.txt @@ -0,0 +1,51 @@ +# Cross-compilation related options +# In a cross-compilation scenario, it is possible that the gazebomsgs_out +# generator compiled for the target machine cannot be used to generate +# the C++ code corresponding to the .proto definition. For this scenario, +# the following two options can be used as follows. +# First of all, gazebo is compiled targeting the host machine, and in the +# build targeting the host, the INSTALL_GAZEBOMSGS_OUT_EXECUTABLE option is +# enabled: +# > cmake -DINSTALL_GAZEBOMSGS_OUT_EXECUTABLE:BOOL=ON .. +# ensuring that the gazebomsgs_out is installed in +# /bin/gazebomsgs_out . Then, the same version of gazebo +# can be cross-compiled, and in the cross-compilation build the location of the +# host gazebomsgs_out is specified via the GAZEBOMSGS_OUT_EXECUTABLE +# CMake cache variable: +# > cmake -DGAZEBOMSGS_OUT_EXECUTABLE=/bin/gazebomsgs_out .. + +option( + INSTALL_GAZEBOMSGS_OUT_EXECUTABLE + "Install the gazebomsgs_out executable." + OFF) +mark_as_advanced(INSTALL_GAZEBOMSGS_OUT_EXECUTABLE) + +set( + GAZEBOMSGS_OUT_EXECUTABLE + "$" + CACHE STRING + "gazebomsgs_out executable used in gazebo protobuf msgs generation.") +mark_as_advanced(GAZEBOMSGS_OUT_EXECUTABLE) + +include (${gazebo_cmake_dir}/GazeboUtils.cmake) +include_directories(${IGNITION-MATH_INCLUDE_DIRS} ${IGNITION-MSGS_INCLUDE_DIRS}) + +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + +add_executable(gazebomsgs_out generator/GazeboGenerator.cc generator/gazebo_generator.cc) +target_link_libraries(gazebomsgs_out ${GZ_PROTOBUF_LIBRARY} ${GZ_PROTOBUF_PROTOC_LIBRARY}) +if (UNIX) + target_link_libraries(gazebomsgs_out pthread) +endif() +# Visual Studio enables c++11 support by default +if (NOT MSVC) + if(CMAKE_VERSION VERSION_LESS 3.8.2) + target_compile_options(gazebomsgs_out PRIVATE -std=c++11) + else() + target_compile_features(gazebomsgs_out PRIVATE cxx_std_11) + endif() +endif() + +if (INSTALL_GAZEBOMSGS_OUT_EXECUTABLE) + gz_install_executable(gazebomsgs_out) +endif() From 4000f7150c292a496db5e4b037b542055fd23b07 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 11:36:02 -0700 Subject: [PATCH 43/60] {common} gazebo11: Add new recipe This provides Gazebo Classic Signed-off-by: Rob Woolley --- .../revert-CustomGLSLProgramWriter.patch | 329 ++++++++++++++++++ .../revert-CustomGLSLProgramWriter.patch.orig | 247 +++++++++++++ .../gazebo/gazebo11_11.14.0.bb | 80 +++++ 3 files changed, 656 insertions(+) create mode 100644 meta-ros-common/recipes-devtools/gazebo/gazebo11/revert-CustomGLSLProgramWriter.patch create mode 100644 meta-ros-common/recipes-devtools/gazebo/gazebo11/revert-CustomGLSLProgramWriter.patch.orig create mode 100644 meta-ros-common/recipes-devtools/gazebo/gazebo11_11.14.0.bb diff --git a/meta-ros-common/recipes-devtools/gazebo/gazebo11/revert-CustomGLSLProgramWriter.patch b/meta-ros-common/recipes-devtools/gazebo/gazebo11/revert-CustomGLSLProgramWriter.patch new file mode 100644 index 00000000000..809c88778a4 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/gazebo11/revert-CustomGLSLProgramWriter.patch @@ -0,0 +1,329 @@ +https://github.com/gazebosim/gazebo-classic/commit/6ca23806f7b67d51529e2ddb07d3464b85781c6e.patch + +From ca09e1330138e8083d9b9274992b8f5d07eb78dd Mon Sep 17 00:00:00 2001 +From: Rob Woolley +Date: Sun, 19 May 2024 07:29:57 -0700 +Subject: [PATCH] Revert "fix for ogre 1.8" + +This reverts commit 6ca23806f7b67d51529e2ddb07d3464b85781c6e. +--- + .../rendering/CustomPSSMShadowCameraSetup.cc | 25 ----- + .../rendering/CustomPSSMShadowCameraSetup.hh | 32 ------- + gazebo/rendering/RTShaderSystem.cc | 13 --- + gazebo/rendering/RTShaderSystem.hh | 1 + + gazebo/rendering/RTShaderSystemPrivate.hh | 12 --- + gazebo/rendering/ogre_gazebo.h | 4 - + media/rtshaderlib/SGXLib_IntegratedPSSM.glsl | 94 ++----------------- + 7 files changed, 8 insertions(+), 173 deletions(-) + +diff --git a/gazebo/rendering/CustomPSSMShadowCameraSetup.cc b/gazebo/rendering/CustomPSSMShadowCameraSetup.cc +index c4570197aa..7f0d8f5a2c 100644 +--- a/gazebo/rendering/CustomPSSMShadowCameraSetup.cc ++++ b/gazebo/rendering/CustomPSSMShadowCameraSetup.cc +@@ -657,28 +657,3 @@ void CustomPSSMShadowCameraSetup::getShadowCamera(const Ogre::SceneManager *_sm, + cam->setCustomProjectionMatrix(true, oldCustomProjMat); + } + } +- +-////////////////////////////////////////////////// +-CustomGLSLProgramWriter::CustomGLSLProgramWriter() +- : Ogre::RTShader::GLSLProgramWriter() +-{ +- mGpuConstTypeMap[Ogre::GCT_SAMPLER2DSHADOW] = "sampler2DShadow"; +-} +- +-////////////////////////////////////////////////// +-CustomGLSLProgramWriterFactory::CustomGLSLProgramWriterFactory() +-{ +-} +- +-////////////////////////////////////////////////// +-const Ogre::String &CustomGLSLProgramWriterFactory::getTargetLanguage() const +-{ +- static const Ogre::String targetLanguageGLSL("glsl"); +- return targetLanguageGLSL; +-} +- +-////////////////////////////////////////////////// +-Ogre::RTShader::ProgramWriter *CustomGLSLProgramWriterFactory::create() +-{ +- return OGRE_NEW CustomGLSLProgramWriter(); +-} +diff --git a/gazebo/rendering/CustomPSSMShadowCameraSetup.hh b/gazebo/rendering/CustomPSSMShadowCameraSetup.hh +index 24faabba7f..d36203362d 100644 +--- a/gazebo/rendering/CustomPSSMShadowCameraSetup.hh ++++ b/gazebo/rendering/CustomPSSMShadowCameraSetup.hh +@@ -123,38 +123,6 @@ namespace gazebo + const Ogre::Light *_light, Ogre::Camera *_texCam, size_t _iteration) + const override; + }; +- +- /// \brief This overrides ogre's default GLSLProgramWriter to fix +- /// a bug in ogre versions <= 1.8 where 'sampler2DShadow' sampler type +- /// is missing +- class GAZEBO_VISIBLE CustomGLSLProgramWriter : +- public Ogre::RTShader::GLSLProgramWriter +- { +- /// \brief Constructor +- public: CustomGLSLProgramWriter(); +- +- /// \brief Destructor +- public: ~CustomGLSLProgramWriter() = default; +- }; +- +- /// \brief A factory to create our own CustomGLSLProgramWriter. +- class GAZEBO_VISIBLE CustomGLSLProgramWriterFactory : +- public Ogre::RTShader::ProgramWriterFactory +- { +- /// \brief Constructor +- public: CustomGLSLProgramWriterFactory(); +- +- /// \brief Destructor +- public: ~CustomGLSLProgramWriterFactory() = default; +- +- /// \brief Get shader language supported by this factory +- /// \return Language supported - "glsl" +- public: const Ogre::String &getTargetLanguage() const override; +- +- /// \brief Creates the GLSLProgramWriter +- /// \return Ogre's program writer +- public: virtual Ogre::RTShader::ProgramWriter* create() override; +- }; + } + } + +diff --git a/gazebo/rendering/RTShaderSystem.cc b/gazebo/rendering/RTShaderSystem.cc +index 72f86bf782..52cf0050ad 100644 +--- a/gazebo/rendering/RTShaderSystem.cc ++++ b/gazebo/rendering/RTShaderSystem.cc +@@ -40,8 +40,6 @@ + #include "gazebo/common/Exception.hh" + #include "gazebo/common/SystemPaths.hh" + #include "gazebo/rendering/ogre_gazebo.h" +-#include "gazebo/rendering/CustomPSSMShadowCameraSetup.hh" +-#include "gazebo/rendering/Light.hh" + #include "gazebo/rendering/RenderEngine.hh" + #include "gazebo/rendering/Scene.hh" + #include "gazebo/rendering/Visual.hh" +@@ -100,13 +98,6 @@ void RTShaderSystem::Init() + // Set shader cache path. + this->dataPtr->shaderGenerator->setShaderCachePath(cachePath); + +-#if OGRE_VERSION_MAJOR >= 1 && OGRE_VERSION_MINOR <= 8 +- this->dataPtr->programWriterFactory = +- OGRE_NEW CustomGLSLProgramWriterFactory(); +- Ogre::RTShader::ProgramWriterManager::getSingletonPtr()->addFactory( +- this->dataPtr->programWriterFactory); +-#endif +- + this->dataPtr->shaderGenerator->setTargetLanguage("glsl"); + + Ogre::RTShader::SubRenderStateFactory* factory = +@@ -149,10 +140,6 @@ void RTShaderSystem::Fini() + #else + Ogre::RTShader::ShaderGenerator::destroy(); + #endif +- +- if (this->dataPtr->programWriterFactory) +- delete this->dataPtr->programWriterFactory; +- + this->dataPtr->shaderGenerator = NULL; + } + +diff --git a/gazebo/rendering/RTShaderSystem.hh b/gazebo/rendering/RTShaderSystem.hh +index b9227357f9..c66852a389 100644 +--- a/gazebo/rendering/RTShaderSystem.hh ++++ b/gazebo/rendering/RTShaderSystem.hh +@@ -22,6 +22,7 @@ + #include + + #include "gazebo/rendering/ogre_gazebo.h" ++#include "gazebo/rendering/CustomPSSMShadowCameraSetup.hh" + #include "gazebo/gazebo_config.h" + + #include "gazebo/rendering/Camera.hh" +diff --git a/gazebo/rendering/RTShaderSystemPrivate.hh b/gazebo/rendering/RTShaderSystemPrivate.hh +index 15d1b277fa..97bc8656ee 100644 +--- a/gazebo/rendering/RTShaderSystemPrivate.hh ++++ b/gazebo/rendering/RTShaderSystemPrivate.hh +@@ -22,8 +22,6 @@ + #include + #include + +-#include "gazebo/rendering/CustomPSSMShadowCameraSetup.hh" +- + #include "gazebo/rendering/ogre_gazebo.h" + #include "gazebo/gazebo_config.h" + +@@ -76,16 +74,6 @@ namespace gazebo + + /// \brief Parallel Split Shadow Map (PSSM) overlap between splits. + public: double shadowSplitPadding = 2.0; +- +- /// \brief Custom program writer factory that supports sampler2DShadow, +- /// only used in ogre versions <= 1.8 +- public: CustomGLSLProgramWriterFactory *programWriterFactory = nullptr; +- +- /// \brief Flag to indicate if normal map should be enabled +- public: bool enableNormalMap = true; +- +- /// \brief Mutex to protect shaders and shadows update +- public: std::mutex updateMutex; + }; + } + } +diff --git a/gazebo/rendering/ogre_gazebo.h b/gazebo/rendering/ogre_gazebo.h +index a171782c1e..f151b620b9 100644 +--- a/gazebo/rendering/ogre_gazebo.h ++++ b/gazebo/rendering/ogre_gazebo.h +@@ -66,10 +66,6 @@ + #if OGRE_VERSION_MAJOR > 1 || OGRE_VERSION_MINOR >= 7 + #include + #include +-#include +-#include +-#include +-#include + #endif + + #if OGRE_VERSION_MAJOR > 1 || OGRE_VERSION_MINOR >= 9 +diff --git a/media/rtshaderlib/SGXLib_IntegratedPSSM.glsl b/media/rtshaderlib/SGXLib_IntegratedPSSM.glsl +index 0eb9a5956a..4826e7d6a9 100644 +--- a/media/rtshaderlib/SGXLib_IntegratedPSSM.glsl ++++ b/media/rtshaderlib/SGXLib_IntegratedPSSM.glsl +@@ -1,71 +1,3 @@ +-/* +- * Copyright (C) 2017 Open Source Robotics Foundation +- * +- * Licensed under the Apache License, Version 2.0 (the "License"); +- * you may not use this file except in compliance with the License. +- * You may obtain a copy of the License at +- * +- * http://www.apache.org/licenses/LICENSE-2.0 +- * +- * Unless required by applicable law or agreed to in writing, software +- * distributed under the License is distributed on an "AS IS" BASIS, +- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +- * See the License for the specific language governing permissions and +- * limitations under the License. +- * +-*/ +- +-// Code in this file has been adapted from Ogre. The original Ogre's licence and +-// copyright headers are copied below: +- +-/* +------------------------------------------------------------------------------ +-This source file is part of OGRE +-(Object-oriented Graphics Rendering Engine) +-For the latest info, see http://www.ogre3d.org +- +-Copyright (c) 2000-2012 Torus Knot Software Ltd +-Permission is hereby granted, free of charge, to any person obtaining a copy +-of this software and associated documentation files (the "Software"), to deal +-in the Software without restriction, including without limitation the rights +-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +-copies of the Software, and to permit persons to whom the Software is +-furnished to do so, subject to the following conditions: +- +-The above copyright notice and this permission notice shall be included in +-all copies or substantial portions of the Software. +- +-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +-THE SOFTWARE. +------------------------------------------------------------------------------ +-*/ +-//----------------------------------------------------------------------------- +-// Program Name: SGXLib_IntegratedPSSM +-// Program Desc: Integrated PSSM functions. +-// Program Type: Vertex/Pixel shader +-// Language: GLSL +-//----------------------------------------------------------------------------- +- +-//----------------------------------------------------------------------------- +-void SGX_CopyDepth(in vec4 clipSpacePos, +- out float oDepth) +-{ +- oDepth = clipSpacePos.z; +-} +- +-//----------------------------------------------------------------------------- +-void SGX_ModulateScalar(in float vIn0, in vec4 vIn1, out vec4 vOut) +-{ +- vOut = vIn0 * vIn1; +-} +- +-//----------------------------------------------------------------------------- +-void SGX_ApplyShadowFactor_Diffuse(in vec4 ambient, + in vec4 lightSum, + in float fShadowFactor, + out vec4 oLight) +@@ -75,7 +7,7 @@ void SGX_ApplyShadowFactor_Diffuse(in vec4 ambient, + } + + //----------------------------------------------------------------------------- +-float _SGX_ShadowPoisson9(sampler2DShadow shadowMap, vec4 shadowMapPos, vec2 invShadowMapSize, bool hardwarePCF) ++float _SGX_ShadowPoisson9(sampler2DShadow shadowMap, vec4 shadowMapPos, vec2 invShadowMapSize) + { + // Remove shadow outside shadow maps so that all that area appears lit + // +@@ -121,19 +53,13 @@ float _SGX_ShadowPoisson9(sampler2DShadow shadowMap, vec4 shadowMapPos, vec2 inv + // driver hack. + // shadow += shadow2D(shadowMap, newUV.xyz).r; + float d = shadow2D(shadowMap, newUV.xyz).r; +- if (hardwarePCF) +- shadow += d; +- else +- shadow += step(shadowMapPos.z, d); ++ float minShadowFactor = 0.2; ++ shadow += (step(shadowMapPos.z, d) >= 1.0) ? 1.0 : minShadowFactor; + } + shadow /= 9.0; + + // smoothstep makes shadow edges appear more crisp and hides Mach bands +- float s = smoothstep(0.0, 1.0, shadow); +- // make shadow lighter color +- float minShadowFactor = 0.2; +- s = s * (1.0 - minShadowFactor) + minShadowFactor; +- return s; ++ return smoothstep(0.0, 1.0, shadow); + } + + //----------------------------------------------------------------------------- +@@ -150,25 +76,19 @@ void SGX_ComputeShadowFactor_PSSM3(in float fDepth, + in vec4 invShadowMapSize2, + out float oShadowFactor) + { +- // hack! On OSX the shadow map size is halved so we use this as a hint +- // that hardware PCF is not enabled. +- bool hardwarePCF = false; +- if (invShadowMapSize0.x == invShadowMapSize1.x) +- hardwarePCF = true; +- + if (fDepth <= vSplitPoints.x) + { + oShadowFactor = +- _SGX_ShadowPoisson9(shadowMap0, lightPosition0, invShadowMapSize0.xy, hardwarePCF); ++ _SGX_ShadowPoisson9(shadowMap0, lightPosition0, invShadowMapSize0.xy); + } + else if (fDepth <= vSplitPoints.y) + { + oShadowFactor = +- _SGX_ShadowPoisson9(shadowMap1, lightPosition1, invShadowMapSize1.xy, hardwarePCF); ++ _SGX_ShadowPoisson9(shadowMap1, lightPosition1, invShadowMapSize1.xy); + } + else + { + oShadowFactor = +- _SGX_ShadowPoisson9(shadowMap2, lightPosition2, invShadowMapSize2.xy, hardwarePCF); ++ _SGX_ShadowPoisson9(shadowMap2, lightPosition2, invShadowMapSize2.xy); + } + } +-- +2.43.0 + diff --git a/meta-ros-common/recipes-devtools/gazebo/gazebo11/revert-CustomGLSLProgramWriter.patch.orig b/meta-ros-common/recipes-devtools/gazebo/gazebo11/revert-CustomGLSLProgramWriter.patch.orig new file mode 100644 index 00000000000..c1bf8a6395b --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/gazebo11/revert-CustomGLSLProgramWriter.patch.orig @@ -0,0 +1,247 @@ +https://github.com/gazebosim/gazebo-classic/commit/6ca23806f7b67d51529e2ddb07d3464b85781c6e.patch + +From 6ca23806f7b67d51529e2ddb07d3464b85781c6e Mon Sep 17 00:00:00 2001 +From: Ian Chen +Date: Tue, 14 Nov 2017 15:12:05 -0800 +Subject: [PATCH] fix for ogre 1.8 + +--- + .../rendering/CustomPSSMShadowCameraSetup.cc | 25 +++++++++++++ + .../rendering/CustomPSSMShadowCameraSetup.hh | 35 +++++++++++++++++++ + gazebo/rendering/RTShaderSystem.cc | 12 +++++++ + gazebo/rendering/RTShaderSystem.hh | 1 - + gazebo/rendering/RTShaderSystemPrivate.hh | 6 ++++ + gazebo/rendering/ogre_gazebo.h | 2 ++ + media/rtshaderlib/SGXLib_IntegratedPSSM.glsl | 26 ++++++++++---- + 7 files changed, 99 insertions(+), 8 deletions(-) + +diff --git a/gazebo/rendering/CustomPSSMShadowCameraSetup.cc b/gazebo/rendering/CustomPSSMShadowCameraSetup.cc +index e518ba74f8..ce065e5852 100644 +--- a/gazebo/rendering/CustomPSSMShadowCameraSetup.cc ++++ b/gazebo/rendering/CustomPSSMShadowCameraSetup.cc +@@ -564,3 +564,28 @@ void CustomPSSMShadowCameraSetup::getShadowCamera(const Ogre::SceneManager *_sm, + cam->setNearClipDistance(oldNear); + cam->setFarClipDistance(oldFar); + } ++ ++////////////////////////////////////////////////// ++CustomGLSLProgramWriter::CustomGLSLProgramWriter() ++ : Ogre::RTShader::GLSLProgramWriter() ++{ ++ mGpuConstTypeMap[Ogre::GCT_SAMPLER2DSHADOW] = "sampler2DShadow"; ++} ++ ++////////////////////////////////////////////////// ++CustomGLSLProgramWriterFactory::CustomGLSLProgramWriterFactory() ++ : mLanguage("glsl") ++{ ++} ++ ++////////////////////////////////////////////////// ++const Ogre::String &CustomGLSLProgramWriterFactory::getTargetLanguage() const ++{ ++ return mLanguage; ++} ++ ++////////////////////////////////////////////////// ++Ogre::RTShader::ProgramWriter *CustomGLSLProgramWriterFactory::create() ++{ ++ return OGRE_NEW CustomGLSLProgramWriter(); ++} +diff --git a/gazebo/rendering/CustomPSSMShadowCameraSetup.hh b/gazebo/rendering/CustomPSSMShadowCameraSetup.hh +index 0ccd7918d1..04844bfd3a 100644 +--- a/gazebo/rendering/CustomPSSMShadowCameraSetup.hh ++++ b/gazebo/rendering/CustomPSSMShadowCameraSetup.hh +@@ -119,6 +119,41 @@ namespace gazebo + const Ogre::Light *_light, Ogre::Camera *_texCam, size_t _iteration) + const; + }; ++ ++ /// \brief This overrides ogre's default GLSLProgramWriter to fix ++ /// a bug in ogre versions <= 1.8 where 'sampler2DShadow' sampler type ++ /// is missing ++ class GAZEBO_VISIBLE CustomGLSLProgramWriter : ++ public Ogre::RTShader::GLSLProgramWriter ++ { ++ /// \brief Constructor ++ public: CustomGLSLProgramWriter(); ++ ++ /// \brief Destructor ++ public: ~CustomGLSLProgramWriter() = default; ++ }; ++ ++ /// \brief A factory to create our own CustomGLSLProgramWriter. ++ class GAZEBO_VISIBLE CustomGLSLProgramWriterFactory : ++ public Ogre::RTShader::ProgramWriterFactory ++ { ++ /// \brief Constructor ++ public: CustomGLSLProgramWriterFactory(); ++ ++ /// \brief Destructor ++ public: ~CustomGLSLProgramWriterFactory() = default; ++ ++ /// \brief Get shader language supported by this factory ++ /// \return Language supported - "glsl" ++ public: const Ogre::String &getTargetLanguage() const; ++ ++ /// \brief Creates the GLSLProgramWriter ++ /// \return Ogre's program writer ++ public: virtual Ogre::RTShader::ProgramWriter* create(); ++ ++ /// \brief supported shader language ++ private: Ogre::String mLanguage; ++ }; + } + } + +diff --git a/gazebo/rendering/RTShaderSystem.cc b/gazebo/rendering/RTShaderSystem.cc +index ec837375f2..d4ec180917 100644 +--- a/gazebo/rendering/RTShaderSystem.cc ++++ b/gazebo/rendering/RTShaderSystem.cc +@@ -43,6 +43,7 @@ + #include "gazebo/common/Exception.hh" + #include "gazebo/common/SystemPaths.hh" + #include "gazebo/rendering/ogre_gazebo.h" ++#include "gazebo/rendering/CustomPSSMShadowCameraSetup.hh" + #include "gazebo/rendering/RenderEngine.hh" + #include "gazebo/rendering/Scene.hh" + #include "gazebo/rendering/Visual.hh" +@@ -99,6 +100,13 @@ void RTShaderSystem::Init() + // Set shader cache path. + this->dataPtr->shaderGenerator->setShaderCachePath(cachePath); + ++#if OGRE_VERSION_MAJOR >= 1 && OGRE_VERSION_MINOR <= 8 ++ this->dataPtr->programWriterFactory = ++ OGRE_NEW CustomGLSLProgramWriterFactory(); ++ Ogre::RTShader::ProgramWriterManager::getSingletonPtr()->addFactory( ++ this->dataPtr->programWriterFactory); ++#endif ++ + this->dataPtr->shaderGenerator->setTargetLanguage("glsl"); + + Ogre::RTShader::SubRenderStateFactory* factory = +@@ -129,6 +137,10 @@ void RTShaderSystem::Fini() + #else + Ogre::RTShader::ShaderGenerator::destroy(); + #endif ++ ++ if (this->dataPtr->programWriterFactory) ++ delete this->dataPtr->programWriterFactory; ++ + this->dataPtr->shaderGenerator = NULL; + } + +diff --git a/gazebo/rendering/RTShaderSystem.hh b/gazebo/rendering/RTShaderSystem.hh +index abc93f846c..7a2e46ed4b 100644 +--- a/gazebo/rendering/RTShaderSystem.hh ++++ b/gazebo/rendering/RTShaderSystem.hh +@@ -22,7 +22,6 @@ + #include + + #include "gazebo/rendering/ogre_gazebo.h" +-#include "gazebo/rendering/CustomPSSMShadowCameraSetup.hh" + #include "gazebo/gazebo_config.h" + + #include "gazebo/rendering/Camera.hh" +diff --git a/gazebo/rendering/RTShaderSystemPrivate.hh b/gazebo/rendering/RTShaderSystemPrivate.hh +index 86f9915c24..da1411a003 100644 +--- a/gazebo/rendering/RTShaderSystemPrivate.hh ++++ b/gazebo/rendering/RTShaderSystemPrivate.hh +@@ -21,6 +21,8 @@ + #include + #include + ++#include "gazebo/rendering/CustomPSSMShadowCameraSetup.hh" ++ + #include "gazebo/rendering/ogre_gazebo.h" + #include "gazebo/gazebo_config.h" + +@@ -70,6 +72,10 @@ namespace gazebo + + /// \brief Parallel Split Shadow Map (PSSM) overlap between splits. + public: double shadowSplitPadding = 2.0; ++ ++ /// \brief Custom program writer factory that supports sampler2DShadow, ++ /// only used in ogre versions <= 1.8 ++ public: CustomGLSLProgramWriterFactory *programWriterFactory = nullptr; + }; + } + } +diff --git a/gazebo/rendering/ogre_gazebo.h b/gazebo/rendering/ogre_gazebo.h +index 0991866f68..68574ad079 100644 +--- a/gazebo/rendering/ogre_gazebo.h ++++ b/gazebo/rendering/ogre_gazebo.h +@@ -66,6 +66,8 @@ + #if OGRE_VERSION_MAJOR > 1 || OGRE_VERSION_MINOR >= 7 + #include + #include ++#include ++#include + #endif + + #if OGRE_VERSION_MAJOR > 1 || OGRE_VERSION_MINOR >= 9 +diff --git a/media/rtshaderlib/SGXLib_IntegratedPSSM.glsl b/media/rtshaderlib/SGXLib_IntegratedPSSM.glsl +index 5238bb15fc..b7bcc4f8a3 100644 +--- a/media/rtshaderlib/SGXLib_IntegratedPSSM.glsl ++++ b/media/rtshaderlib/SGXLib_IntegratedPSSM.glsl +@@ -55,7 +55,7 @@ void SGX_ApplyShadowFactor_Diffuse(in vec4 ambient, + } + + //----------------------------------------------------------------------------- +-float _SGX_ShadowPoisson9(sampler2DShadow shadowMap, vec4 shadowMapPos, vec2 invShadowMapSize) ++float _SGX_ShadowPoisson9(sampler2DShadow shadowMap, vec4 shadowMapPos, vec2 invShadowMapSize, bool hardwarePCF) + { + // Remove shadow outside shadow maps so that all that area appears lit + if (shadowMapPos.z < 0.0 || shadowMapPos.z > 1.0) +@@ -86,13 +86,19 @@ float _SGX_ShadowPoisson9(sampler2DShadow shadowMap, vec4 shadowMapPos, vec2 inv + // driver hack. + // shadow += shadow2D(shadowMap, newUV.xyz).r; + float d = shadow2D(shadowMap, newUV.xyz).r; +- float minShadowFactor = 0.2; +- shadow += (step(shadowMapPos.z, d) >= 1.0) ? 1.0 : minShadowFactor; ++ if (hardwarePCF) ++ shadow += d; ++ else ++ shadow += step(shadowMapPos.z, d); + } + shadow /= 9.0; + + // smoothstep makes shadow edges appear more crisp and hides Mach bands +- return smoothstep(0.0, 1.0, shadow); ++ float s = smoothstep(0.0, 1.0, shadow); ++ // make shadow lighter color ++ float minShadowFactor = 0.2; ++ s = s * (1.0 - minShadowFactor) + minShadowFactor; ++ return s; + } + + //----------------------------------------------------------------------------- +@@ -109,19 +115,25 @@ void SGX_ComputeShadowFactor_PSSM3(in float fDepth, + in vec4 invShadowMapSize2, + out float oShadowFactor) + { ++ // hack! On OSX the shadow size is halved so we use this as a hint to ++ // turn off hardware PCF. ++ bool hardwarePCF = false; ++ if (invShadowMapSize0.x == invShadowMapSize1.x) ++ hardwarePCF = true; ++ + if (fDepth <= vSplitPoints.x) + { + oShadowFactor = +- _SGX_ShadowPoisson9(shadowMap0, lightPosition0, invShadowMapSize0.xy); ++ _SGX_ShadowPoisson9(shadowMap0, lightPosition0, invShadowMapSize0.xy, hardwarePCF); + } + else if (fDepth <= vSplitPoints.y) + { + oShadowFactor = +- _SGX_ShadowPoisson9(shadowMap1, lightPosition1, invShadowMapSize1.xy); ++ _SGX_ShadowPoisson9(shadowMap1, lightPosition1, invShadowMapSize1.xy, hardwarePCF); + } + else + { + oShadowFactor = +- _SGX_ShadowPoisson9(shadowMap2, lightPosition2, invShadowMapSize2.xy); ++ _SGX_ShadowPoisson9(shadowMap2, lightPosition2, invShadowMapSize2.xy, hardwarePCF); + } + } diff --git a/meta-ros-common/recipes-devtools/gazebo/gazebo11_11.14.0.bb b/meta-ros-common/recipes-devtools/gazebo/gazebo11_11.14.0.bb new file mode 100644 index 00000000000..4a61a54488e --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/gazebo11_11.14.0.bb @@ -0,0 +1,80 @@ +# Recipe created by recipetool +# This is the basis of a recipe and may need further editing in order to be fully functional. +# (Feel free to remove these comments when editing.) + +# WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is +# your responsibility to verify that the values are complete and correct. +# +# The following license files were not able to be identified and are +# represented as "Unknown" below, you will need to check them yourself: +# LICENSE +# deps/opende/GIMPACT/GIMPACT-LICENSE-BSD.TXT +# deps/opende/GIMPACT/GIMPACT-LICENSE-LGPL.TXT +# deps/opende/LICENSE-BSD.TXT +# gazebo/rendering/skyx/License.txt +# media/gui/fonts/BITSTREAM-LICENSE +# +# NOTE: multiple licenses have been detected; they have been separated with & +# in the LICENSE value for now since it is a reasonable assumption that all +# of the licenses apply. If instead there is a choice between the multiple +# licenses then you should change the value to separate the licenses with | +# instead of &. If there is any doubt, check the accompanying documentation +# to determine which situation is applicable. +LICENSE = "Apache-2.0 & GPL-2.0-only & LGPL-2.1-only & LGPL-3.0-only & Unknown" +LIC_FILES_CHKSUM = "file://COPYING;md5=2a461be67a1edf991251f85f3aadd1d0 \ + file://LICENSE;md5=622f4fcdd9e66304dcb89897348be7b0 \ + file://cmake/GPL-2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://deps/ann/include/ann/LGPL;md5=e6a600fd5e1d9cbde2d983680233ad02 \ + file://deps/opende/GIMPACT/GIMPACT-LICENSE-BSD.TXT;md5=8b8d3fd534c235edacef40718034070c \ + file://deps/opende/GIMPACT/GIMPACT-LICENSE-LGPL.TXT;md5=b6606274a9090b4293304cdf242059bb \ + file://deps/opende/LICENSE-BSD.TXT;md5=c74e6304a772117e059458fb9763a928 \ + file://gazebo/gui/qgv/LICENSE.txt;md5=4fbd65380cdd255951079008b364516c \ + file://gazebo/rendering/skyx/License.txt;md5=ff710947873a98e70722effe719e2d48 \ + file://media/gui/fonts/BITSTREAM-LICENSE;md5=11308e907cc211412cb9543184b1e623" + +SRC_URI = "git://github.com/gazebosim/gazebo-classic.git;protocol=https;branch=gazebo11" + +# Modify these as desired +PV = "11.14.0" +SRCREV = "9b72949304e409d5f33150e87e6b348c54b5c015" + +S = "${WORKDIR}/git" + +inherit cmake pkgconfig +inherit ${@bb.utils.contains_any('ROS_WORLD_SKIP_GROUPS', ['qt5', 'pyqt5'], '', 'cmake_qt5', d)} + +# CMake Error: TRY_RUN() invoked in cross-compiling mode, please set the following cache variables appropriately: +# FREEIMAGE_RUNS (advanced) +# FREEIMAGE_RUNS__TRYRUN_OUTPUT (advanced) +EXTRA_OECMAKE += " -DFREEIMAGE_RUNS=1 -DFREEIMAGE_RUNS__TRYRUN_OUTPUT=0" +EXTRA_OECMAKE += " -DUSE_HOST_CFLAGS=FALSE" +EXTRA_OECMAKE += " -DGAZEBOMSGS_OUT_EXECUTABLE=${STAGING_DIR_NATIVE}/usr/bin/gazebomsgs_out" + +DEPENDS += " \ + bullet \ + doxygen-native \ + freeimage \ + gazebomsgsout-native \ + gts \ + hdf5-native \ + ignition-common3 \ + ignition-fuel-tools4 \ + ignition-math6 \ + ignition-msgs5 \ + ignition-transport8 \ + libtar \ + libtinyxml2 \ + libusb1 \ + ogre \ + protobuf \ + protobuf-c-native \ + qwt-qt5 \ + sdformat9 \ + tbb \ +" + +FILES:${PN} += " \ + ${datadir}/gazebo-11 \ + ${datadir}/gazebo \ + ${libdir}/gazebo-11 \ +" From 403970d6c16f0bd1d56237e0c570899d0e842ca1 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 11:36:38 -0700 Subject: [PATCH 44/60] {common} WIP: New recipes for Ignition / Gazebo These are a work-in-progress to get feedback from the community. Signed-off-by: Rob Woolley --- .../gazebo/ignition-cmake2_2.17.1.bb | 23 + .../cleanup-long-deprecated-ifdefs.patch | 854 ++++++++++++++++++ .../gazebo/ignition-common3/have_libdl.patch | 16 + .../gazebo/ignition-common3_3.17.0.bb | 42 + .../cleanup-long-deprecated-ifdefs.patch | 851 +++++++++++++++++ .../gazebo/ignition-common4/have_libdl.patch | 16 + .../gazebo/ignition-common4_2.17.1.bb | 41 + .../gazebo/ignition-fortress_1.0.3.bb | 43 + .../gazebo/ignition-fuel-tools4_4.9.1.bb | 33 + .../gazebo/ignition-fuel-tools7_2.17.1.bb | 32 + .../gazebo/ignition-gazebo6_6.15.0.bb | 35 + .../gazebo/ignition-gui6_6.8.0.bb | 44 + .../gazebo/ignition-launch5_5.3.0.bb | 41 + .../gazebo/ignition-math6_6.15.0.bb | 29 + .../gazebo/ignition-msgs5-native_5.11.0.bb | 6 + .../gazebo/ignition-msgs5.inc | 12 + .../gazebo/ignition-msgs5_5.11.0.bb | 12 + .../gazebo/ignition-msgs8-native_8.7.0.bb | 6 + .../gazebo/ignition-msgs8.inc | 13 + .../gazebo/ignition-msgs8_8.7.0.bb | 12 + .../gazebo/ignition-physics5_5.0.0.bb | 23 + .../gazebo/ignition-plugin1_1.4.0.bb | 24 + .../freeimage_optional.patch | 32 + .../gazebo/ignition-rendering6_6.6.1.bb | 53 ++ .../gazebo/ignition-sensors6_6.0.0.bb | 22 + .../backward-ros-include-dir.patch | 10 + .../gazebo/ignition-tools1_15.0.bb | 39 + .../gazebo/ignition-transport11_11.4.1.bb | 38 + .../gazebo/ignition-transport8_8.5.0.bb | 37 + .../gazebo/ignition-utils1_1.5.1.bb | 20 + 30 files changed, 2459 insertions(+) create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-cmake2_2.17.1.bb create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-common3/cleanup-long-deprecated-ifdefs.patch create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-common3/have_libdl.patch create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-common3_3.17.0.bb create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-common4/cleanup-long-deprecated-ifdefs.patch create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-common4/have_libdl.patch create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-common4_2.17.1.bb create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-fortress_1.0.3.bb create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-fuel-tools4_4.9.1.bb create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-fuel-tools7_2.17.1.bb create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-gazebo6_6.15.0.bb create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-gui6_6.8.0.bb create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-launch5_5.3.0.bb create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-math6_6.15.0.bb create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-msgs5-native_5.11.0.bb create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-msgs5.inc create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-msgs5_5.11.0.bb create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-msgs8-native_8.7.0.bb create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-msgs8.inc create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-msgs8_8.7.0.bb create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-physics5_5.0.0.bb create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-plugin1_1.4.0.bb create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-rendering6/freeimage_optional.patch create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-rendering6_6.6.1.bb create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-sensors6_6.0.0.bb create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-tools1/backward-ros-include-dir.patch create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-tools1_15.0.bb create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-transport11_11.4.1.bb create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-transport8_8.5.0.bb create mode 100644 meta-ros-common/recipes-devtools/gazebo/ignition-utils1_1.5.1.bb diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-cmake2_2.17.1.bb b/meta-ros-common/recipes-devtools/gazebo/ignition-cmake2_2.17.1.bb new file mode 100644 index 00000000000..09927acb0e9 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-cmake2_2.17.1.bb @@ -0,0 +1,23 @@ +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=2a461be67a1edf991251f85f3aadd1d0" + +SRC_URI = "git://github.com/gazebosim/gz-cmake.git;protocol=https;branch=ign-cmake2" + +SRCREV = "7e694a02c412d4595d92cb3351a5f7b6e0b44b0d" + +S = "${WORKDIR}/git" + +FILES:${PN} += "${datadir}/ignition/ignition-cmake2/*" +inherit cmake + +# Specify any options you want to pass to cmake using EXTRA_OECMAKE: +EXTRA_OECMAKE = "" + +FILES:${PN}-dev += " \ + pkgconfig/ignition-cmake2.pc \ + ${includedir} \ + ${datadir}/cmake/ignition-cmake2/cmake2/ \ + ${datadir}/ignition/ignition-cmake2/ \ +" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-common3/cleanup-long-deprecated-ifdefs.patch b/meta-ros-common/recipes-devtools/gazebo/ignition-common3/cleanup-long-deprecated-ifdefs.patch new file mode 100644 index 00000000000..3cc316d1121 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-common3/cleanup-long-deprecated-ifdefs.patch @@ -0,0 +1,854 @@ +# https://github.com/gazebosim/gz-common/commit/870eaf029e43ec52d34e0dd026d78fbb961a5f77.patch +From 870eaf029e43ec52d34e0dd026d78fbb961a5f77 Mon Sep 17 00:00:00 2001 +From: Michael Carroll +Date: Wed, 31 Aug 2022 13:13:24 -0500 +Subject: [PATCH] Cleanup long-deprecated ifdefs (#329) + +Signed-off-by: Michael Carroll + +Co-authored-by: Louise Poubel +--- + CMakeLists.txt | 1 + + av/include/gz/common/ffmpeg_inc.hh | 60 +++++++++- + av/src/AudioDecoder.cc | 97 ++-------------- + av/src/Video.cc | 58 ++++++---- + av/src/VideoEncoder.cc | 175 ++++++----------------------- + av/src/ffmpeg_inc.cc | 25 ----- + 6 files changed, 135 insertions(+), 281 deletions(-) + +Index: git/CMakeLists.txt +=================================================================== +--- git.orig/CMakeLists.txt ++++ git/CMakeLists.txt +@@ -93,6 +93,7 @@ ign_find_package(SWSCALE REQUIRED_BY av + #------------------------------------ + # Find avdevice + ign_find_package(AVDEVICE VERSION 56.4.100 REQUIRED_BY av PRETTY libavdevice) ++set(HAVE_AVDEVICE ${AVDEVICE_FOUND}) + + #------------------------------------ + # Find avformat +Index: git/av/include/gz/common/ffmpeg_inc.hh +=================================================================== +--- git.orig/av/include/gz/common/ffmpeg_inc.hh ++++ git/av/include/gz/common/ffmpeg_inc.hh +@@ -17,6 +17,60 @@ + #ifndef GZ_COMMON_FFMPEG_INC_HH_ + #define GZ_COMMON_FFMPEG_INC_HH_ + ++/// Versions of FFMPEG on Gazebo supported platforms ++// v4.2.7 (Ubuntu Focal) ++// libavutil 56. 31.100 / 56. 31.100 ++// libavcodec 58. 54.100 / 58. 54.100 ++// libavformat 58. 29.100 / 58. 29.100 ++// libavdevice 58. 8.100 / 58. 8.100 ++// libavfilter 7. 57.100 / 7. 57.100 ++// libavresample 4. 0. 0 / 4. 0. 0 ++// libswscale 5. 5.100 / 5. 5.100 ++// libswresample 3. 5.100 / 3. 5.100 ++// libpostproc 55. 5.100 / 55. 5.100 ++ ++// v4.4.1 (Windows CI vcpkg) ++// libavutil 56. 70.100 / 56. 70.100 ++// libavcodec 58.134.100 / 58.134.100 ++// libavformat 58. 76.100 / 58. 76.100 ++// libavdevice 58. 13.100 / 58. 13.100 ++// libavfilter 7.110.100 / 7.110.100 ++// libswscale 5. 9.100 / 5. 9.100 ++// libswresample 3. 9.100 / 3. 9.100 ++// libpostproc 55. 9.100 / 55. 9.100 ++ ++// v4.4.2 (Ubuntu Jammy) ++// libavutil 56. 70.100 / 56. 70.100 ++// libavcodec 58.134.100 / 58.134.100 ++// libavformat 58. 76.100 / 58. 76.100 ++// libavdevice 58. 13.100 / 58. 13.100 ++// libavfilter 7.110.100 / 7.110.100 ++// libswscale 5. 9.100 / 5. 9.100 ++// libswresample 3. 9.100 / 3. 9.100 ++// libpostproc 55. 9.100 / 55. 9.100 ++ ++// v5.1 (homebrew) ++// libavutil 57. 28.100 / 57. 28.100 ++// libavcodec 59. 37.100 / 59. 37.100 ++// libavformat 59. 27.100 / 59. 27.100 ++// libavdevice 59. 7.100 / 59. 7.100 ++// libavfilter 8. 44.100 / 8. 44.100 ++// libswscale 6. 7.100 / 6. 7.100 ++// libswresample 4. 7.100 / 4. 7.100 ++// libpostproc 56. 6.100 / 56. 6.100 ++ ++/// Additional versions of FFMPEG not officially supported ++// v5.0.1 (conda-forge) ++// libavutil 57. 17.100 / 57. 17.100 ++// libavcodec 59. 18.100 / 59. 18.100 ++// libavformat 59. 16.100 / 59. 16.100 ++// libavdevice 59. 4.100 / 59. 4.100 ++// libavfilter 8. 24.100 / 8. 24.100 ++// libswscale 6. 4.100 / 6. 4.100 ++// libswresample 4. 3.100 / 4. 3.100 ++// libpostproc 56. 3.100 / 56. 3.100 ++ ++ + #include + + #include +@@ -44,7 +98,7 @@ extern "C" { + #include + #include + +-#if defined(__linux__) && defined(HAVE_AVDEVICE) ++#if defined(HAVE_AVDEVICE) + #include + #endif + } +@@ -57,15 +111,18 @@ namespace ignition + { + /// \brief Helper function to avoid deprecation warnings. + IGNITION_COMMON_AV_VISIBLE ++ IGN_DEPRECATED(5) + AVFrame *AVFrameAlloc(void); + + /// \brief Helper function to avoid deprecation warnings. + IGNITION_COMMON_AV_VISIBLE ++ IGN_DEPRECATED(5) + void AVFrameUnref(AVFrame *_frame); + + /// \brief Helper function to avoid deprecation warnings. + /// \param[in] _packet AVPacket structure that stores compressed data + IGNITION_COMMON_AV_VISIBLE ++ IGN_DEPRECATED(5) + void AVPacketUnref(AVPacket *_packet); + + /// \brief Helper function to avoid deprecation warnings +@@ -80,6 +137,7 @@ namespace ignition + /// \note If the codec is in draining mode, _packet can be null. The return + /// value on success will then be 0, but _gotFrame will be non-zero. + IGNITION_COMMON_AV_VISIBLE ++ IGN_DEPRECATED(5) + int AVCodecDecode(AVCodecContext *_codecCtx, + AVFrame *_frame, int *_gotFrame, AVPacket *_packet); + +Index: git/av/src/AudioDecoder.cc +=================================================================== +--- git.orig/av/src/AudioDecoder.cc ++++ git/av/src/AudioDecoder.cc +@@ -35,7 +35,7 @@ class gz::common::AudioDecoderPrivate + public: AVCodecContext *codecCtx; + + /// \brief libavcodec audio codec. +- public: const AVCodec *codec; ++ public: const AVCodec *codec {nullptr}; + + /// \brief Index of the audio stream. + public: int audioStream; +@@ -77,12 +77,7 @@ void AudioDecoder::Cleanup() + ///////////////////////////////////////////////// + bool AudioDecoder::Decode(uint8_t **_outBuffer, unsigned int *_outBufferSize) + { +-#if LIBAVFORMAT_VERSION_MAJOR < 59 +- AVPacket *packet, packet1; +- int bytesDecoded = 0; +-#else + AVPacket *packet; +-#endif + unsigned int maxBufferSize = 0; + AVFrame *decodedFrame = nullptr; + +@@ -108,7 +103,7 @@ bool AudioDecoder::Decode(uint8_t **_out + + bool result = true; + +- if (!(decodedFrame = AVFrameAlloc())) ++ if (!(decodedFrame = av_frame_alloc())) + { + ignerr << "Audio decoder out of memory\n"; + result = false; +@@ -125,7 +120,6 @@ bool AudioDecoder::Decode(uint8_t **_out + { + if (packet->stream_index == this->data->audioStream) + { +-#if LIBAVFORMAT_VERSION_MAJOR >= 59 + // Inspired from + // https://github.com/FFmpeg/FFmpeg/blob/n5.0/doc/examples/decode_audio.c#L71 + +@@ -152,12 +146,18 @@ bool AudioDecoder::Decode(uint8_t **_out + return false; + } + ++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59, 24, 100) ++ int numChannels = this->data->codecCtx->ch_layout.nb_channels; ++#else ++ int numChannels = this->data->codecCtx->channels; ++#endif ++ + // Total size of the data. Some padding can be added to + // decodedFrame->data[0], which is why we can't use + // decodedFrame->linesize[0]. + int size = decodedFrame->nb_samples * + av_get_bytes_per_sample(this->data->codecCtx->sample_fmt) * +- this->data->codecCtx->ch_layout.nb_channels; ++ numChannels; + // Resize the audio buffer as necessary + if (*_outBufferSize + size > maxBufferSize) + { +@@ -170,50 +170,6 @@ bool AudioDecoder::Decode(uint8_t **_out + size); + *_outBufferSize += size; + } +-#else +- int gotFrame = 0; +- +- packet1 = *packet; +- while (packet1.size) +- { +- // Some frames rely on multiple packets, so we have to make sure +- // the frame is finished before we can use it +-#ifndef _WIN32 +-# pragma GCC diagnostic push +-# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +-#endif +- bytesDecoded = avcodec_decode_audio4(this->data->codecCtx, decodedFrame, +- &gotFrame, &packet1); +-#ifndef _WIN32 +-# pragma GCC diagnostic pop +-#endif +- +- if (gotFrame) +- { +- // Total size of the data. Some padding can be added to +- // decodedFrame->data[0], which is why we can't use +- // decodedFrame->linesize[0]. +- int size = decodedFrame->nb_samples * +- av_get_bytes_per_sample(this->data->codecCtx->sample_fmt) * +- this->data->codecCtx->channels; +- +- // Resize the audio buffer as necessary +- if (*_outBufferSize + size > maxBufferSize) +- { +- maxBufferSize += size * 5; +- *_outBuffer = reinterpret_cast(realloc(*_outBuffer, +- maxBufferSize * sizeof(*_outBuffer[0]))); +- } +- +- memcpy(*_outBuffer + *_outBufferSize, decodedFrame->data[0], +- size); +- *_outBufferSize += size; +- } +- +- packet1.data += bytesDecoded; +- packet1.size -= bytesDecoded; +- } +-#endif + } + av_packet_unref(packet); + } +@@ -271,20 +227,8 @@ bool AudioDecoder::SetFile(const std::st + this->data->audioStream = -1; + for (i = 0; i < this->data->formatCtx->nb_streams; ++i) + { +-#ifndef _WIN32 +-# pragma GCC diagnostic push +-# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +-#endif +-#if LIBAVFORMAT_VERSION_MAJOR >= 59 + if (this->data->formatCtx->streams[i]->codecpar->codec_type == // NOLINT(*) + AVMEDIA_TYPE_AUDIO) +-#else +- if (this->data->formatCtx->streams[i]->codec->codec_type == // NOLINT(*) +- AVMEDIA_TYPE_AUDIO) +-#endif +-#ifndef _WIN32 +-# pragma GCC diagnostic pop +-#endif + { + this->data->audioStream = i; + break; +@@ -300,21 +244,7 @@ bool AudioDecoder::SetFile(const std::st + return false; + } + +- // Get the audio stream codec +-#ifndef _WIN32 +-# pragma GCC diagnostic push +-# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +-#endif +-#if LIBAVFORMAT_VERSION_MAJOR < 59 +- this->data->codecCtx = this->data->formatCtx->streams[ +- this->data->audioStream]->codec; +-#endif +-#ifndef _WIN32 +-# pragma GCC diagnostic pop +-#endif +- + // Find a decoder +-#if LIBAVFORMAT_VERSION_MAJOR >= 59 + this->data->codec = avcodec_find_decoder(this->data->formatCtx->streams[ + this->data->audioStream]->codecpar->codec_id); + if (!this->data->codec) +@@ -331,9 +261,6 @@ bool AudioDecoder::SetFile(const std::st + // Copy all relevant parameters from codepar to codecCtx + avcodec_parameters_to_context(this->data->codecCtx, + this->data->formatCtx->streams[this->data->audioStream]->codecpar); +-#else +- this->data->codec = avcodec_find_decoder(this->data->codecCtx->codec_id); +-#endif + + if (this->data->codec == nullptr) + { +@@ -344,15 +271,8 @@ bool AudioDecoder::SetFile(const std::st + return false; + } + +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(56, 60, 100) +-#if LIBAVCODEC_VERSION_MAJOR < 60 + if (this->data->codec->capabilities & AV_CODEC_CAP_TRUNCATED) + this->data->codecCtx->flags |= AV_CODEC_FLAG_TRUNCATED; +-#endif +-#else +- if (this->data->codec->capabilities & CODEC_CAP_TRUNCATED) +- this->data->codecCtx->flags |= CODEC_FLAG_TRUNCATED; +-#endif + + // Open codec + if (avcodec_open2(this->data->codecCtx, this->data->codec, nullptr) < 0) +Index: git/av/src/Video.cc +=================================================================== +--- git.orig/av/src/Video.cc ++++ git/av/src/Video.cc +@@ -59,6 +59,37 @@ class gz::common::VideoPrivate + public: bool drainingMode = false; + }; + ++int AVCodecDecode(AVCodecContext *_codecCtx, ++ AVFrame *_frame, int *_gotFrame, AVPacket *_packet) ++{ ++ // from https://blogs.gentoo.org/lu_zero/2016/03/29/new-avcodec-api/ ++ int ret; ++ ++ *_gotFrame = 0; ++ ++ if (_packet) ++ { ++ ret = avcodec_send_packet(_codecCtx, _packet); ++ if (ret < 0) ++ { ++ return ret == AVERROR_EOF ? 0 : ret; ++ } ++ } ++ ++ ret = avcodec_receive_frame(_codecCtx, _frame); ++ if (ret < 0 && ret != AVERROR(EAGAIN)) ++ { ++ return ret; ++ } ++ if (ret >= 0) ++ { ++ *_gotFrame = 1; ++ } ++ ++ // new API always consumes the whole packet ++ return _packet ? _packet->size : 0; ++} ++ + ///////////////////////////////////////////////// + Video::Video() + : dataPtr(new VideoPrivate) +@@ -100,7 +131,7 @@ bool Video::Load(const std::string &_fil + this->Cleanup(); + } + +- this->dataPtr->avFrame = AVFrameAlloc(); ++ this->dataPtr->avFrame = av_frame_alloc(); + + // Open video file + if (avformat_open_input(&this->dataPtr->formatCtx, _filename.c_str(), +@@ -121,13 +152,7 @@ bool Video::Load(const std::string &_fil + for (unsigned int i = 0; i < this->dataPtr->formatCtx->nb_streams; ++i) + { + enum AVMediaType codec_type; +- // codec parameter deprecated in ffmpeg version 3.1 +- // github.com/FFmpeg/FFmpeg/commit/9200514ad8717c +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101) + codec_type = this->dataPtr->formatCtx->streams[i]->codecpar->codec_type; +-#else +- codec_type = this->dataPtr->formatCtx->streams[i]->codec->codec_type; +-#endif + if (codec_type == AVMEDIA_TYPE_VIDEO) + { + this->dataPtr->videoStream = static_cast(i); +@@ -143,18 +168,13 @@ bool Video::Load(const std::string &_fil + + // Find the decoder for the video stream + auto stream = this->dataPtr->formatCtx->streams[this->dataPtr->videoStream]; +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101) + codec = avcodec_find_decoder(stream->codecpar->codec_id); +-#else +- codec = avcodec_find_decoder(stream->codec->codec_id); +-#endif + if (codec == nullptr) + { + ignerr << "Codec not found\n"; + return false; + } + +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101) + // AVCodecContext is not included in an AVStream as of ffmpeg 3.1 + // allocate a codec context based on updated example + // github.com/FFmpeg/FFmpeg/commit/bba6a03b2816d805d44bce4f9701a71f7d3f8dad +@@ -173,23 +193,11 @@ bool Video::Load(const std::string &_fil + << std::endl; + return false; + } +-#else +- // Get a pointer to the codec context for the video stream +- this->dataPtr->codecCtx = this->dataPtr->formatCtx->streams[ +- this->dataPtr->videoStream]->codec; +-#endif + + // Inform the codec that we can handle truncated bitstreams -- i.e., + // bitstreams where frame boundaries can fall in the middle of packets +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(56, 60, 100) +-#if LIBAVCODEC_VERSION_MAJOR < 60 + if (codec->capabilities & AV_CODEC_CAP_TRUNCATED) + this->dataPtr->codecCtx->flags |= AV_CODEC_FLAG_TRUNCATED; +-#endif +-#else +- if (codec->capabilities & CODEC_CAP_TRUNCATED) +- this->dataPtr->codecCtx->flags |= CODEC_FLAG_TRUNCATED; +-#endif + + // Open codec + if (avcodec_open2(this->dataPtr->codecCtx, codec, nullptr) < 0) +@@ -214,7 +222,7 @@ bool Video::Load(const std::string &_fil + } + + // swscale needs 32-byte-aligned output frame on some systems +- this->dataPtr->avFrameDst = AVFrameAlloc(); ++ this->dataPtr->avFrameDst = av_frame_alloc(); + this->dataPtr->avFrameDst->format = this->dataPtr->dstPixelFormat; + this->dataPtr->avFrameDst->width = this->dataPtr->codecCtx->width; + this->dataPtr->avFrameDst->height = this->dataPtr->codecCtx->height; +@@ -293,7 +301,7 @@ bool Video::NextFrame(unsigned char **_b + } + + // Process all the data in the frame +- ret = AVCodecDecode( ++ ret = ::AVCodecDecode( + this->dataPtr->codecCtx, this->dataPtr->avFrame, &frameAvailable, + this->dataPtr->drainingMode ? nullptr : packet); + +Index: git/av/src/VideoEncoder.cc +=================================================================== +--- git.orig/av/src/VideoEncoder.cc ++++ git/av/src/VideoEncoder.cc +@@ -14,6 +14,7 @@ + * limitations under the License. + * + */ ++ + #include + + #include +@@ -32,6 +33,14 @@ using namespace ignition; + using namespace common; + using namespace std; + ++// After AVDevice 59.0.100, const pointers are used. ++#if LIBAVDEVICE_VERSION_INT >= AV_VERSION_INT(59, 0, 100) ++using OutputFormat = const AVOutputFormat*; ++#else ++using OutputFormat = AVOutputFormat*; ++#endif ++ ++ + // Private data class + // hidden visibility specifier has to be explicitly set to silent a gcc warning + class IGNITION_COMMON_AV_HIDDEN common::VideoEncoderPrivate +@@ -53,11 +62,7 @@ class IGNITION_COMMON_AV_HIDDEN common:: + public: AVFrame *avOutFrame = nullptr; + + /// \brief libav input image data (aligned to 32 bytes) +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 24, 1) +- public: AVPicture *avInFrame = nullptr; +-#else + public: AVFrame *avInFrame = nullptr; +-#endif + + /// \brief Pixel format of the input frame. So far it is hardcoded. + public: AVPixelFormat inPixFormat = AV_PIX_FMT_RGB24; +@@ -340,34 +345,37 @@ bool VideoEncoder::Start( + // Special case for video4linux2. Here we attempt to find the v4l2 device + if (this->dataPtr->format.compare("v4l2") == 0) + { +-#if LIBAVDEVICE_VERSION_INT >= AV_VERSION_INT(56, 4, 100) +- AVOutputFormat *outputFormat = nullptr; +- while ((outputFormat = av_output_video_device_next(outputFormat)) +- != nullptr) +- { +- // Break when the output device name matches 'v4l2' +- if (this->dataPtr->format.compare(outputFormat->name) == 0) ++#if defined(HAVE_AVDEVICE) ++ OutputFormat outputFormat = nullptr; ++ do ++ { ++ outputFormat = av_output_video_device_next(outputFormat); ++ ++ if (outputFormat) + { +- // Allocate the context using the correct outputFormat +- auto result = avformat_alloc_output_context2(&this->dataPtr->formatCtx, +- outputFormat, nullptr, this->dataPtr->filename.c_str()); +- if (result < 0) ++ // Break when the output device name matches 'v4l2' ++ if (this->dataPtr->format.compare(outputFormat->name) == 0) + { +- ignerr << "Failed to allocate AV context [" << av_err2str_cpp(result) +- << "]" << std::endl; ++ // Allocate the context using the correct outputFormat ++ auto result = avformat_alloc_output_context2(&this->dataPtr->formatCtx, ++ outputFormat, nullptr, this->dataPtr->filename.c_str()); ++ if (result < 0) ++ { ++ ignerr << "Failed to allocate AV context [" << av_err2str_cpp(result) ++ << "]" << std::endl; ++ } ++ break; + } +- break; + } + } +-#else +- ignerr << "libavdevice version >= 56.4.100 is required for v4l2 recording. " +- << "This version is available on Ubuntu Xenial or greater.\n"; +- return false; ++ while (outputFormat); ++ ++ + #endif + } + else + { +- const AVOutputFormat *outputFormat = av_guess_format(nullptr, ++ auto* outputFormat = av_guess_format(nullptr, + this->dataPtr->filename.c_str(), nullptr); + + if (!outputFormat) +@@ -376,28 +384,6 @@ bool VideoEncoder::Start( + << "Using MPEG.\n"; + } + +-#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(56, 40, 1) +- this->dataPtr->formatCtx = avformat_alloc_context(); +- if (outputFormat) +- { +- this->dataPtr->formatCtx->oformat = outputFormat; +- } +- else +- { +- this->dataPtr->formatCtx->oformat = +- av_guess_format("mpeg", nullptr, nullptr); +- } +-#ifdef WIN32 +- _sprintf(this->dataPtr->formatCtx->filename, +- sizeof(this->dataPtr->formatCtx->filename), +- "%s", _filename.c_str()); +-#else +- snprintf(this->dataPtr->formatCtx->filename, +- sizeof(this->dataPtr->formatCtx->filename), +- "%s", _filename.c_str()); +-#endif +- +-#else + auto result = avformat_alloc_output_context2(&this->dataPtr->formatCtx, + nullptr, nullptr, this->dataPtr->filename.c_str()); + if (result < 0) +@@ -405,7 +391,6 @@ bool VideoEncoder::Start( + ignerr << "Failed to allocate AV context [" << av_err2str_cpp(result) + << "]" << std::endl; + } +-#endif + } + + // Make sure allocation occurred. +@@ -428,11 +413,7 @@ bool VideoEncoder::Start( + if (!encoder) + { + ignerr << "Codec for[" +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 24, 1) +- << this->dataPtr->formatCtx->oformat->name +-#else + << avcodec_get_name(codecId) +-#endif + << "] not found. Video encoding is not started.\n"; + this->Reset(); + return false; +@@ -441,13 +422,8 @@ bool VideoEncoder::Start( + ignmsg << "Using encoder " << encoder->name << std::endl; + + // Create a new video stream +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 24, 1) +- this->dataPtr->videoStream = avformat_new_stream(this->dataPtr->formatCtx, +- encoder); +-#else + this->dataPtr->videoStream = avformat_new_stream(this->dataPtr->formatCtx, + nullptr); +-#endif + + if (!this->dataPtr->videoStream) + { +@@ -458,11 +434,7 @@ bool VideoEncoder::Start( + this->dataPtr->videoStream->id = this->dataPtr->formatCtx->nb_streams-1; + + // Allocate a new video context +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 24, 1) +- this->dataPtr->codecCtx = this->dataPtr->videoStream->codec; +-#else + this->dataPtr->codecCtx = avcodec_alloc_context3(encoder); +-#endif + + if (!this->dataPtr->codecCtx) + { +@@ -475,11 +447,7 @@ bool VideoEncoder::Start( + // some formats want stream headers to be separate + if (this->dataPtr->formatCtx->oformat->flags & AVFMT_GLOBALHEADER) + { +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 24, 1) +- this->dataPtr->codecCtx->flags |= CODEC_FLAG_GLOBAL_HEADER; +-#else + this->dataPtr->codecCtx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; +-#endif + } + + // Frames per second +@@ -517,13 +485,7 @@ bool VideoEncoder::Start( + if (this->dataPtr->codecCtx->codec_id == AV_CODEC_ID_H264) + { + av_opt_set(this->dataPtr->codecCtx->priv_data, "preset", "slow", 0); +- +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 24, 1) +- av_opt_set(this->dataPtr->videoStream->codec->priv_data, +- "preset", "slow", 0); +-#else + av_opt_set(this->dataPtr->videoStream->priv_data, "preset", "slow", 0); +-#endif + } + + // we misuse this field a bit, as docs say it is unused in encoders +@@ -560,11 +522,7 @@ bool VideoEncoder::Start( + return false; + } + +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55, 28, 1) +- this->dataPtr->avOutFrame = avcodec_alloc_frame(); +-#else + this->dataPtr->avOutFrame = av_frame_alloc(); +-#endif + + if (!this->dataPtr->avOutFrame) + { +@@ -589,14 +547,9 @@ bool VideoEncoder::Start( + } + + // Copy parameters from the context to the video stream +-#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(57, 40, 101) +-// ret = avcodec_copy_context(this->dataPtr->videoStream->codec, +-// this->dataPtr->codecCtx); +-#else + // codecpar was implemented in ffmpeg version 3.1 + ret = avcodec_parameters_from_context( + this->dataPtr->videoStream->codecpar, this->dataPtr->codecCtx); +-#endif + if (ret < 0) + { + ignerr << "Could not copy the stream parameters:" << av_err2str_cpp(ret) +@@ -690,11 +643,7 @@ bool VideoEncoder::AddFrame(const unsign + this->dataPtr->swsCtx = nullptr; + + if (this->dataPtr->avInFrame) +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 24, 1) +- av_free(this->dataPtr->avInFrame); +-#else + av_frame_free(&this->dataPtr->avInFrame); +-#endif + this->dataPtr->avInFrame = nullptr; + } + +@@ -705,19 +654,12 @@ bool VideoEncoder::AddFrame(const unsign + + if (!this->dataPtr->avInFrame) + { +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 24, 1) +- this->dataPtr->avInFrame = new AVPicture; +- avpicture_alloc(this->dataPtr->avInFrame, +- this->dataPtr->inPixFormat, this->dataPtr->inWidth, +- this->dataPtr->inHeight); +-#else + this->dataPtr->avInFrame = av_frame_alloc(); + this->dataPtr->avInFrame->width = this->dataPtr->inWidth; + this->dataPtr->avInFrame->height = this->dataPtr->inHeight; + this->dataPtr->avInFrame->format = this->dataPtr->inPixFormat; + + av_frame_get_buffer(this->dataPtr->avInFrame, 32); +-#endif + } + + av_image_fill_linesizes(this->dataPtr->inputLineSizes, +@@ -779,24 +721,6 @@ bool VideoEncoder::AddFrame(const unsign + { + frameToEncode->pts = this->dataPtr->frameCount++; + +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 40, 101) +- int gotOutput = 0; +- AVPacket avPacket; +- av_init_packet(&avPacket); +- avPacket.data = nullptr; +- avPacket.size = 0; +- +- ret = avcodec_encode_video2(this->dataPtr->codecCtx, &avPacket, +- frameToEncode, &gotOutput); +- +- if (ret >= 0 && gotOutput == 1) +- ret = ProcessPacket(&avPacket); +- +- av_free_packet(&avPacket); +- +- // #else for libavcodec version check +-#else +- + AVPacket* avPacket = av_packet_alloc(); + + avPacket->data = nullptr; +@@ -817,7 +741,6 @@ bool VideoEncoder::AddFrame(const unsign + } + + av_packet_unref(avPacket); +-#endif + } + return ret >= 0 || ret == AVERROR(EAGAIN); + } +@@ -859,31 +782,6 @@ bool VideoEncoder::Stop() + // drain remaining packets from the encoder + if (this->dataPtr->encoding && this->dataPtr->codecCtx) + { +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 40, 101) +- if ((this->dataPtr->codecCtx->capabilities & AV_CODEC_CAP_DELAY) > 0) +- { +- int gotOutput = 1; +- int ret = 0; +- AVPacket avPacket; +- av_init_packet(&avPacket); +- avPacket.data = nullptr; +- avPacket.size = 0; +- +- while (ret >= 0 && gotOutput == 1) +- { +- ret = avcodec_encode_video2(this->dataPtr->codecCtx, &avPacket, +- nullptr, &gotOutput); +- +- if (ret >= 0 && gotOutput == 1) +- ret = ProcessPacket(&avPacket); +- } +- +- av_free_packet(&avPacket); +- } +- +-// #else for libavcodec version check +-#else +- + int ret = 0; + // enter drain state + ret = avcodec_send_frame(this->dataPtr->codecCtx, nullptr); +@@ -906,32 +804,21 @@ bool VideoEncoder::Stop() + } + av_packet_unref(avPacket); + } +-#endif + } + + if (this->dataPtr->encoding && this->dataPtr->formatCtx) + av_write_trailer(this->dataPtr->formatCtx); + +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 24, 1) + if (this->dataPtr->codecCtx) + avcodec_free_context(&this->dataPtr->codecCtx); +-#endif + this->dataPtr->codecCtx = nullptr; + + if (this->dataPtr->avInFrame) +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 24, 1) +- av_free(this->dataPtr->avInFrame); +-#else + av_frame_free(&this->dataPtr->avInFrame); +-#endif + this->dataPtr->avInFrame = nullptr; + + if (this->dataPtr->avOutFrame) +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 24, 1) +- av_free(this->dataPtr->avOutFrame); +-#else + av_frame_free(&this->dataPtr->avOutFrame); +-#endif + this->dataPtr->avOutFrame = nullptr; + + if (this->dataPtr->swsCtx) +Index: git/av/src/ffmpeg_inc.cc +=================================================================== +--- git.orig/av/src/ffmpeg_inc.cc ++++ git/av/src/ffmpeg_inc.cc +@@ -21,38 +21,25 @@ using namespace ignition; + ////////////////////////////////////////////////// + AVFrame *common::AVFrameAlloc(void) + { +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 28, 1) + return av_frame_alloc(); +-#else +- return avcodec_alloc_frame(); +-#endif + } + + ////////////////////////////////////////////////// + void common::AVFrameUnref(AVFrame *_frame) + { +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 28, 1) + av_frame_unref(_frame); +-#else +- avcodec_get_frame_defaults(_frame); +-#endif + } + + ////////////////////////////////////////////////// + void common::AVPacketUnref(AVPacket *_packet) + { +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 24, 102) + av_packet_unref(_packet); +-#else +- av_free_packet(_packet); +-#endif + } + + ////////////////////////////////////////////////// + int common::AVCodecDecode(AVCodecContext *_codecCtx, + AVFrame *_frame, int *_gotFrame, AVPacket *_packet) + { +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101) + // from https://blogs.gentoo.org/lu_zero/2016/03/29/new-avcodec-api/ + int ret; + +@@ -79,16 +66,4 @@ int common::AVCodecDecode(AVCodecContext + + // new API always consumes the whole packet + return _packet ? _packet->size : 0; +-#else +- // this was deprecated in ffmpeg version 3.1 +- // github.com/FFmpeg/FFmpeg/commit/7fc329e2dd6226dfecaa4a1d7adf353bf2773726 +-# ifndef _WIN32 +-# pragma GCC diagnostic push +-# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +-# endif +- return avcodec_decode_video2(_codecCtx, _frame, _gotFrame, _packet); +-# ifndef _WIN32 +-# pragma GCC diagnostic pop +-# endif +-#endif + } diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-common3/have_libdl.patch b/meta-ros-common/recipes-devtools/gazebo/ignition-common3/have_libdl.patch new file mode 100644 index 00000000000..1eca9e69565 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-common3/have_libdl.patch @@ -0,0 +1,16 @@ +Index: git/CMakeLists.txt +=================================================================== +--- git.orig/CMakeLists.txt ++++ git/CMakeLists.txt +@@ -69,11 +69,6 @@ else() + endif() + + #-------------------------------------- +-# Find libdl +-ign_find_package( +- DL REQUIRED PRIVATE PRETTY libdl PURPOSE "Required for plugins") +- +-#-------------------------------------- + # Find dependencies that we ignore for Visual Studio + if(NOT MSVC) + diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-common3_3.17.0.bb b/meta-ros-common/recipes-devtools/gazebo/ignition-common3_3.17.0.bb new file mode 100644 index 00000000000..59ea306b53a --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-common3_3.17.0.bb @@ -0,0 +1,42 @@ +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=2a461be67a1edf991251f85f3aadd1d0 \ + file://profiler/src/Remotery/LICENSE;md5=34400b68072d710fecd0a2940a0d1658" + +SRC_URI = "git://github.com/gazebosim/gz-common.git;protocol=https;branch=ign-common4 \ + file://have_libdl.patch \ + file://cleanup-long-deprecated-ifdefs.patch \ +" + +SRCREV = "41a6410c55f2d69737cc895c3e7cd1c8df065bfc" + +S = "${WORKDIR}/git" + +inherit cmake pkgconfig + +# CMake Error: TRY_RUN() invoked in cross-compiling mode, please set the following cache variables appropriately: +# FREEIMAGE_RUNS (advanced) +# FREEIMAGE_RUNS__TRYRUN_OUTPUT (advanced) +EXTRA_OECMAKE += " -DFREEIMAGE_RUNS=1 -DFREEIMAGE_RUNS__TRYRUN_OUTPUT=0" + +OECMAKE_GENERATOR = "Unix Makefiles" + +DEPENDS = " \ + cppcheck-native \ + doxygen-native \ + graphviz-native \ + gts \ + ffmpeg \ + freeimage \ + ignition-cmake2 \ + ignition-math6 \ + ignition-utils1 \ + libtinyxml2 \ + util-linux \ +" + +FILES:${PN} += " \ + ${datadir}/ignition/ignition-common3/profiler_vis/* \ + ${datadir}/ignition/ignition-common3/ignition-common3.tag.xml \ +" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-common4/cleanup-long-deprecated-ifdefs.patch b/meta-ros-common/recipes-devtools/gazebo/ignition-common4/cleanup-long-deprecated-ifdefs.patch new file mode 100644 index 00000000000..4f5001b950d --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-common4/cleanup-long-deprecated-ifdefs.patch @@ -0,0 +1,851 @@ +# https://github.com/gazebosim/gz-common/commit/870eaf029e43ec52d34e0dd026d78fbb961a5f77.patch +From 870eaf029e43ec52d34e0dd026d78fbb961a5f77 Mon Sep 17 00:00:00 2001 +From: Michael Carroll +Date: Wed, 31 Aug 2022 13:13:24 -0500 +Subject: [PATCH] Cleanup long-deprecated ifdefs (#329) + +Signed-off-by: Michael Carroll + +Co-authored-by: Louise Poubel +--- + CMakeLists.txt | 1 + + av/include/gz/common/ffmpeg_inc.hh | 60 +++++++++- + av/src/AudioDecoder.cc | 97 ++-------------- + av/src/Video.cc | 58 ++++++---- + av/src/VideoEncoder.cc | 175 ++++++----------------------- + av/src/ffmpeg_inc.cc | 25 ----- + 6 files changed, 135 insertions(+), 281 deletions(-) + +Index: git/CMakeLists.txt +=================================================================== +--- git.orig/CMakeLists.txt ++++ git/CMakeLists.txt +@@ -103,6 +103,7 @@ ign_find_package(SWSCALE REQUIRED_BY av + #------------------------------------ + # Find avdevice + ign_find_package(AVDEVICE VERSION 56.4.100 REQUIRED_BY av PRETTY libavdevice) ++set(HAVE_AVDEVICE ${AVDEVICE_FOUND}) + + #------------------------------------ + # Find avformat +Index: git/av/include/gz/common/ffmpeg_inc.hh +=================================================================== +--- git.orig/av/include/gz/common/ffmpeg_inc.hh ++++ git/av/include/gz/common/ffmpeg_inc.hh +@@ -17,6 +17,60 @@ + #ifndef GZ_COMMON_FFMPEG_INC_HH_ + #define GZ_COMMON_FFMPEG_INC_HH_ + ++/// Versions of FFMPEG on Gazebo supported platforms ++// v4.2.7 (Ubuntu Focal) ++// libavutil 56. 31.100 / 56. 31.100 ++// libavcodec 58. 54.100 / 58. 54.100 ++// libavformat 58. 29.100 / 58. 29.100 ++// libavdevice 58. 8.100 / 58. 8.100 ++// libavfilter 7. 57.100 / 7. 57.100 ++// libavresample 4. 0. 0 / 4. 0. 0 ++// libswscale 5. 5.100 / 5. 5.100 ++// libswresample 3. 5.100 / 3. 5.100 ++// libpostproc 55. 5.100 / 55. 5.100 ++ ++// v4.4.1 (Windows CI vcpkg) ++// libavutil 56. 70.100 / 56. 70.100 ++// libavcodec 58.134.100 / 58.134.100 ++// libavformat 58. 76.100 / 58. 76.100 ++// libavdevice 58. 13.100 / 58. 13.100 ++// libavfilter 7.110.100 / 7.110.100 ++// libswscale 5. 9.100 / 5. 9.100 ++// libswresample 3. 9.100 / 3. 9.100 ++// libpostproc 55. 9.100 / 55. 9.100 ++ ++// v4.4.2 (Ubuntu Jammy) ++// libavutil 56. 70.100 / 56. 70.100 ++// libavcodec 58.134.100 / 58.134.100 ++// libavformat 58. 76.100 / 58. 76.100 ++// libavdevice 58. 13.100 / 58. 13.100 ++// libavfilter 7.110.100 / 7.110.100 ++// libswscale 5. 9.100 / 5. 9.100 ++// libswresample 3. 9.100 / 3. 9.100 ++// libpostproc 55. 9.100 / 55. 9.100 ++ ++// v5.1 (homebrew) ++// libavutil 57. 28.100 / 57. 28.100 ++// libavcodec 59. 37.100 / 59. 37.100 ++// libavformat 59. 27.100 / 59. 27.100 ++// libavdevice 59. 7.100 / 59. 7.100 ++// libavfilter 8. 44.100 / 8. 44.100 ++// libswscale 6. 7.100 / 6. 7.100 ++// libswresample 4. 7.100 / 4. 7.100 ++// libpostproc 56. 6.100 / 56. 6.100 ++ ++/// Additional versions of FFMPEG not officially supported ++// v5.0.1 (conda-forge) ++// libavutil 57. 17.100 / 57. 17.100 ++// libavcodec 59. 18.100 / 59. 18.100 ++// libavformat 59. 16.100 / 59. 16.100 ++// libavdevice 59. 4.100 / 59. 4.100 ++// libavfilter 8. 24.100 / 8. 24.100 ++// libswscale 6. 4.100 / 6. 4.100 ++// libswresample 4. 3.100 / 4. 3.100 ++// libpostproc 56. 3.100 / 56. 3.100 ++ ++ + #include + + #include +@@ -44,7 +98,7 @@ extern "C" { + #include + #include + +-#if defined(__linux__) && defined(HAVE_AVDEVICE) ++#if defined(HAVE_AVDEVICE) + #include + #endif + } +@@ -57,15 +111,18 @@ namespace ignition + { + /// \brief Helper function to avoid deprecation warnings. + IGNITION_COMMON_AV_VISIBLE ++ IGN_DEPRECATED(5) + AVFrame *AVFrameAlloc(void); + + /// \brief Helper function to avoid deprecation warnings. + IGNITION_COMMON_AV_VISIBLE ++ IGN_DEPRECATED(5) + void AVFrameUnref(AVFrame *_frame); + + /// \brief Helper function to avoid deprecation warnings. + /// \param[in] _packet AVPacket structure that stores compressed data + IGNITION_COMMON_AV_VISIBLE ++ IGN_DEPRECATED(5) + void AVPacketUnref(AVPacket *_packet); + + /// \brief Helper function to avoid deprecation warnings +@@ -80,6 +137,7 @@ namespace ignition + /// \note If the codec is in draining mode, _packet can be null. The return + /// value on success will then be 0, but _gotFrame will be non-zero. + IGNITION_COMMON_AV_VISIBLE ++ IGN_DEPRECATED(5) + int AVCodecDecode(AVCodecContext *_codecCtx, + AVFrame *_frame, int *_gotFrame, AVPacket *_packet); + +Index: git/av/src/AudioDecoder.cc +=================================================================== +--- git.orig/av/src/AudioDecoder.cc ++++ git/av/src/AudioDecoder.cc +@@ -35,7 +35,7 @@ class common::AudioDecoderPrivate + public: AVCodecContext *codecCtx; + + /// \brief libavcodec audio codec. +- public: const AVCodec *codec; ++ public: const AVCodec *codec {nullptr}; + + /// \brief Index of the audio stream. + public: int audioStream; +@@ -77,12 +77,7 @@ void AudioDecoder::Cleanup() + ///////////////////////////////////////////////// + bool AudioDecoder::Decode(uint8_t **_outBuffer, unsigned int *_outBufferSize) + { +-#if LIBAVFORMAT_VERSION_MAJOR < 59 +- AVPacket *packet, packet1; +- int bytesDecoded = 0; +-#else + AVPacket *packet; +-#endif + unsigned int maxBufferSize = 0; + AVFrame *decodedFrame = nullptr; + +@@ -108,7 +103,7 @@ bool AudioDecoder::Decode(uint8_t **_out + + bool result = true; + +- if (!(decodedFrame = AVFrameAlloc())) ++ if (!(decodedFrame = av_frame_alloc())) + { + ignerr << "Audio decoder out of memory\n"; + result = false; +@@ -125,7 +120,6 @@ bool AudioDecoder::Decode(uint8_t **_out + { + if (packet->stream_index == this->data->audioStream) + { +-#if LIBAVFORMAT_VERSION_MAJOR >= 59 + // Inspired from + // https://github.com/FFmpeg/FFmpeg/blob/n5.0/doc/examples/decode_audio.c#L71 + +@@ -152,12 +146,18 @@ bool AudioDecoder::Decode(uint8_t **_out + return false; + } + ++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59, 24, 100) ++ int numChannels = this->data->codecCtx->ch_layout.nb_channels; ++#else ++ int numChannels = this->data->codecCtx->channels; ++#endif ++ + // Total size of the data. Some padding can be added to + // decodedFrame->data[0], which is why we can't use + // decodedFrame->linesize[0]. + int size = decodedFrame->nb_samples * + av_get_bytes_per_sample(this->data->codecCtx->sample_fmt) * +- this->data->codecCtx->ch_layout.nb_channels; ++ numChannels; + // Resize the audio buffer as necessary + if (*_outBufferSize + size > maxBufferSize) + { +@@ -170,51 +170,7 @@ bool AudioDecoder::Decode(uint8_t **_out + size); + *_outBufferSize += size; + } +-#else +- int gotFrame = 0; +- +- packet1 = *packet; +- while (packet1.size) +- { +- // Some frames rely on multiple packets, so we have to make sure +- // the frame is finished before we can use it +-#ifndef _WIN32 +-# pragma GCC diagnostic push +-# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +-#endif +- bytesDecoded = avcodec_decode_audio4(this->data->codecCtx, decodedFrame, +- &gotFrame, &packet1); +-#ifndef _WIN32 +-# pragma GCC diagnostic pop +-#endif +- +- if (gotFrame) +- { +- // Total size of the data. Some padding can be added to +- // decodedFrame->data[0], which is why we can't use +- // decodedFrame->linesize[0]. +- int size = decodedFrame->nb_samples * +- av_get_bytes_per_sample(this->data->codecCtx->sample_fmt) * +- this->data->codecCtx->channels; +- +- // Resize the audio buffer as necessary +- if (*_outBufferSize + size > maxBufferSize) +- { +- maxBufferSize += size * 5; +- *_outBuffer = reinterpret_cast(realloc(*_outBuffer, +- maxBufferSize * sizeof(*_outBuffer[0]))); +- } +- +- memcpy(*_outBuffer + *_outBufferSize, decodedFrame->data[0], +- size); +- *_outBufferSize += size; +- } +- +- packet1.data += bytesDecoded; +- packet1.size -= bytesDecoded; +- } +-#endif + } + av_packet_unref(packet); + } + +@@ -271,20 +226,8 @@ bool AudioDecoder::SetFile(const std::st + this->data->audioStream = -1; + for (i = 0; i < this->data->formatCtx->nb_streams; ++i) + { +-#ifndef _WIN32 +-# pragma GCC diagnostic push +-# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +-#endif +-#if LIBAVFORMAT_VERSION_MAJOR >= 59 + if (this->data->formatCtx->streams[i]->codecpar->codec_type == // NOLINT(*) + AVMEDIA_TYPE_AUDIO) +-#else +- if (this->data->formatCtx->streams[i]->codec->codec_type == // NOLINT(*) +- AVMEDIA_TYPE_AUDIO) +-#endif +-#ifndef _WIN32 +-# pragma GCC diagnostic pop +-#endif + { + this->data->audioStream = i; + break; +@@ -300,21 +243,7 @@ bool AudioDecoder::SetFile(const std::st + return false; + } + +- // Get the audio stream codec +-#ifndef _WIN32 +-# pragma GCC diagnostic push +-# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +-#endif +-#if LIBAVFORMAT_VERSION_MAJOR < 59 +- this->data->codecCtx = this->data->formatCtx->streams[ +- this->data->audioStream]->codec; +-#endif +-#ifndef _WIN32 +-# pragma GCC diagnostic pop +-#endif +- + // Find a decoder +-#if LIBAVFORMAT_VERSION_MAJOR >= 59 + this->data->codec = avcodec_find_decoder(this->data->formatCtx->streams[ + this->data->audioStream]->codecpar->codec_id); + if (!this->data->codec) +@@ -331,9 +260,6 @@ bool AudioDecoder::SetFile(const std::st + // Copy all relevant parameters from codepar to codecCtx + avcodec_parameters_to_context(this->data->codecCtx, + this->data->formatCtx->streams[this->data->audioStream]->codecpar); +-#else +- this->data->codec = avcodec_find_decoder(this->data->codecCtx->codec_id); +-#endif + + if (this->data->codec == nullptr) + { +@@ -344,13 +270,8 @@ bool AudioDecoder::SetFile(const std::st + return false; + } + +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(56, 60, 100) + if (this->data->codec->capabilities & AV_CODEC_CAP_TRUNCATED) + this->data->codecCtx->flags |= AV_CODEC_FLAG_TRUNCATED; +-#else +- if (this->data->codec->capabilities & CODEC_CAP_TRUNCATED) +- this->data->codecCtx->flags |= CODEC_FLAG_TRUNCATED; +-#endif + + // Open codec + if (avcodec_open2(this->data->codecCtx, this->data->codec, nullptr) < 0) +Index: git/av/src/Video.cc +=================================================================== +--- git.orig/av/src/Video.cc ++++ git/av/src/Video.cc +@@ -59,6 +59,37 @@ class common::VideoPrivate + public: bool drainingMode = false; + }; + ++int AVCodecDecode(AVCodecContext *_codecCtx, ++ AVFrame *_frame, int *_gotFrame, AVPacket *_packet) ++{ ++ // from https://blogs.gentoo.org/lu_zero/2016/03/29/new-avcodec-api/ ++ int ret; ++ ++ *_gotFrame = 0; ++ ++ if (_packet) ++ { ++ ret = avcodec_send_packet(_codecCtx, _packet); ++ if (ret < 0) ++ { ++ return ret == AVERROR_EOF ? 0 : ret; ++ } ++ } ++ ++ ret = avcodec_receive_frame(_codecCtx, _frame); ++ if (ret < 0 && ret != AVERROR(EAGAIN)) ++ { ++ return ret; ++ } ++ if (ret >= 0) ++ { ++ *_gotFrame = 1; ++ } ++ ++ // new API always consumes the whole packet ++ return _packet ? _packet->size : 0; ++} ++ + ///////////////////////////////////////////////// + Video::Video() + : dataPtr(new VideoPrivate) +@@ -100,7 +131,7 @@ bool Video::Load(const std::string &_fil + this->Cleanup(); + } + +- this->dataPtr->avFrame = AVFrameAlloc(); ++ this->dataPtr->avFrame = av_frame_alloc(); + + // Open video file + if (avformat_open_input(&this->dataPtr->formatCtx, _filename.c_str(), +@@ -121,13 +152,7 @@ bool Video::Load(const std::string &_fil + for (unsigned int i = 0; i < this->dataPtr->formatCtx->nb_streams; ++i) + { + enum AVMediaType codec_type; +- // codec parameter deprecated in ffmpeg version 3.1 +- // github.com/FFmpeg/FFmpeg/commit/9200514ad8717c +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101) + codec_type = this->dataPtr->formatCtx->streams[i]->codecpar->codec_type; +-#else +- codec_type = this->dataPtr->formatCtx->streams[i]->codec->codec_type; +-#endif + if (codec_type == AVMEDIA_TYPE_VIDEO) + { + this->dataPtr->videoStream = static_cast(i); +@@ -143,18 +168,13 @@ bool Video::Load(const std::string &_fil + + // Find the decoder for the video stream + auto stream = this->dataPtr->formatCtx->streams[this->dataPtr->videoStream]; +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101) + codec = avcodec_find_decoder(stream->codecpar->codec_id); +-#else +- codec = avcodec_find_decoder(stream->codec->codec_id); +-#endif + if (codec == nullptr) + { + ignerr << "Codec not found\n"; + return false; + } + +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101) + // AVCodecContext is not included in an AVStream as of ffmpeg 3.1 + // allocate a codec context based on updated example + // github.com/FFmpeg/FFmpeg/commit/bba6a03b2816d805d44bce4f9701a71f7d3f8dad +@@ -173,21 +193,11 @@ bool Video::Load(const std::string &_fil + << std::endl; + return false; + } +-#else +- // Get a pointer to the codec context for the video stream +- this->dataPtr->codecCtx = this->dataPtr->formatCtx->streams[ +- this->dataPtr->videoStream]->codec; +-#endif + + // Inform the codec that we can handle truncated bitstreams -- i.e., + // bitstreams where frame boundaries can fall in the middle of packets +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(56, 60, 100) + if (codec->capabilities & AV_CODEC_CAP_TRUNCATED) + this->dataPtr->codecCtx->flags |= AV_CODEC_FLAG_TRUNCATED; +-#else +- if (codec->capabilities & CODEC_CAP_TRUNCATED) +- this->dataPtr->codecCtx->flags |= CODEC_FLAG_TRUNCATED; +-#endif + + // Open codec + if (avcodec_open2(this->dataPtr->codecCtx, codec, nullptr) < 0) +@@ -212,7 +222,7 @@ bool Video::Load(const std::string &_fil + } + + // swscale needs 32-byte-aligned output frame on some systems +- this->dataPtr->avFrameDst = AVFrameAlloc(); ++ this->dataPtr->avFrameDst = av_frame_alloc(); + this->dataPtr->avFrameDst->format = this->dataPtr->dstPixelFormat; + this->dataPtr->avFrameDst->width = this->dataPtr->codecCtx->width; + this->dataPtr->avFrameDst->height = this->dataPtr->codecCtx->height; +@@ -291,7 +301,7 @@ bool Video::NextFrame(unsigned char **_b + } + + // Process all the data in the frame +- ret = AVCodecDecode( ++ ret = ::AVCodecDecode( + this->dataPtr->codecCtx, this->dataPtr->avFrame, &frameAvailable, + this->dataPtr->drainingMode ? nullptr : packet); + +Index: git/av/src/VideoEncoder.cc +=================================================================== +--- git.orig/av/src/VideoEncoder.cc ++++ git/av/src/VideoEncoder.cc +@@ -14,6 +14,7 @@ + * limitations under the License. + * + */ ++ + #include + + #include +@@ -32,6 +33,14 @@ using namespace ignition; + using namespace common; + using namespace std; + ++// After AVDevice 59.0.100, const pointers are used. ++#if LIBAVDEVICE_VERSION_INT >= AV_VERSION_INT(59, 0, 100) ++using OutputFormat = const AVOutputFormat*; ++#else ++using OutputFormat = AVOutputFormat*; ++#endif ++ ++ + // Private data class + // hidden visibility specifier has to be explicitly set to silent a gcc warning + class IGNITION_COMMON_AV_HIDDEN common::VideoEncoderPrivate +@@ -53,11 +62,7 @@ class IGNITION_COMMON_AV_HIDDEN common:: + public: AVFrame *avOutFrame = nullptr; + + /// \brief libav input image data (aligned to 32 bytes) +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 24, 1) +- public: AVPicture *avInFrame = nullptr; +-#else + public: AVFrame *avInFrame = nullptr; +-#endif + + /// \brief Pixel format of the input frame. So far it is hardcoded. + public: AVPixelFormat inPixFormat = AV_PIX_FMT_RGB24; +@@ -340,34 +345,37 @@ bool VideoEncoder::Start( + // Special case for video4linux2. Here we attempt to find the v4l2 device + if (this->dataPtr->format.compare("v4l2") == 0) + { +-#if LIBAVDEVICE_VERSION_INT >= AV_VERSION_INT(56, 4, 100) +- AVOutputFormat *outputFormat = nullptr; +- while ((outputFormat = av_output_video_device_next(outputFormat)) +- != nullptr) +- { +- // Break when the output device name matches 'v4l2' +- if (this->dataPtr->format.compare(outputFormat->name) == 0) ++#if defined(HAVE_AVDEVICE) ++ OutputFormat outputFormat = nullptr; ++ do ++ { ++ outputFormat = av_output_video_device_next(outputFormat); ++ ++ if (outputFormat) + { +- // Allocate the context using the correct outputFormat +- auto result = avformat_alloc_output_context2(&this->dataPtr->formatCtx, +- outputFormat, nullptr, this->dataPtr->filename.c_str()); +- if (result < 0) ++ // Break when the output device name matches 'v4l2' ++ if (this->dataPtr->format.compare(outputFormat->name) == 0) + { +- ignerr << "Failed to allocate AV context [" << av_err2str_cpp(result) +- << "]" << std::endl; ++ // Allocate the context using the correct outputFormat ++ auto result = avformat_alloc_output_context2(&this->dataPtr->formatCtx, ++ outputFormat, nullptr, this->dataPtr->filename.c_str()); ++ if (result < 0) ++ { ++ ignerr << "Failed to allocate AV context [" << av_err2str_cpp(result) ++ << "]" << std::endl; ++ } ++ break; + } +- break; + } + } +-#else +- ignerr << "libavdevice version >= 56.4.100 is required for v4l2 recording. " +- << "This version is available on Ubuntu Xenial or greater.\n"; +- return false; ++ while (outputFormat); ++ ++ + #endif + } + else + { +- const AVOutputFormat *outputFormat = av_guess_format(nullptr, ++ auto* outputFormat = av_guess_format(nullptr, + this->dataPtr->filename.c_str(), nullptr); + + if (!outputFormat) +@@ -376,28 +384,6 @@ bool VideoEncoder::Start( + << "Using MPEG.\n"; + } + +-#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(56, 40, 1) +- this->dataPtr->formatCtx = avformat_alloc_context(); +- if (outputFormat) +- { +- this->dataPtr->formatCtx->oformat = outputFormat; +- } +- else +- { +- this->dataPtr->formatCtx->oformat = +- av_guess_format("mpeg", nullptr, nullptr); +- } +-#ifdef WIN32 +- _sprintf(this->dataPtr->formatCtx->filename, +- sizeof(this->dataPtr->formatCtx->filename), +- "%s", _filename.c_str()); +-#else +- snprintf(this->dataPtr->formatCtx->filename, +- sizeof(this->dataPtr->formatCtx->filename), +- "%s", _filename.c_str()); +-#endif +- +-#else + auto result = avformat_alloc_output_context2(&this->dataPtr->formatCtx, + nullptr, nullptr, this->dataPtr->filename.c_str()); + if (result < 0) +@@ -405,7 +391,6 @@ bool VideoEncoder::Start( + ignerr << "Failed to allocate AV context [" << av_err2str_cpp(result) + << "]" << std::endl; + } +-#endif + } + + // Make sure allocation occurred. +@@ -428,11 +413,7 @@ bool VideoEncoder::Start( + if (!encoder) + { + ignerr << "Codec for[" +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 24, 1) +- << this->dataPtr->formatCtx->oformat->name +-#else + << avcodec_get_name(codecId) +-#endif + << "] not found. Video encoding is not started.\n"; + this->Reset(); + return false; +@@ -441,13 +422,8 @@ bool VideoEncoder::Start( + ignmsg << "Using encoder " << encoder->name << std::endl; + + // Create a new video stream +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 24, 1) +- this->dataPtr->videoStream = avformat_new_stream(this->dataPtr->formatCtx, +- encoder); +-#else + this->dataPtr->videoStream = avformat_new_stream(this->dataPtr->formatCtx, + nullptr); +-#endif + + if (!this->dataPtr->videoStream) + { +@@ -458,11 +434,7 @@ bool VideoEncoder::Start( + this->dataPtr->videoStream->id = this->dataPtr->formatCtx->nb_streams-1; + + // Allocate a new video context +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 24, 1) +- this->dataPtr->codecCtx = this->dataPtr->videoStream->codec; +-#else + this->dataPtr->codecCtx = avcodec_alloc_context3(encoder); +-#endif + + if (!this->dataPtr->codecCtx) + { +@@ -475,11 +447,7 @@ bool VideoEncoder::Start( + // some formats want stream headers to be separate + if (this->dataPtr->formatCtx->oformat->flags & AVFMT_GLOBALHEADER) + { +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 24, 1) +- this->dataPtr->codecCtx->flags |= CODEC_FLAG_GLOBAL_HEADER; +-#else + this->dataPtr->codecCtx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; +-#endif + } + + // Frames per second +@@ -517,13 +485,7 @@ bool VideoEncoder::Start( + if (this->dataPtr->codecCtx->codec_id == AV_CODEC_ID_H264) + { + av_opt_set(this->dataPtr->codecCtx->priv_data, "preset", "slow", 0); +- +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 24, 1) +- av_opt_set(this->dataPtr->videoStream->codec->priv_data, +- "preset", "slow", 0); +-#else + av_opt_set(this->dataPtr->videoStream->priv_data, "preset", "slow", 0); +-#endif + } + + // we misuse this field a bit, as docs say it is unused in encoders +@@ -560,11 +522,7 @@ bool VideoEncoder::Start( + return false; + } + +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(55, 28, 1) +- this->dataPtr->avOutFrame = avcodec_alloc_frame(); +-#else + this->dataPtr->avOutFrame = av_frame_alloc(); +-#endif + + if (!this->dataPtr->avOutFrame) + { +@@ -589,14 +547,9 @@ bool VideoEncoder::Start( + } + + // Copy parameters from the context to the video stream +-#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(57, 40, 101) +-// ret = avcodec_copy_context(this->dataPtr->videoStream->codec, +-// this->dataPtr->codecCtx); +-#else + // codecpar was implemented in ffmpeg version 3.1 + ret = avcodec_parameters_from_context( + this->dataPtr->videoStream->codecpar, this->dataPtr->codecCtx); +-#endif + if (ret < 0) + { + ignerr << "Could not copy the stream parameters:" << av_err2str_cpp(ret) +@@ -690,11 +643,7 @@ bool VideoEncoder::AddFrame(const unsign + this->dataPtr->swsCtx = nullptr; + + if (this->dataPtr->avInFrame) +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 24, 1) +- av_free(this->dataPtr->avInFrame); +-#else + av_frame_free(&this->dataPtr->avInFrame); +-#endif + this->dataPtr->avInFrame = nullptr; + } + +@@ -705,19 +654,12 @@ bool VideoEncoder::AddFrame(const unsign + + if (!this->dataPtr->avInFrame) + { +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 24, 1) +- this->dataPtr->avInFrame = new AVPicture; +- avpicture_alloc(this->dataPtr->avInFrame, +- this->dataPtr->inPixFormat, this->dataPtr->inWidth, +- this->dataPtr->inHeight); +-#else + this->dataPtr->avInFrame = av_frame_alloc(); + this->dataPtr->avInFrame->width = this->dataPtr->inWidth; + this->dataPtr->avInFrame->height = this->dataPtr->inHeight; + this->dataPtr->avInFrame->format = this->dataPtr->inPixFormat; + + av_frame_get_buffer(this->dataPtr->avInFrame, 32); +-#endif + } + + av_image_fill_linesizes(this->dataPtr->inputLineSizes, +@@ -779,24 +721,6 @@ bool VideoEncoder::AddFrame(const unsign + { + frameToEncode->pts = this->dataPtr->frameCount++; + +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 40, 101) +- int gotOutput = 0; +- AVPacket avPacket; +- av_init_packet(&avPacket); +- avPacket.data = nullptr; +- avPacket.size = 0; +- +- ret = avcodec_encode_video2(this->dataPtr->codecCtx, &avPacket, +- frameToEncode, &gotOutput); +- +- if (ret >= 0 && gotOutput == 1) +- ret = ProcessPacket(&avPacket); +- +- av_free_packet(&avPacket); +- +- // #else for libavcodec version check +-#else +- + AVPacket* avPacket = av_packet_alloc(); + + avPacket->data = nullptr; +@@ -817,7 +741,6 @@ bool VideoEncoder::AddFrame(const unsign + } + + av_packet_unref(avPacket); +-#endif + } + return ret >= 0 || ret == AVERROR(EAGAIN); + } +@@ -859,31 +782,6 @@ bool VideoEncoder::Stop() + // drain remaining packets from the encoder + if (this->dataPtr->encoding && this->dataPtr->codecCtx) + { +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 40, 101) +- if ((this->dataPtr->codecCtx->capabilities & AV_CODEC_CAP_DELAY) > 0) +- { +- int gotOutput = 1; +- int ret = 0; +- AVPacket avPacket; +- av_init_packet(&avPacket); +- avPacket.data = nullptr; +- avPacket.size = 0; +- +- while (ret >= 0 && gotOutput == 1) +- { +- ret = avcodec_encode_video2(this->dataPtr->codecCtx, &avPacket, +- nullptr, &gotOutput); +- +- if (ret >= 0 && gotOutput == 1) +- ret = ProcessPacket(&avPacket); +- } +- +- av_free_packet(&avPacket); +- } +- +-// #else for libavcodec version check +-#else +- + int ret = 0; + // enter drain state + ret = avcodec_send_frame(this->dataPtr->codecCtx, nullptr); +@@ -906,32 +804,21 @@ bool VideoEncoder::Stop() + } + av_packet_unref(avPacket); + } +-#endif + } + + if (this->dataPtr->encoding && this->dataPtr->formatCtx) + av_write_trailer(this->dataPtr->formatCtx); + +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 24, 1) + if (this->dataPtr->codecCtx) + avcodec_free_context(&this->dataPtr->codecCtx); +-#endif + this->dataPtr->codecCtx = nullptr; + + if (this->dataPtr->avInFrame) +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 24, 1) +- av_free(this->dataPtr->avInFrame); +-#else + av_frame_free(&this->dataPtr->avInFrame); +-#endif + this->dataPtr->avInFrame = nullptr; + + if (this->dataPtr->avOutFrame) +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(57, 24, 1) +- av_free(this->dataPtr->avOutFrame); +-#else + av_frame_free(&this->dataPtr->avOutFrame); +-#endif + this->dataPtr->avOutFrame = nullptr; + + if (this->dataPtr->swsCtx) +Index: git/av/src/ffmpeg_inc.cc +=================================================================== +--- git.orig/av/src/ffmpeg_inc.cc ++++ git/av/src/ffmpeg_inc.cc +@@ -21,38 +21,25 @@ using namespace ignition; + ////////////////////////////////////////////////// + AVFrame *common::AVFrameAlloc(void) + { +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 28, 1) + return av_frame_alloc(); +-#else +- return avcodec_alloc_frame(); +-#endif + } + + ////////////////////////////////////////////////// + void common::AVFrameUnref(AVFrame *_frame) + { +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(55, 28, 1) + av_frame_unref(_frame); +-#else +- avcodec_get_frame_defaults(_frame); +-#endif + } + + ////////////////////////////////////////////////// + void common::AVPacketUnref(AVPacket *_packet) + { +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 24, 102) + av_packet_unref(_packet); +-#else +- av_free_packet(_packet); +-#endif + } + + ////////////////////////////////////////////////// + int common::AVCodecDecode(AVCodecContext *_codecCtx, + AVFrame *_frame, int *_gotFrame, AVPacket *_packet) + { +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(57, 48, 101) + // from https://blogs.gentoo.org/lu_zero/2016/03/29/new-avcodec-api/ + int ret; + +@@ -79,16 +66,4 @@ int common::AVCodecDecode(AVCodecContext + + // new API always consumes the whole packet + return _packet ? _packet->size : 0; +-#else +- // this was deprecated in ffmpeg version 3.1 +- // github.com/FFmpeg/FFmpeg/commit/7fc329e2dd6226dfecaa4a1d7adf353bf2773726 +-# ifndef _WIN32 +-# pragma GCC diagnostic push +-# pragma GCC diagnostic ignored "-Wdeprecated-declarations" +-# endif +- return avcodec_decode_video2(_codecCtx, _frame, _gotFrame, _packet); +-# ifndef _WIN32 +-# pragma GCC diagnostic pop +-# endif +-#endif + } diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-common4/have_libdl.patch b/meta-ros-common/recipes-devtools/gazebo/ignition-common4/have_libdl.patch new file mode 100644 index 00000000000..1eca9e69565 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-common4/have_libdl.patch @@ -0,0 +1,16 @@ +Index: git/CMakeLists.txt +=================================================================== +--- git.orig/CMakeLists.txt ++++ git/CMakeLists.txt +@@ -69,11 +69,6 @@ else() + endif() + + #-------------------------------------- +-# Find libdl +-ign_find_package( +- DL REQUIRED PRIVATE PRETTY libdl PURPOSE "Required for plugins") +- +-#-------------------------------------- + # Find dependencies that we ignore for Visual Studio + if(NOT MSVC) + diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-common4_2.17.1.bb b/meta-ros-common/recipes-devtools/gazebo/ignition-common4_2.17.1.bb new file mode 100644 index 00000000000..668c4979fb8 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-common4_2.17.1.bb @@ -0,0 +1,41 @@ +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://COPYING;md5=2a461be67a1edf991251f85f3aadd1d0 \ + file://LICENSE;md5=2e9f68f022747514564aa13818fcb7c6 \ + file://profiler/src/Remotery/LICENSE;md5=34400b68072d710fecd0a2940a0d1658" + +SRC_URI = "git://github.com/gazebosim/gz-common.git;protocol=https;branch=ign-common4 \ + file://cleanup-long-deprecated-ifdefs.patch \ + file://have_libdl.patch \ +" + +SRCREV = "ade3fa20db31a094388d1fca96bbddaf5eeb262d" + +S = "${WORKDIR}/git" + +inherit cmake pkgconfig + +# CMake Error: TRY_RUN() invoked in cross-compiling mode, please set the following cache variables appropriately: +# FREEIMAGE_RUNS (advanced) +# FREEIMAGE_RUNS__TRYRUN_OUTPUT (advanced) +EXTRA_OECMAKE += " -DFREEIMAGE_RUNS=1 -DFREEIMAGE_RUNS__TRYRUN_OUTPUT=0" + +DEPENDS = " \ + cppcheck-native \ + doxygen-native \ + graphviz-native \ + gts \ + ffmpeg \ + freeimage \ + ignition-cmake2 \ + ignition-math6 \ + ignition-utils1 \ + libtinyxml2 \ + util-linux \ +" + +FILES:${PN} += " \ + ${datadir}/ignition/ignition-common4/profiler_vis/* \ + ${datadir}/ignition/ignition-common4/ignition-common4.tag.xml \ +" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-fortress_1.0.3.bb b/meta-ros-common/recipes-devtools/gazebo/ignition-fortress_1.0.3.bb new file mode 100644 index 00000000000..3ca550eab2f --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-fortress_1.0.3.bb @@ -0,0 +1,43 @@ +# Recipe created by recipetool +# This is the basis of a recipe and may need further editing in order to be fully functional. +# (Feel free to remove these comments when editing.) + +# WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is +# your responsibility to verify that the values are complete and correct. +# +# The following license files were not able to be identified and are +# represented as "Unknown" below, you will need to check them yourself: +# LICENSE +LICENSE = "Unknown" +LIC_FILES_CHKSUM = "file://LICENSE;md5=7eb60e29c1b7d33cea477b84618c2f4d" + +SRC_URI = "git://github.com/gazebosim/gz-fortress.git;protocol=https;branch=main" + +# Modify these as desired +PV = "1.0.3+git${SRCPV}" +SRCREV = "a8b194cb334944458b698f6d4d01b13b63c25f1d" + +S = "${WORKDIR}/git" + +inherit cmake + +DEPENDS = " \ + ignition-cmake2 \ + ignition-common4 \ + ignition-fuel-tools7 \ + ignition-gazebo6 \ + ignition-gui6 \ + ignition-launch5 \ + ignition-math6 \ + ignition-msgs8 \ + ignition-physics5 \ + ignition-plugin1 \ + ignition-rendering6 \ + ignition-sensors6 \ + ignition-transport11 \ + ignition-utils1 \ + sdformat \ +" +# Specify any options you want to pass to cmake using EXTRA_OECMAKE: +EXTRA_OECMAKE = "" + diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-fuel-tools4_4.9.1.bb b/meta-ros-common/recipes-devtools/gazebo/ignition-fuel-tools4_4.9.1.bb new file mode 100644 index 00000000000..a32efef27a7 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-fuel-tools4_4.9.1.bb @@ -0,0 +1,33 @@ +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=2a461be67a1edf991251f85f3aadd1d0" + +SRC_URI = "git://github.com/gazebosim/gz-fuel-tools;protocol=https;branch=gz-fuel-tools9" + +SRCREV = "931f139b00e37fe764ee05a5ec40e695c1c323af" + +S = "${WORKDIR}/git" + +inherit cmake + +# Specify any options you want to pass to cmake using EXTRA_OECMAKE: +EXTRA_OECMAKE = "" + +DEPENDS = " \ + ignition-cmake2 \ + ignition-common3 \ + ignition-msgs5 \ + ignition-tools1 \ + jsoncpp \ + libyaml \ + libzip \ + curl \ +" + +FILES:${PN} += " \ + ${libdir}/ruby/ignition/cmdfuel4.rb \ + ${datadir}/gz/gz1.completion.d/fuel4.bash_completion.sh \ + ${datadir}/ignition/fuel4.yaml \ + ${datadir}/ignition/fuel_tools4/config.yaml \ +" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-fuel-tools7_2.17.1.bb b/meta-ros-common/recipes-devtools/gazebo/ignition-fuel-tools7_2.17.1.bb new file mode 100644 index 00000000000..303813a14c2 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-fuel-tools7_2.17.1.bb @@ -0,0 +1,32 @@ +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=2a461be67a1edf991251f85f3aadd1d0" + +SRC_URI = "git://github.com/gazebosim/gz-fuel-tools;protocol=https;branch=ign-fuel-tools7" + +SRCREV = "0bdbb7a0f54a6db260abcc391de064662f193d3e" + +S = "${WORKDIR}/git" + +inherit cmake + +# Specify any options you want to pass to cmake using EXTRA_OECMAKE: +EXTRA_OECMAKE = "" + +DEPENDS = " \ + ignition-cmake2 \ + ignition-common4 \ + ignition-msgs8 \ + jsoncpp \ + libyaml \ + libzip \ + curl \ +" + +FILES:${PN} += " \ + ${libdir}/ruby/ignition/cmdfuel7.rb \ + ${datadir}/gz/gz1.completion.d/fuel7.bash_completion.sh \ + ${datadir}/ignition/fuel7.yaml \ + ${datadir}/ignition/fuel_tools7/config.yaml \ +" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-gazebo6_6.15.0.bb b/meta-ros-common/recipes-devtools/gazebo/ignition-gazebo6_6.15.0.bb new file mode 100644 index 00000000000..333590610b7 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-gazebo6_6.15.0.bb @@ -0,0 +1,35 @@ +LICENSE = "Apache-2.0 & Artistic-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=2a461be67a1edf991251f85f3aadd1d0 \ + file://src/systems/elevator/vender/afsm/LICENSE;md5=ec4341a201f4b801aba0191a5d2d8f39 \ + file://src/systems/elevator/vender/metapushkin/LICENSE;md5=ec4341a201f4b801aba0191a5d2d8f39" + +SRC_URI = "git://github.com/gazebosim/gz-sim.git;protocol=https;branch=ign-gazebo6" + +SRCREV = "326cef2b4a177bf6ea957fe9e2841c4719d598db" + +S = "${WORKDIR}/git" + +# NOTE: unable to map the following CMake package dependencies: Python3 ignition-cmake2 pybind11 +inherit cmake python3-dir + +# Specify any options you want to pass to cmake using EXTRA_OECMAKE: +EXTRA_OECMAKE = "" + +DEPENDS = " \ + ignition-cmake2 \ + ignition-common4 \ + ignition-fuel-tools7 \ + ignition-gui6 \ + ignition-math6 \ + ignition-msgs8 \ + ignition-physics5 \ + ignition-plugin1 \ + ignition-rendering6 \ + ignition-sensors6 \ + ignition-tools1 \ + ignition-transport11 \ + ignition-utils1 \ + sdformat \ +" + +RPROVIDES:${PN} += " gazebo" diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-gui6_6.8.0.bb b/meta-ros-common/recipes-devtools/gazebo/ignition-gui6_6.8.0.bb new file mode 100644 index 00000000000..d43d2f2bc94 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-gui6_6.8.0.bb @@ -0,0 +1,44 @@ +# Copyright (c) 2024 Wind River Systems, Inc. + +# WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is +# your responsibility to verify that the values are complete and correct. +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=2a461be67a1edf991251f85f3aadd1d0" + +SRC_URI = "git://github.com/gazebosim/gz-gui.git;protocol=https;branch=ign-gui6" + +SRCREV = "982aafca1b96dbc6d12ea5de4d8df27c288be532" + +S = "${WORKDIR}/git" + +inherit cmake + +# CMake Error at src/plugins/CMakeLists.txt:26 (QT5_WRAP_CPP): +# Unknown CMake command "QT5_WRAP_CPP". +inherit ${@bb.utils.contains_any('ROS_WORLD_SKIP_GROUPS', ['qt5', 'pyqt5'], '', 'cmake_qt5', d)} + +DEPENDS = " \ + ignition-cmake2 \ + ignition-common4 \ + ignition-math6 \ + ignition-msgs8 \ + ignition-plugin1 \ + ignition-rendering6 \ + ignition-tools1 \ + ignition-transport11 \ + ignition-utils1 \ + protobuf \ + libtinyxml2 \ + qtbase \ + qtquickcontrols2 \ +" +DEPENDS:append:class-target = "xserver-xorg" + +FILES:${PN} += " \ + ${libdir}/ign-gui-6/plugins/* \ + ${libdir}/ruby/ignition/* \ + ${datadir}/gz/* \ + ${datadir}/ignition/* \ +" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-launch5_5.3.0.bb b/meta-ros-common/recipes-devtools/gazebo/ignition-launch5_5.3.0.bb new file mode 100644 index 00000000000..619de9f1c81 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-launch5_5.3.0.bb @@ -0,0 +1,41 @@ +# Recipe created by recipetool +# This is the basis of a recipe and may need further editing in order to be fully functional. +# (Feel free to remove these comments when editing.) + +# WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is +# your responsibility to verify that the values are complete and correct. +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=2a461be67a1edf991251f85f3aadd1d0" + +SRC_URI = "git://github.com/gazebosim/gz-launch.git;protocol=https;branch=ign-launch5" + +SRCREV = "894e2e2319617fbde652960b847e13436391ec9c" + +S = "${WORKDIR}/git" + +# NOTE: unable to map the following CMake package dependencies: ignition-cmake2 +# NOTE: the following library dependencies are unknown, ignoring: bfd dwarf +# (this is based on recipes that have previously been built and packaged) +DEPENDS = "elfutils" + +inherit cmake +inherit ${@bb.utils.contains_any('ROS_WORLD_SKIP_GROUPS', ['qt5', 'pyqt5'], '', 'cmake_qt5', d)} + +# Specify any options you want to pass to cmake using EXTRA_OECMAKE: +EXTRA_OECMAKE = "" + +DEPENDS = " \ + elfutils \ + ignition-cmake2 \ + ignition-common4 \ + ignition-gazebo6 \ + ignition-gui6 \ + ignition-math6 \ + ignition-msgs8 \ + ignition-plugin1 \ + ignition-rendering6 \ + ignition-tools1 \ + ignition-transport11 \ + ignition-utils1 \ + libwebsockets \ +" diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-math6_6.15.0.bb b/meta-ros-common/recipes-devtools/gazebo/ignition-math6_6.15.0.bb new file mode 100644 index 00000000000..e8b14704e75 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-math6_6.15.0.bb @@ -0,0 +1,29 @@ +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=2a461be67a1edf991251f85f3aadd1d0" + +SRC_URI = "git://github.com/gazebosim/gz-math.git;protocol=https;branch=ign-math6" + +SRCREV = "62768395a0386e596f5a761fb5f426e0a3f1d050" + +S = "${WORKDIR}/git" + +DEPENDS = " \ + ruby-native \ + swig-native \ + python3 \ + python3-pybind11 \ + ignition-cmake2 \ +" + +inherit cmake python3-dir + +# Specify any options you want to pass to cmake using EXTRA_OECMAKE: +EXTRA_OECMAKE = "" + +DEPENDS = " \ + ignition-cmake2 \ + ignition-cmake2-native \ + libeigen \ +" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-msgs5-native_5.11.0.bb b/meta-ros-common/recipes-devtools/gazebo/ignition-msgs5-native_5.11.0.bb new file mode 100644 index 00000000000..738f011d535 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-msgs5-native_5.11.0.bb @@ -0,0 +1,6 @@ +include ignition-msgs5.inc + +DEPENDS = "ignition-cmake2-native ignition-math6-native libtinyxml2-native protobuf-native" +EXTRA_OECMAKE += "-DINSTALL_IGN_MSGS_GEN_EXECUTABLE:BOOL=ON" + +inherit native diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-msgs5.inc b/meta-ros-common/recipes-devtools/gazebo/ignition-msgs5.inc new file mode 100644 index 00000000000..caf820b35fb --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-msgs5.inc @@ -0,0 +1,12 @@ +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://COPYING;md5=2a461be67a1edf991251f85f3aadd1d0 \ + file://LICENSE;md5=2e9f68f022747514564aa13818fcb7c6" + +SRC_URI = "git://github.com/gazebosim/gz-msgs.git;protocol=https;branch=main" + +PV = "5.11" +SRCREV = "5296dff386aa0835027303a3b3209941ae005220" + +S = "${WORKDIR}/git" + +inherit cmake diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-msgs5_5.11.0.bb b/meta-ros-common/recipes-devtools/gazebo/ignition-msgs5_5.11.0.bb new file mode 100644 index 00000000000..7bee80e6d5a --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-msgs5_5.11.0.bb @@ -0,0 +1,12 @@ +include ignition-msgs5.inc + +DEPENDS = "ignition-math6 libtinyxml2 protobuf protobuf-native ${PN}-native" +DEPENDS += "${PN}-native" +EXTRA_OECMAKE += " -DINSTALL_IGN_MSGS_GEN_EXECUTABLE:BOOL=OFF -DIGN_MSGS_GEN_EXECUTABLE=${WORKDIR}/recipe-sysroot-native/usr/bin/ign_msgs_gen" + +FILES:${PN} += " \ + ${libdir}/ruby/ignition/cmdmsgs5.rb \ + ${libdir}/ruby/ignition/msgs5/* \ + ${datadir}/gz/gz1.completion.d/msgs5.bash_completion.sh \ + ${datadir}/ignition/msgs5.yaml \ +" diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-msgs8-native_8.7.0.bb b/meta-ros-common/recipes-devtools/gazebo/ignition-msgs8-native_8.7.0.bb new file mode 100644 index 00000000000..5d0e43959f3 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-msgs8-native_8.7.0.bb @@ -0,0 +1,6 @@ +include ignition-msgs8.inc + +DEPENDS = "ignition-cmake2-native ignition-math6-native libtinyxml2-native protobuf-native" +EXTRA_OECMAKE += "-DINSTALL_IGN_MSGS_GEN_EXECUTABLE:BOOL=ON" + +inherit native diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-msgs8.inc b/meta-ros-common/recipes-devtools/gazebo/ignition-msgs8.inc new file mode 100644 index 00000000000..75873f3da8a --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-msgs8.inc @@ -0,0 +1,13 @@ +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://COPYING;md5=2a461be67a1edf991251f85f3aadd1d0 \ + file://LICENSE;md5=2e9f68f022747514564aa13818fcb7c6" + +SRC_URI = "git://github.com/gazebosim/gz-msgs.git;protocol=https;branch=ign-msgs8" + +# Modify these as desired +PV = "8.7.0+git${SRCPV}" +SRCREV = "f9acd44dd926433799e5e0c6f5f4af281bc72c57" + +S = "${WORKDIR}/git" + +inherit cmake diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-msgs8_8.7.0.bb b/meta-ros-common/recipes-devtools/gazebo/ignition-msgs8_8.7.0.bb new file mode 100644 index 00000000000..4d7477ee663 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-msgs8_8.7.0.bb @@ -0,0 +1,12 @@ +include ignition-msgs8.inc + +DEPENDS = "ignition-math6 libtinyxml2 protobuf protobuf-native ${PN}-native" +DEPENDS += "${PN}-native" +EXTRA_OECMAKE += " -DINSTALL_IGN_MSGS_GEN_EXECUTABLE:BOOL=OFF -DIGN_MSGS_GEN_EXECUTABLE=${WORKDIR}/recipe-sysroot-native/usr/bin/ign_msgs_gen" + +FILES:${PN} += " \ + ${libdir}/ruby/ignition/cmdmsgs8.rb \ + ${libdir}/ruby/ignition/msgs8/* \ + ${datadir}/gz/gz1.completion.d/msgs8.bash_completion.sh \ + ${datadir}/ignition/msgs8.yaml \ +" diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-physics5_5.0.0.bb b/meta-ros-common/recipes-devtools/gazebo/ignition-physics5_5.0.0.bb new file mode 100644 index 00000000000..ea38724e1e3 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-physics5_5.0.0.bb @@ -0,0 +1,23 @@ +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://COPYING;md5=2a461be67a1edf991251f85f3aadd1d0 \ + file://LICENSE;md5=2e9f68f022747514564aa13818fcb7c6 \ + file://tpe/lib/src/aabb_tree/LICENSE;md5=fd0ac4e17e55ad320e9429c05b5c23c7" + +SRC_URI = "git://github.com/gazebosim/gz-physics.git;protocol=https;branch=ign-physics5" + +SRCREV = "ba3eb2c7f32660eef82e27f24401783f80cfcf2b" + +S = "${WORKDIR}/git" + +DEPENDS += " \ + ignition-cmake2 \ + ignition-math6 \ + ignition-common4 \ + ignition-transport11 \ + ignition-rendering6 \ + ignition-msgs8 \ + protobuf \ + sdformat \ +" + +inherit cmake diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-plugin1_1.4.0.bb b/meta-ros-common/recipes-devtools/gazebo/ignition-plugin1_1.4.0.bb new file mode 100644 index 00000000000..aa3d5d4dac6 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-plugin1_1.4.0.bb @@ -0,0 +1,24 @@ +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://COPYING;md5=2a461be67a1edf991251f85f3aadd1d0 \ + file://LICENSE;md5=2e9f68f022747514564aa13818fcb7c6" + +SRC_URI = "git://github.com/gazebosim/gz-plugin.git;protocol=https;branch=ign-plugin1" + +SRCREV = "1d5a4c987668ed0584ddbf4398dc81b519412c54" + +S = "${WORKDIR}/git" + +inherit cmake + +# Specify any options you want to pass to cmake using EXTRA_OECMAKE: +EXTRA_OECMAKE = "" + +DEPENDS = "ignition-cmake2" + +FILES:${PN} += " \ + ${datadir}/gz/gz1.completion.d/plugin1.bash_completion.sh \ + ${datadir}/ignition/plugin1.yaml \ + ${libdir}/ruby/ignition/cmdplugin1.rb \ +" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-rendering6/freeimage_optional.patch b/meta-ros-common/recipes-devtools/gazebo/ignition-rendering6/freeimage_optional.patch new file mode 100644 index 00000000000..b5610bc5ea6 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-rendering6/freeimage_optional.patch @@ -0,0 +1,32 @@ +Index: git/CMakeLists.txt +=================================================================== +--- git.orig/CMakeLists.txt ++++ git/CMakeLists.txt +@@ -48,12 +48,6 @@ ign_find_package(ignition-plugin1 REQUIR + set(IGN_PLUGIN_VER ${ignition-plugin1_VERSION_MAJOR}) + + #-------------------------------------- +-# Find FreeImage +-ign_find_package(FreeImage VERSION 3.9 +- REQUIRED_BY optix +- PRIVATE_FOR optix) +- +-#-------------------------------------- + # Find OpenGL + # See CMP0072 for more details (cmake --help-policy CMP0072) + if ((NOT ${CMAKE_VERSION} VERSION_LESS 3.11) AND (NOT OpenGL_GL_PREFERENCE)) +@@ -139,7 +133,14 @@ if(NOT MSVC) + + if (OptiX_FOUND AND CUDA_FOUND) + set(HAVE_OPTIX TRUE) ++ ++ #-------------------------------------- ++ # Find FreeImage ++ ign_find_package(FreeImage VERSION 3.9 ++ REQUIRED_BY optix ++ PRIVATE_FOR optix) + endif() ++ + endif() + + ##################################### diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-rendering6_6.6.1.bb b/meta-ros-common/recipes-devtools/gazebo/ignition-rendering6_6.6.1.bb new file mode 100644 index 00000000000..e09b381cb40 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-rendering6_6.6.1.bb @@ -0,0 +1,53 @@ +LICENSE = "Apache-2.0 & OFL-1.1" +LIC_FILES_CHKSUM = "file://LICENSE;md5=2a461be67a1edf991251f85f3aadd1d0 \ + file://ogre/src/media/fonts/liberation-sans/SIL%20Open%20Font%20License.txt;md5=a4b00b7892bfb2fc9398e7f292af5b3d" + +SRC_URI = "git://github.com/gazebosim/gz-rendering.git;protocol=https;branch=main \ + file://freeimage_optional.patch" + +SRCREV = "c2c5fdfb889f449a0c7665dc492ee6b67591cadd" + +S = "${WORKDIR}/git" + +# NOTE: unable to map the following CMake package dependencies: CUDA ignition-cmake2 +DEPENDS = "boost" + +inherit cmake pkgconfig + +# Copied from rviz_ogre_vendor CMakeLists.txt +OGRE_CXX_FLAGS += " \ + -Wno-deprecated-declarations \ + -Wno-mismatched-new-delete \ + -Wno-range-loop-construct \ + -Wno-undef \ + -Wno-misleading-indentation \ + -Wno-implicit-const-int-float-conversion \ +" + +EXTRA_OECMAKE = " \ + -DSKIP_optix:BOOL=TRUE \ + -DCMAKE_CXX_FLAGS=${OGRE_CXX_FLAGS} \ +" + +DEPENDS = " \ + ignition-cmake2 \ + ignition-common4 \ + ignition-math6 \ + ignition-plugin1 \ + freeimage \ + ogre \ +" + +OECMAKE_GENERATOR = "Unix Makefiles" + +FILES:${PN} += " \ + ${datadir}/ignition/* \ + ${libdir}/ign-rendering-6/engine-plugins/libignition-rendering6-ogre${SOLIBS} \ +" + +FILES:${PN}-dev += " \ + ${libdir}/ign-rendering-6/engine-plugins/libignition-rendering-ogre.so \ + ${libdir}/ign-rendering-6/engine-plugins/libignition-rendering6-ogre.so \ +" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-sensors6_6.0.0.bb b/meta-ros-common/recipes-devtools/gazebo/ignition-sensors6_6.0.0.bb new file mode 100644 index 00000000000..68198df1b10 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-sensors6_6.0.0.bb @@ -0,0 +1,22 @@ +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://COPYING;md5=2a461be67a1edf991251f85f3aadd1d0 \ + file://LICENSE;md5=403837d405a17669732f6a98e3f42aed" + +SRC_URI = "git://github.com/gazebosim/gz-sensors.git;protocol=https;branch=ign-sensors6" + +SRCREV = "b0c61c5853f204372018161c5224c17dc523ad9c" + +S = "${WORKDIR}/git" + +DEPENDS += " \ + ignition-cmake2 \ + ignition-common4 \ + ignition-math6 \ + ignition-msgs8 \ + ignition-rendering6 \ + ignition-transport11 \ + protobuf \ + sdformat12 \ +" + +inherit cmake diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-tools1/backward-ros-include-dir.patch b/meta-ros-common/recipes-devtools/gazebo/ignition-tools1/backward-ros-include-dir.patch new file mode 100644 index 00000000000..85dfeae76c4 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-tools1/backward-ros-include-dir.patch @@ -0,0 +1,10 @@ +Index: git/src/backward.cc +=================================================================== +--- git.orig/src/backward.cc ++++ git/src/backward.cc +@@ -1,4 +1,4 @@ +-#include "backward.hpp" ++#include "backward_ros/backward.hpp" + + namespace ignition { + namespace tools { diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-tools1_15.0.bb b/meta-ros-common/recipes-devtools/gazebo/ignition-tools1_15.0.bb new file mode 100644 index 00000000000..7df73b440d6 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-tools1_15.0.bb @@ -0,0 +1,39 @@ +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://COPYING;md5=2a461be67a1edf991251f85f3aadd1d0 \ + file://LICENSE;md5=ba86179b62e9e2c25dd9184dd87e2464" + +SRC_URI = " \ + git://github.com/gazebosim/gz-tools.git;protocol=https;branch=ign-tools1 \ + file://backward-ros-include-dir.patch \ +" + +SRCREV = "67d9d473aca6d33fb849e93e309cd678a75ccd71" + +S = "${WORKDIR}/git" + +inherit cmake + +EXTRA_OECMAKE = "-DUSE_SYSTEM_BACKWARDCPP:BOOL=ON" + +DEPENDS = " \ + doxygen \ + jsoncpp \ + libyaml \ + libzip \ + backward-ros \ +" + + +FILES:${PN} = " \ + ${bindir}/ign \ + ${libdir}/libignition-tools-backward.so \ + ${datadir}/bash-completion/completions/ign \ + ${datadir}/gz/gz1.completion \ +" + +FILES:${PN}-dev = " \ + ${libdir}/pkgconfig/ignition-tools.pc \ + ${libdir}/cmake/ignition-tools/ignition-tools-config.cmake \ +" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-transport11_11.4.1.bb b/meta-ros-common/recipes-devtools/gazebo/ignition-transport11_11.4.1.bb new file mode 100644 index 00000000000..049cfb79379 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-transport11_11.4.1.bb @@ -0,0 +1,38 @@ +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=2a461be67a1edf991251f85f3aadd1d0" + +SRC_URI = "git://github.com/gazebosim/gz-transport.git;protocol=https;branch=ign-transport11" + +SRCREV = "69e9592544c36d4e10eed74953258662569d91fd" + +S = "${WORKDIR}/git" + +inherit cmake pkgconfig + +# Specify any options you want to pass to cmake using EXTRA_OECMAKE: +EXTRA_OECMAKE = "" + +DEPENDS = " \ + ignition-cmake2 \ + ignition-msgs8 \ + ignition-utils1 \ + sqlite3 \ + util-linux-libuuid \ + zeromq \ + cppzmq \ +" + +RDEPENDS:${PN} += "ruby" + +FILES:${PN} += " \ + /usr/lib/ruby/gz/cmdtransport11.rb \ + /usr/lib/ruby/ignition/cmdparam11.rb \ + /usr/lib/ruby/ignition/cmdlog11.rb \ + /usr/share/gz/gz1.completion.d/transport11.bash_completion.sh \ + /usr/share/ignition/transport11.yaml \ + /usr/share/ignition/transportparam11.yaml \ + /usr/share/ignition/transportlog11.yaml \ + /usr/share/ignition/ignition-transport11/sql/0.1.0.sql \ +" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-transport8_8.5.0.bb b/meta-ros-common/recipes-devtools/gazebo/ignition-transport8_8.5.0.bb new file mode 100644 index 00000000000..f1464342735 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-transport8_8.5.0.bb @@ -0,0 +1,37 @@ +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=2a461be67a1edf991251f85f3aadd1d0" + +SRC_URI = "git://github.com/gazebosim/gz-transport.git;protocol=https;branch=main" + +SRCREV = "db86f9b8838187a290ecad968dc5fc432739466a" + +S = "${WORKDIR}/git" + +inherit cmake pkgconfig + +# Specify any options you want to pass to cmake using EXTRA_OECMAKE: +EXTRA_OECMAKE = "" + +DEPENDS = " \ + ignition-cmake2 \ + ignition-msgs5 \ + ignition-utils1 \ + sqlite3 \ + util-linux-libuuid \ + zeromq \ + cppzmq \ +" + +RDEPENDS:${PN} += "ruby" + +FILES:${PN} += " \ + ${libdir}/ruby/ignition/cmdtransport8.rb \ + ${libdir}/ruby/ignition/cmdlog8.rb \ + ${datadir}/gz/gz1.completion.d/transport8.bash_completion.sh \ + ${datadir}/ignition/transport8.yaml \ + ${datadir}/ignition/transportparam8.yaml \ + ${datadir}/ignition/transportlog8.yaml \ + ${datadir}/ignition/ignition-transport8/sql/0.1.0.sql \ +" + +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-ros-common/recipes-devtools/gazebo/ignition-utils1_1.5.1.bb b/meta-ros-common/recipes-devtools/gazebo/ignition-utils1_1.5.1.bb new file mode 100644 index 00000000000..c024b020734 --- /dev/null +++ b/meta-ros-common/recipes-devtools/gazebo/ignition-utils1_1.5.1.bb @@ -0,0 +1,20 @@ +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://COPYING;md5=2a461be67a1edf991251f85f3aadd1d0 \ + file://LICENSE;md5=881ceadb4a5b6db70a8a48a5f5f0050f \ + file://cli/LICENSE;md5=b73927b18d5c6cd8d2ed28a6ad539733" + +SRC_URI = "git://github.com/gazebosim/gz-utils.git;protocol=https;branch=ign-utils1" + +SRCREV = "36f5dfdbccd6cce7e02df14a2db19c6c2e784c49" + +S = "${WORKDIR}/git" + +# NOTE: unable to map the following CMake package dependencies: ignition-cmake2 +inherit cmake + +# Specify any options you want to pass to cmake using EXTRA_OECMAKE: +EXTRA_OECMAKE = "" + +DEPENDS = "ignition-cmake2" + +BBCLASSEXTEND = "native nativesdk" From 602fa71c2409f2a749703105f957082ecb924a94 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Tue, 21 May 2024 15:25:33 -0700 Subject: [PATCH 45/60] {common} ogre: Add preferred version for ROS 2 Humble Signed-off-by: Rob Woolley --- .../recipes-devtools/ogre/ogre_1.12.12.bb | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 meta-ros-common/recipes-devtools/ogre/ogre_1.12.12.bb diff --git a/meta-ros-common/recipes-devtools/ogre/ogre_1.12.12.bb b/meta-ros-common/recipes-devtools/ogre/ogre_1.12.12.bb new file mode 100644 index 00000000000..63db8b9d0a3 --- /dev/null +++ b/meta-ros-common/recipes-devtools/ogre/ogre_1.12.12.bb @@ -0,0 +1,72 @@ +# Copyright (c) 2020 LG Electronics, Inc. +# Copyright (c) 2024 Wind River Systems, Inc. + +DESCRIPTION = "Extensible Modelica-based platform for optimization, simulation and analysis of complex dynamic systems." +HOMEPAGE = "https://ogrecave.github.io/" +SECTION = "devel" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=41bb7e40692720ea7d7b034dc4afd191" + +# matches with tag v1.12.12 +SRCREV_ogre = "be8c2a225ecae636c8e669a12129b603db6b0e3c" +# matches with tag v1.79 +SRCREV_imgui = "e5cb04b132cba94f902beb6186cb58b864777012" +SRCREV_FORMAT = "ogre_imgui" + +SRC_URI = "git://github.com/OGRECave/ogre;protocol=https;name=ogre;branch=master \ + git://github.com/ocornut/imgui.git;protocol=https;name=imgui;subdir=imgui;branch=master \ + file://0001-CMakeLists.txt-don-t-set-RPATH.patch \ +" + +S = "${WORKDIR}/git" + +inherit cmake features_check pkgconfig python3native + +REQUIRED_DISTRO_FEATURES = "x11" + +DEPENDS = " \ + assimp \ + doxygen \ + freetype \ + freeimage \ + glslang \ + libsdl2 \ + libx11 \ + openexr \ + pugixml \ + spirv-tools \ + swig-native \ + vulkan-headers \ + zlib \ + ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'virtual/libgl libglu', '', d)} \ +" + +# extra flags from rviz-ogre-vendor ExternalProject_Add in: +# https://github.com/ros2/rviz/blob/16ad728224246ac8361e7073e1c89baec5a0eaf1/rviz_ogre_vendor/CMakeLists.txt#L162 +EXTRA_OECMAKE_RVIZ_OGRE_VENDOR = " \ + -DOGRE_STATIC:BOOL=OFF \ + -DOGRE_INSTALL_PDB:BOOL=OFF \ + -DOGRE_BUILD_DEPENDENCIES:BOOL=OFF \ + -DOGRE_BUILD_TESTS:BOOL=OFF \ + -DOGRE_BUILD_SAMPLES:BOOL=FALSE \ + -DOGRE_INSTALL_SAMPLES:BOOL=FALSE \ + -DOGRE_INSTALL_SAMPLES_SOURCE:BOOL=FALSE \ + -DOGRE_CONFIG_THREADS:STRING=0 \ + -DOGRE_RESOURCEMANAGER_STRICT:STRING=2 \ + -DOGRE_BUILD_LIBS_AS_FRAMEWORKS:BOOL=OFF \ + -DOGRE_BUILD_COMPONENT_PYTHON:BOOL=FALSE \ + -DOGRE_BUILD_COMPONENT_JAVA:BOOL=FALSE \ + -DOGRE_BUILD_COMPONENT_CSHARP:BOOL=FALSE \ + -DOGRE_BUILD_COMPONENT_BITES:BOOL=FALSE \ + -DDOGRE_BUILD_PLUGIN_GLSLANG:BOOL=ON \ + -DOGRE_BUILD_RENDERSYSTEM_GLES2:BOOL=TRUE \ + -DOGRE_GLSUPPORT_USE_EGL=ON \ + -DOGRE_BUILD_RENDERSYSTEM_VULKAN=ON \ + -DOGRE_BUILD_PLUGIN_GLSLANG=ON \ + -DIMGUI_DIR=${WORKDIR}/imgui \ +" + +EXTRA_OECMAKE += "${EXTRA_OECMAKE_RVIZ_OGRE_VENDOR}" + +FILES:${PN}-dev += "${libdir}/OGRE/cmake ${libdir}/OGRE/*${SOLIBSDEV}" +FILES:${PN} += "${datadir}/OGRE ${libdir}/OGRE" From c87a14bff6dd58c5da9190a497b29e4f72b923d8 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Thu, 23 May 2024 09:39:04 -0700 Subject: [PATCH 46/60] {humble} ignition-cmake2-vendor: Fix package dependency Remove the runtime dependency on ignition-cmake2-vendor. Signed-off-by: Rob Woolley --- .../ignition-cmake2-vendor_0.0.2-2.bbappend | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta-ros2-humble/recipes-bbappends/ignition-cmake2-vendor/ignition-cmake2-vendor_0.0.2-2.bbappend b/meta-ros2-humble/recipes-bbappends/ignition-cmake2-vendor/ignition-cmake2-vendor_0.0.2-2.bbappend index 1666f7c6725..eb8b66d4dee 100644 --- a/meta-ros2-humble/recipes-bbappends/ignition-cmake2-vendor/ignition-cmake2-vendor_0.0.2-2.bbappend +++ b/meta-ros2-humble/recipes-bbappends/ignition-cmake2-vendor/ignition-cmake2-vendor_0.0.2-2.bbappend @@ -16,3 +16,6 @@ ROS_BUILD_DEPENDS = " \ ament-cmake-test \ ament-cmake-xmllint \ " + +# Remove ignition-cmake2 which is not needed at runtime +ROS_EXEC_DEPENDS:remove = "ignition-cmake2" From c1f4ff8f9effd01c9d6776e29216e8d2a26875a8 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Thu, 23 May 2024 09:51:31 -0700 Subject: [PATCH 47/60] {humble} slam-toolbox: Fix package dependency Remove runtime dependency on ceres-solver. It provides source code which is not required at runtime. Signed-off-by: Rob Woolley --- .../slam-toolbox/slam-toolbox_2.6.8-1.bbappend | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta-ros2-humble/recipes-bbappends/slam-toolbox/slam-toolbox_2.6.8-1.bbappend b/meta-ros2-humble/recipes-bbappends/slam-toolbox/slam-toolbox_2.6.8-1.bbappend index e6b95db2031..9c31068404f 100644 --- a/meta-ros2-humble/recipes-bbappends/slam-toolbox/slam-toolbox_2.6.8-1.bbappend +++ b/meta-ros2-humble/recipes-bbappends/slam-toolbox/slam-toolbox_2.6.8-1.bbappend @@ -18,3 +18,6 @@ inherit pkgconfig ROS_BUILDTOOL_DEPENDS += " \ rosidl-default-generators-native \ " + +# Remove ceres-solver which is not needed at runtime +ROS_EXEC_DEPENDS:remove = "ceres-solver" From 11029015a49f040d12dab7ef25f526d106f0ab5c Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Thu, 23 May 2024 09:52:28 -0700 Subject: [PATCH 48/60] {humble} urdf: Add missing dependency The urdf package needs the urdf-parser-plugin at runtime. Signed-off-by: Rob Woolley --- .../recipes-bbappends/urdf/urdf_2.6.0-2.bbappend | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 meta-ros2-humble/recipes-bbappends/urdf/urdf_2.6.0-2.bbappend diff --git a/meta-ros2-humble/recipes-bbappends/urdf/urdf_2.6.0-2.bbappend b/meta-ros2-humble/recipes-bbappends/urdf/urdf_2.6.0-2.bbappend new file mode 100644 index 00000000000..cfed644fe3a --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/urdf/urdf_2.6.0-2.bbappend @@ -0,0 +1,5 @@ +# Add urdf-parser-plugin at runtime to resolve issues with robot_state_publisher +# +# [robot_state_publisher-1] terminate called after throwing an instance of 'pluginlib::ClassLoaderException' +# [robot_state_publisher-1] what(): package 'urdf_parser_plugin' not found, searching: [/usr] +ROS_EXEC_DEPENDS:append = " urdf-parser-plugin" From 5b585874718a3e3d15444e1eeb812ddd8d86f193 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Thu, 23 May 2024 11:53:45 -0700 Subject: [PATCH 49/60] {humble} usb-cam: Backport fix for newer ffmpeg The AVCodec type is const in newer releases of ffmpeg. Backporting an upstream fix to usb-cam resolves a build failure. Signed-off-by: Rob Woolley --- .../usb-cam/switch-to-a-const-avcodec.patch | 25 +++++++++++++++++++ .../usb-cam/usb-cam_0.8.0-1.bbappend | 3 +++ 2 files changed, 28 insertions(+) create mode 100644 meta-ros2-humble/recipes-bbappends/usb-cam/usb-cam/switch-to-a-const-avcodec.patch diff --git a/meta-ros2-humble/recipes-bbappends/usb-cam/usb-cam/switch-to-a-const-avcodec.patch b/meta-ros2-humble/recipes-bbappends/usb-cam/usb-cam/switch-to-a-const-avcodec.patch new file mode 100644 index 00000000000..d1debb0ce31 --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/usb-cam/usb-cam/switch-to-a-const-avcodec.patch @@ -0,0 +1,25 @@ +From 0e9fe355d55d137fcd876af1ae4d40e192c7d7b7 Mon Sep 17 00:00:00 2001 +From: Chris Lalancette +Date: Tue, 19 Mar 2024 18:35:04 +0000 +Subject: [PATCH] Switch to a const AVCodec *. + +This is because newer versions of avcodec return a const AVCodec *. + +Signed-off-by: Chris Lalancette +--- + include/usb_cam/formats/mjpeg.hpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/usb_cam/formats/mjpeg.hpp b/include/usb_cam/formats/mjpeg.hpp +index 2faff235..2b40bb2b 100644 +--- a/include/usb_cam/formats/mjpeg.hpp ++++ b/include/usb_cam/formats/mjpeg.hpp +@@ -233,7 +233,7 @@ class MJPEG2RGB : public pixel_format_base + std::cerr << m_averror_str << std::endl; + } + +- AVCodec * m_avcodec; ++ const AVCodec * m_avcodec; + AVCodecContext * m_avcodec_context; + AVCodecParserContext * m_avparser; + AVFrame * m_avframe_device; diff --git a/meta-ros2-humble/recipes-bbappends/usb-cam/usb-cam_0.8.0-1.bbappend b/meta-ros2-humble/recipes-bbappends/usb-cam/usb-cam_0.8.0-1.bbappend index 850c8ac8053..d28ca3e2264 100644 --- a/meta-ros2-humble/recipes-bbappends/usb-cam/usb-cam_0.8.0-1.bbappend +++ b/meta-ros2-humble/recipes-bbappends/usb-cam/usb-cam_0.8.0-1.bbappend @@ -5,3 +5,6 @@ CXXFLAGS += "-Wno-error=return-type" inherit pkgconfig + +FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" +SRC_URI += "file://switch-to-a-const-avcodec.patch" From 81473dd4b09d8819337fc3751f0b6f83d4b39b50 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Thu, 23 May 2024 13:45:06 -0700 Subject: [PATCH 50/60] {humble} draco: Update branch name Signed-off-by: Rob Woolley --- meta-ros2-humble/recipes-support/draco/draco_1.5.6.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-ros2-humble/recipes-support/draco/draco_1.5.6.bb b/meta-ros2-humble/recipes-support/draco/draco_1.5.6.bb index 27625cb742e..f2f13991ab7 100644 --- a/meta-ros2-humble/recipes-support/draco/draco_1.5.6.bb +++ b/meta-ros2-humble/recipes-support/draco/draco_1.5.6.bb @@ -6,10 +6,10 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=0f4fd4e8ed0e5c4d26044ac175a3eff8 \ file://third_party/tinygltf/LICENSE;md5=82f6e601fc2fd27cbf55d6f5f176d017 \ " -SRC_URI = "gitsm://github.com/google/draco.git;protocol=https;branch=master \ +SRC_URI = "gitsm://github.com/google/draco.git;protocol=https;branch=main \ file://0001-instrumentation.patch" -PV = "1.5.6+git${SRCPV}" +PV = "1.5.6" SRCREV = "9f856abaafb4b39f1f013763ff061522e0261c6f" S = "${WORKDIR}/git" From 4d2a899516b7d8a8b538de11361eb66fa7b27d82 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Thu, 23 May 2024 13:49:12 -0700 Subject: [PATCH 51/60] {common} ignition: Enable native dependencies These recipes are dependencies for build tools used to build ignition. Signed-off-by: Rob Woolley --- meta-ros-common/recipes-extended/libzip/libzip_%.bbappend | 2 ++ meta-ros-common/recipes-graphics/xorg-lib/libxv_%.bbappend | 2 ++ meta-ros-common/recipes-multimedia/ffmpeg/ffmpeg_%.bbappend | 2 ++ .../recipes-multimedia/libtheora/libtheora_%.bbappend | 2 ++ meta-ros-common/recipes-multimedia/webp/libwebp_%.bbappend | 2 ++ meta-ros-common/recipes-support/libraw/libraw_%.bbappend | 2 ++ 6 files changed, 12 insertions(+) create mode 100644 meta-ros-common/recipes-extended/libzip/libzip_%.bbappend create mode 100644 meta-ros-common/recipes-graphics/xorg-lib/libxv_%.bbappend create mode 100644 meta-ros-common/recipes-multimedia/ffmpeg/ffmpeg_%.bbappend create mode 100644 meta-ros-common/recipes-multimedia/libtheora/libtheora_%.bbappend create mode 100644 meta-ros-common/recipes-multimedia/webp/libwebp_%.bbappend create mode 100644 meta-ros-common/recipes-support/libraw/libraw_%.bbappend diff --git a/meta-ros-common/recipes-extended/libzip/libzip_%.bbappend b/meta-ros-common/recipes-extended/libzip/libzip_%.bbappend new file mode 100644 index 00000000000..12ed69f9620 --- /dev/null +++ b/meta-ros-common/recipes-extended/libzip/libzip_%.bbappend @@ -0,0 +1,2 @@ +# Copyright (c) 2024 Wind River Systems, Inc. +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-ros-common/recipes-graphics/xorg-lib/libxv_%.bbappend b/meta-ros-common/recipes-graphics/xorg-lib/libxv_%.bbappend new file mode 100644 index 00000000000..12ed69f9620 --- /dev/null +++ b/meta-ros-common/recipes-graphics/xorg-lib/libxv_%.bbappend @@ -0,0 +1,2 @@ +# Copyright (c) 2024 Wind River Systems, Inc. +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-ros-common/recipes-multimedia/ffmpeg/ffmpeg_%.bbappend b/meta-ros-common/recipes-multimedia/ffmpeg/ffmpeg_%.bbappend new file mode 100644 index 00000000000..12ed69f9620 --- /dev/null +++ b/meta-ros-common/recipes-multimedia/ffmpeg/ffmpeg_%.bbappend @@ -0,0 +1,2 @@ +# Copyright (c) 2024 Wind River Systems, Inc. +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-ros-common/recipes-multimedia/libtheora/libtheora_%.bbappend b/meta-ros-common/recipes-multimedia/libtheora/libtheora_%.bbappend new file mode 100644 index 00000000000..12ed69f9620 --- /dev/null +++ b/meta-ros-common/recipes-multimedia/libtheora/libtheora_%.bbappend @@ -0,0 +1,2 @@ +# Copyright (c) 2024 Wind River Systems, Inc. +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-ros-common/recipes-multimedia/webp/libwebp_%.bbappend b/meta-ros-common/recipes-multimedia/webp/libwebp_%.bbappend new file mode 100644 index 00000000000..12ed69f9620 --- /dev/null +++ b/meta-ros-common/recipes-multimedia/webp/libwebp_%.bbappend @@ -0,0 +1,2 @@ +# Copyright (c) 2024 Wind River Systems, Inc. +BBCLASSEXTEND = "native nativesdk" diff --git a/meta-ros-common/recipes-support/libraw/libraw_%.bbappend b/meta-ros-common/recipes-support/libraw/libraw_%.bbappend new file mode 100644 index 00000000000..12ed69f9620 --- /dev/null +++ b/meta-ros-common/recipes-support/libraw/libraw_%.bbappend @@ -0,0 +1,2 @@ +# Copyright (c) 2024 Wind River Systems, Inc. +BBCLASSEXTEND = "native nativesdk" From ee7f1f21525bc364cb9d0f7880b716609e070471 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Thu, 23 May 2024 14:02:54 -0700 Subject: [PATCH 52/60] {ros2} libdeflate: Extend recipe for native builds The libdeflate library is needed for ignition-common4-native. Signed-off-by: Rob Woolley --- meta-ros2/recipes-devtools/libdeflate/libdeflate_1.19.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/meta-ros2/recipes-devtools/libdeflate/libdeflate_1.19.bb b/meta-ros2/recipes-devtools/libdeflate/libdeflate_1.19.bb index 11cdb829052..e5668ae0d43 100644 --- a/meta-ros2/recipes-devtools/libdeflate/libdeflate_1.19.bb +++ b/meta-ros2/recipes-devtools/libdeflate/libdeflate_1.19.bb @@ -13,3 +13,4 @@ SRCREV = "dd12ff2b36d603dbb7fa8838fe7e7176fcbd4f6f" inherit cmake pkgconfig +BBCLASSEXTEND = "native nativesdk" From 7ba3d25c2c45bfff0763a96d361c754054d6f6ac Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Thu, 23 May 2024 14:16:25 -0700 Subject: [PATCH 53/60] {humble} rqt-moveit: Add files to package Signed-off-by: Rob Woolley --- .../recipes-bbappends/rqt-moveit/rqt-moveit_1.0.1-3.bbappend | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 meta-ros2-humble/recipes-bbappends/rqt-moveit/rqt-moveit_1.0.1-3.bbappend diff --git a/meta-ros2-humble/recipes-bbappends/rqt-moveit/rqt-moveit_1.0.1-3.bbappend b/meta-ros2-humble/recipes-bbappends/rqt-moveit/rqt-moveit_1.0.1-3.bbappend new file mode 100644 index 00000000000..d739f76c5a5 --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/rqt-moveit/rqt-moveit_1.0.1-3.bbappend @@ -0,0 +1,3 @@ +# Copyright (c) 2024 Wind River Systems, Inc. + +FILES:${PN} += "${datadir}/lib/rqt_moveit" From e761a0a4ec59dc9bb02b9084d45805a2c7edef30 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Thu, 23 May 2024 14:17:00 -0700 Subject: [PATCH 54/60] {humble} rqt-gui: Add files to package Signed-off-by: Rob Woolley --- .../recipes-bbappends/rqt/rqt-gui_1.1.7-1.bbappend | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 meta-ros2-humble/recipes-bbappends/rqt/rqt-gui_1.1.7-1.bbappend diff --git a/meta-ros2-humble/recipes-bbappends/rqt/rqt-gui_1.1.7-1.bbappend b/meta-ros2-humble/recipes-bbappends/rqt/rqt-gui_1.1.7-1.bbappend new file mode 100644 index 00000000000..ed14882210b --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/rqt/rqt-gui_1.1.7-1.bbappend @@ -0,0 +1,3 @@ +# Copyright (c) 2024 Wind River Systems, Inc. + +FILES:${PN} += "${datadir}/lib/rqt_gui" From d22cff71c16c736014d56791ba37a8d9d8eee7f2 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Thu, 23 May 2024 14:32:00 -0700 Subject: [PATCH 55/60] {humble} gazebo-ros: Add missing build dependencies Signed-off-by: Rob Woolley --- .../gazebo-ros-pkgs/gazebo-ros_3.7.0-1.bbappend | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 meta-ros2-humble/recipes-bbappends/gazebo-ros-pkgs/gazebo-ros_3.7.0-1.bbappend diff --git a/meta-ros2-humble/recipes-bbappends/gazebo-ros-pkgs/gazebo-ros_3.7.0-1.bbappend b/meta-ros2-humble/recipes-bbappends/gazebo-ros-pkgs/gazebo-ros_3.7.0-1.bbappend new file mode 100644 index 00000000000..4d0a9f416f5 --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/gazebo-ros-pkgs/gazebo-ros_3.7.0-1.bbappend @@ -0,0 +1,7 @@ +# Copyright (c) 2024 Wind River Systems, Inc. + +inherit pkgconfig + +ROS_BUILD_DEPENDS += " \ + rosidl-adapter-native \ +" From 0dffc52dc78b278932eb72cc30fa7d6ca3711823 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Thu, 23 May 2024 14:54:13 -0700 Subject: [PATCH 56/60] {humble} gazebo-plugins: Inherit pkgconfig Signed-off-by: Rob Woolley --- .../gazebo-ros-pkgs/gazebo-plugins_3.7.0-1.bbappend | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 meta-ros2-humble/recipes-bbappends/gazebo-ros-pkgs/gazebo-plugins_3.7.0-1.bbappend diff --git a/meta-ros2-humble/recipes-bbappends/gazebo-ros-pkgs/gazebo-plugins_3.7.0-1.bbappend b/meta-ros2-humble/recipes-bbappends/gazebo-ros-pkgs/gazebo-plugins_3.7.0-1.bbappend new file mode 100644 index 00000000000..11a956ee654 --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/gazebo-ros-pkgs/gazebo-plugins_3.7.0-1.bbappend @@ -0,0 +1,3 @@ +# Copyright (c) 2024 Wind River Systems, Inc. + +inherit pkgconfig From abc97d3543b66e12b0f11c0c43d798a5c2bfbfe9 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Thu, 23 May 2024 14:58:08 -0700 Subject: [PATCH 57/60] {humble} dolly-gazebo: Add build dependencies Signed-off-by: Rob Woolley --- .../recipes-bbappends/dolly/dolly-gazebo_0.4.0-3.bbappend | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 meta-ros2-humble/recipes-bbappends/dolly/dolly-gazebo_0.4.0-3.bbappend diff --git a/meta-ros2-humble/recipes-bbappends/dolly/dolly-gazebo_0.4.0-3.bbappend b/meta-ros2-humble/recipes-bbappends/dolly/dolly-gazebo_0.4.0-3.bbappend new file mode 100644 index 00000000000..504c2713710 --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/dolly/dolly-gazebo_0.4.0-3.bbappend @@ -0,0 +1,5 @@ +# Copyright (c) 2024 Wind River Systems, Inc. + +inherit pkgconfig + +DEPENDS += "gazebo11" From 8d088a6d96e26002d447321c06f7d90f06c57f31 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Thu, 23 May 2024 16:01:09 -0700 Subject: [PATCH 58/60] {humble} rqt-*: Add missing files to packages Signed-off-by: Rob Woolley --- .../recipes-bbappends/rqt-bag/rqt-bag_1.1.4-1.bbappend | 3 +++ .../recipes-bbappends/rqt-graph/rqt-graph_1.3.0-1.bbappend | 3 +++ .../rqt-robot-steering/rqt-robot-steering_1.0.0-4.bbappend | 3 +++ 3 files changed, 9 insertions(+) create mode 100644 meta-ros2-humble/recipes-bbappends/rqt-bag/rqt-bag_1.1.4-1.bbappend create mode 100644 meta-ros2-humble/recipes-bbappends/rqt-graph/rqt-graph_1.3.0-1.bbappend create mode 100644 meta-ros2-humble/recipes-bbappends/rqt-robot-steering/rqt-robot-steering_1.0.0-4.bbappend diff --git a/meta-ros2-humble/recipes-bbappends/rqt-bag/rqt-bag_1.1.4-1.bbappend b/meta-ros2-humble/recipes-bbappends/rqt-bag/rqt-bag_1.1.4-1.bbappend new file mode 100644 index 00000000000..305f070854b --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/rqt-bag/rqt-bag_1.1.4-1.bbappend @@ -0,0 +1,3 @@ +# Copyright (c) 2024 Wind River Systems, Inc. + +FILES:${PN} += "${datadir}/lib/rqt_bag" diff --git a/meta-ros2-humble/recipes-bbappends/rqt-graph/rqt-graph_1.3.0-1.bbappend b/meta-ros2-humble/recipes-bbappends/rqt-graph/rqt-graph_1.3.0-1.bbappend new file mode 100644 index 00000000000..829235c94a7 --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/rqt-graph/rqt-graph_1.3.0-1.bbappend @@ -0,0 +1,3 @@ +# Copyright (c) 2024 Wind River Systems, Inc. + +FILES:${PN} += "${datadir}/lib/rqt_graph" diff --git a/meta-ros2-humble/recipes-bbappends/rqt-robot-steering/rqt-robot-steering_1.0.0-4.bbappend b/meta-ros2-humble/recipes-bbappends/rqt-robot-steering/rqt-robot-steering_1.0.0-4.bbappend new file mode 100644 index 00000000000..d2d75bc8368 --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/rqt-robot-steering/rqt-robot-steering_1.0.0-4.bbappend @@ -0,0 +1,3 @@ +# Copyright (c) 2024 Wind River Systems, Inc. + +FILES:${PN} += "${datadir}/lib/rqt_robot_steering" From 064b125de532065eced6fced2a146511e16233ea Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Thu, 23 May 2024 17:46:41 -0700 Subject: [PATCH 59/60] {humble} libtins: Add openssl dependency Signed-off-by: Rob Woolley --- meta-ros2-humble/recipes-support/libtins/libtins_4.4.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta-ros2-humble/recipes-support/libtins/libtins_4.4.bb b/meta-ros2-humble/recipes-support/libtins/libtins_4.4.bb index 38586636c75..8b39286709e 100644 --- a/meta-ros2-humble/recipes-support/libtins/libtins_4.4.bb +++ b/meta-ros2-humble/recipes-support/libtins/libtins_4.4.bb @@ -3,7 +3,7 @@ DESCRIPTION = "" DESCRIPTION = "High-level, multiplatform C++ network packet sniffing and crafting library." HOMEPAGE = "http://libtins.github.io/" SECTION = "examples" -DEPENDS = "libpcap" +DEPENDS = "libpcap openssl" LICENSE = "BSD-2-Clause" LIC_FILES_CHKSUM = "file://LICENSE;md5=dcaaaf1a01e7f9ceb200d383a0d4320c" From 80da752305a4b98b4b322f75161c7e3ab48249f4 Mon Sep 17 00:00:00 2001 From: Rob Woolley Date: Thu, 23 May 2024 17:47:19 -0700 Subject: [PATCH 60/60] {humble} gc-spl: Fix upstream SRC_URI The branches listed in the generated recipes have been deleted upstream. This means that the commit ids are orphaned and don't have an associated branch. However, a duplicate repository named game_controller_spl-release still has the branches intact. Using bbappend to set the SRC_URI allows the do_fetch task to succeed. Missing build dependencies are also added to game-controller-spl-interfaces matching the fix required for other interface recipes. Signed-off-by: Rob Woolley --- .../game-controller-spl-interfaces_2.1.0-1.bbappend | 11 +++++++++++ .../gc-spl/game-controller-spl_2.1.0-1.bbappend | 3 +++ .../gc-spl/gc-spl-2022_2.1.0-1.bbappend | 3 +++ .../gc-spl/gc-spl-interfaces_2.1.0-1.bbappend | 11 +++++++++++ .../recipes-bbappends/gc-spl/gc-spl_2.1.0-1.bbappend | 3 +++ .../gc-spl/rcgcd-spl-14-conversion_2.1.0-1.bbappend | 3 +++ .../gc-spl/rcgcd-spl-14_2.1.0-1.bbappend | 2 ++ .../gc-spl/rcgcrd-spl-4-conversion_2.1.0-1.bbappend | 3 +++ .../gc-spl/rcgcrd-spl-4_2.1.0-1.bbappend | 2 ++ 9 files changed, 41 insertions(+) create mode 100644 meta-ros2-humble/recipes-bbappends/gc-spl/game-controller-spl-interfaces_2.1.0-1.bbappend create mode 100644 meta-ros2-humble/recipes-bbappends/gc-spl/game-controller-spl_2.1.0-1.bbappend create mode 100644 meta-ros2-humble/recipes-bbappends/gc-spl/gc-spl-2022_2.1.0-1.bbappend create mode 100644 meta-ros2-humble/recipes-bbappends/gc-spl/gc-spl-interfaces_2.1.0-1.bbappend create mode 100644 meta-ros2-humble/recipes-bbappends/gc-spl/gc-spl_2.1.0-1.bbappend create mode 100644 meta-ros2-humble/recipes-bbappends/gc-spl/rcgcd-spl-14-conversion_2.1.0-1.bbappend create mode 100644 meta-ros2-humble/recipes-bbappends/gc-spl/rcgcrd-spl-4-conversion_2.1.0-1.bbappend diff --git a/meta-ros2-humble/recipes-bbappends/gc-spl/game-controller-spl-interfaces_2.1.0-1.bbappend b/meta-ros2-humble/recipes-bbappends/gc-spl/game-controller-spl-interfaces_2.1.0-1.bbappend new file mode 100644 index 00000000000..938dea8ba58 --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/gc-spl/game-controller-spl-interfaces_2.1.0-1.bbappend @@ -0,0 +1,11 @@ +# Copyright (c) 2024, Wind River Systems, Inc. + +SRC_URI = "git://github.com/ros2-gbp/game_controller_spl-release;${ROS_BRANCH};protocol=https" + +ROS_BUILDTOOL_DEPENDS += " \ + rosidl-default-generators-native \ +" + +ROS_BUILD_DEPENDS += " \ + rosidl-default-runtime \ +" diff --git a/meta-ros2-humble/recipes-bbappends/gc-spl/game-controller-spl_2.1.0-1.bbappend b/meta-ros2-humble/recipes-bbappends/gc-spl/game-controller-spl_2.1.0-1.bbappend new file mode 100644 index 00000000000..2c49a5c89e3 --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/gc-spl/game-controller-spl_2.1.0-1.bbappend @@ -0,0 +1,3 @@ +# Copyright (c) 2024, Wind River Systems, Inc. + +SRC_URI = "git://github.com/ros2-gbp/game_controller_spl-release;${ROS_BRANCH};protocol=https" diff --git a/meta-ros2-humble/recipes-bbappends/gc-spl/gc-spl-2022_2.1.0-1.bbappend b/meta-ros2-humble/recipes-bbappends/gc-spl/gc-spl-2022_2.1.0-1.bbappend new file mode 100644 index 00000000000..2c49a5c89e3 --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/gc-spl/gc-spl-2022_2.1.0-1.bbappend @@ -0,0 +1,3 @@ +# Copyright (c) 2024, Wind River Systems, Inc. + +SRC_URI = "git://github.com/ros2-gbp/game_controller_spl-release;${ROS_BRANCH};protocol=https" diff --git a/meta-ros2-humble/recipes-bbappends/gc-spl/gc-spl-interfaces_2.1.0-1.bbappend b/meta-ros2-humble/recipes-bbappends/gc-spl/gc-spl-interfaces_2.1.0-1.bbappend new file mode 100644 index 00000000000..938dea8ba58 --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/gc-spl/gc-spl-interfaces_2.1.0-1.bbappend @@ -0,0 +1,11 @@ +# Copyright (c) 2024, Wind River Systems, Inc. + +SRC_URI = "git://github.com/ros2-gbp/game_controller_spl-release;${ROS_BRANCH};protocol=https" + +ROS_BUILDTOOL_DEPENDS += " \ + rosidl-default-generators-native \ +" + +ROS_BUILD_DEPENDS += " \ + rosidl-default-runtime \ +" diff --git a/meta-ros2-humble/recipes-bbappends/gc-spl/gc-spl_2.1.0-1.bbappend b/meta-ros2-humble/recipes-bbappends/gc-spl/gc-spl_2.1.0-1.bbappend new file mode 100644 index 00000000000..2c49a5c89e3 --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/gc-spl/gc-spl_2.1.0-1.bbappend @@ -0,0 +1,3 @@ +# Copyright (c) 2024, Wind River Systems, Inc. + +SRC_URI = "git://github.com/ros2-gbp/game_controller_spl-release;${ROS_BRANCH};protocol=https" diff --git a/meta-ros2-humble/recipes-bbappends/gc-spl/rcgcd-spl-14-conversion_2.1.0-1.bbappend b/meta-ros2-humble/recipes-bbappends/gc-spl/rcgcd-spl-14-conversion_2.1.0-1.bbappend new file mode 100644 index 00000000000..2c49a5c89e3 --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/gc-spl/rcgcd-spl-14-conversion_2.1.0-1.bbappend @@ -0,0 +1,3 @@ +# Copyright (c) 2024, Wind River Systems, Inc. + +SRC_URI = "git://github.com/ros2-gbp/game_controller_spl-release;${ROS_BRANCH};protocol=https" diff --git a/meta-ros2-humble/recipes-bbappends/gc-spl/rcgcd-spl-14_2.1.0-1.bbappend b/meta-ros2-humble/recipes-bbappends/gc-spl/rcgcd-spl-14_2.1.0-1.bbappend index 3bd6a1e3973..6ac4bf5327c 100644 --- a/meta-ros2-humble/recipes-bbappends/gc-spl/rcgcd-spl-14_2.1.0-1.bbappend +++ b/meta-ros2-humble/recipes-bbappends/gc-spl/rcgcd-spl-14_2.1.0-1.bbappend @@ -3,3 +3,5 @@ ROS_BUILDTOOL_DEPENDS += " \ rosidl-cmake-native \ " + +SRC_URI = "git://github.com/ros2-gbp/game_controller_spl-release;${ROS_BRANCH};protocol=https" diff --git a/meta-ros2-humble/recipes-bbappends/gc-spl/rcgcrd-spl-4-conversion_2.1.0-1.bbappend b/meta-ros2-humble/recipes-bbappends/gc-spl/rcgcrd-spl-4-conversion_2.1.0-1.bbappend new file mode 100644 index 00000000000..2c49a5c89e3 --- /dev/null +++ b/meta-ros2-humble/recipes-bbappends/gc-spl/rcgcrd-spl-4-conversion_2.1.0-1.bbappend @@ -0,0 +1,3 @@ +# Copyright (c) 2024, Wind River Systems, Inc. + +SRC_URI = "git://github.com/ros2-gbp/game_controller_spl-release;${ROS_BRANCH};protocol=https" diff --git a/meta-ros2-humble/recipes-bbappends/gc-spl/rcgcrd-spl-4_2.1.0-1.bbappend b/meta-ros2-humble/recipes-bbappends/gc-spl/rcgcrd-spl-4_2.1.0-1.bbappend index 3bd6a1e3973..6ac4bf5327c 100644 --- a/meta-ros2-humble/recipes-bbappends/gc-spl/rcgcrd-spl-4_2.1.0-1.bbappend +++ b/meta-ros2-humble/recipes-bbappends/gc-spl/rcgcrd-spl-4_2.1.0-1.bbappend @@ -3,3 +3,5 @@ ROS_BUILDTOOL_DEPENDS += " \ rosidl-cmake-native \ " + +SRC_URI = "git://github.com/ros2-gbp/game_controller_spl-release;${ROS_BRANCH};protocol=https"