diff --git a/base.sh b/base.sh index b747284f522bb4186ab3c2d0a3fca4ccef6c46c8..ad256db34d465aa3678baae2bc986f80127b3c91 100755 --- a/base.sh +++ b/base.sh @@ -28,14 +28,14 @@ mkdir -p ${ROS_OUTPUT_TMP} error_log() { - echo -e "\n`date` [Error] $*" - echo -e "\n`date` [Error] $*" >>${LOG} + echo "`date` [Error] $*" + echo "`date` [Error] $*" >>${LOG} } info_log() { - echo -e "\n`date` [Info ] $*" - echo -e "\n`date` [Info ] $*" >> ${LOG} + echo "`date` [Info ] $*" + echo "`date` [Info ] $*" >> ${LOG} } debug_log() @@ -44,8 +44,8 @@ debug_log() then return fi - echo -e "\n`date` [Debug] $*" - echo -e "\n`date` [Debug] $*" >> ${LOG} + echo "`date` [Debug] $*" + echo "`date` [Debug] $*" >> ${LOG} } if [ "${ROS_DISTRO}" = "" ] diff --git a/bb_fix/all.remove b/bb_fix/all.remove new file mode 100644 index 0000000000000000000000000000000000000000..118ea2b150144b636b43f4e9bff7d204226c01ee --- /dev/null +++ b/bb_fix/all.remove @@ -0,0 +1,11 @@ +gcc +gcc-native +g++ +g++-native +gcc-c++ +gcc-c++-native +gdb +gdb-native +libatomic +libatomic-native +cmake diff --git a/bb_fix/ament-cmake-core/fix/DEPENDS b/bb_fix/ament-cmake-core/fix/DEPENDS new file mode 100644 index 0000000000000000000000000000000000000000..b5392e2531fb8d407cf73d6081944392538048c4 --- /dev/null +++ b/bb_fix/ament-cmake-core/fix/DEPENDS @@ -0,0 +1,4 @@ +-ament-package ++ament-package-native +-python3-catkin_pkg ++python3-catkin_pkg-native diff --git a/bb_fix/ament-cmake-gtest/fix/DEPENDS b/bb_fix/ament-cmake-gtest/fix/DEPENDS new file mode 100644 index 0000000000000000000000000000000000000000..e20d810b0e0d54ce714194e2ea352fbb3da6533a --- /dev/null +++ b/bb_fix/ament-cmake-gtest/fix/DEPENDS @@ -0,0 +1 @@ ++gtest diff --git a/bb_fix/ament-cmake-ros/fix/DEPENDS b/bb_fix/ament-cmake-ros/fix/DEPENDS new file mode 100644 index 0000000000000000000000000000000000000000..c59f51a169dce724bac62f97acee3272f46f2a7f --- /dev/null +++ b/bb_fix/ament-cmake-ros/fix/DEPENDS @@ -0,0 +1,2 @@ ++ament-cmake-gmock-native ++ament-cmake-pytest-native diff --git a/bb_fix/ament-cmake-ros/fix/RDEPENDS b/bb_fix/ament-cmake-ros/fix/RDEPENDS new file mode 100644 index 0000000000000000000000000000000000000000..cf13230f565d38743975057cf5f72a8b92f476a8 --- /dev/null +++ b/bb_fix/ament-cmake-ros/fix/RDEPENDS @@ -0,0 +1,4 @@ +-ament-cmake-native +-ament-cmake-gmock-native +-ament-cmake-gtest-native +-ament-cmake-pytest-native diff --git a/bb_fix/console-bridge/fix/APPENDS b/bb_fix/console-bridge/fix/APPENDS new file mode 100644 index 0000000000000000000000000000000000000000..a99387cc99e1cd6766b87ee00012e3e8c8f748c7 --- /dev/null +++ b/bb_fix/console-bridge/fix/APPENDS @@ -0,0 +1 @@ +BPN = "console_bridge" diff --git a/bb_fix/cppcheck/fix/APPENDS b/bb_fix/cppcheck/fix/APPENDS new file mode 100644 index 0000000000000000000000000000000000000000..56e4d8f9f60e64201459ba1ac47a821fbc461038 --- /dev/null +++ b/bb_fix/cppcheck/fix/APPENDS @@ -0,0 +1,3 @@ +FILES:${PN} += " \ + ${datadir}/Cppcheck \ +" diff --git a/bb_fix/cppcheck/fix/DEPENDS b/bb_fix/cppcheck/fix/DEPENDS new file mode 100644 index 0000000000000000000000000000000000000000..5f1841c5f86bfed9fa544fa69f76bbf3f1c68133 --- /dev/null +++ b/bb_fix/cppcheck/fix/DEPENDS @@ -0,0 +1 @@ +-docbook-style-xsl-native diff --git a/bb_fix/cppcheck/fix/RDEPENDS b/bb_fix/cppcheck/fix/RDEPENDS new file mode 100644 index 0000000000000000000000000000000000000000..45b1e70d24582d7d0a3066ccf0e8da9cf62f5e73 --- /dev/null +++ b/bb_fix/cppcheck/fix/RDEPENDS @@ -0,0 +1 @@ +-python3-unversioned-command diff --git a/bb_fix/fastrtps/fix/APPENDS b/bb_fix/fastrtps/fix/APPENDS new file mode 100644 index 0000000000000000000000000000000000000000..864c78424a0c6b15ccc518bf9559c4279af50a98 --- /dev/null +++ b/bb_fix/fastrtps/fix/APPENDS @@ -0,0 +1,6 @@ +FILES:${PN} += " \ + ${prefix}/tools \ +" +SYSROOT_DIRS:append =" \ + ${prefix}/bin \ +" diff --git a/bb_fix/fastrtps/fix/DEPENDS b/bb_fix/fastrtps/fix/DEPENDS new file mode 100644 index 0000000000000000000000000000000000000000..b4f7bf63185346ddeed550f1f28931e99e0d34f5 --- /dev/null +++ b/bb_fix/fastrtps/fix/DEPENDS @@ -0,0 +1,2 @@ +-asio-native ++asio diff --git a/bb_fix/foonathan-memory-vendor/fix/APPENDS b/bb_fix/foonathan-memory-vendor/fix/APPENDS new file mode 100644 index 0000000000000000000000000000000000000000..007e8b3a917487c6530cb9856fb2f1a322f69696 --- /dev/null +++ b/bb_fix/foonathan-memory-vendor/fix/APPENDS @@ -0,0 +1,18 @@ +SYSROOT_DIRS_NATIVE:append = " \ + ${prefix}/lib64 \ + ${prefix}/lib \ +" + +SYSROOT_DIRS:append = " \ + ${prefix}/bin \ +" +FILES:${PN}:append = " \ + ${prefix}/lib/foonathan_memory \ + ${prefix}/bin \ +" + +PROVIDES += "foonathan-memory" + +do_configure:prepend() { + cp ${OPENEULER_SP_DIR}/foonathan_memory_vendor/memory-0.7-1.tar.gz ${S} +} diff --git a/bb_fix/foonathan-memory-vendor/fix/RDEPENDS b/bb_fix/foonathan-memory-vendor/fix/RDEPENDS new file mode 100644 index 0000000000000000000000000000000000000000..95420e987e8f3f339265670f0ad783d5d9f229b8 --- /dev/null +++ b/bb_fix/foonathan-memory-vendor/fix/RDEPENDS @@ -0,0 +1,2 @@ +-cmake-native ++cmake diff --git a/bb_fix/gmock-vendor/fix/APPENDS b/bb_fix/gmock-vendor/fix/APPENDS new file mode 100644 index 0000000000000000000000000000000000000000..1096e3296e7c5c645a27f29a9aabe0f6d43ac1c0 --- /dev/null +++ b/bb_fix/gmock-vendor/fix/APPENDS @@ -0,0 +1,3 @@ +FILES:${PN} += " \ + ${ros_prefix}/src \ +" diff --git a/bb_fix/gtest-vendor/fix/APPENDS b/bb_fix/gtest-vendor/fix/APPENDS new file mode 100644 index 0000000000000000000000000000000000000000..1096e3296e7c5c645a27f29a9aabe0f6d43ac1c0 --- /dev/null +++ b/bb_fix/gtest-vendor/fix/APPENDS @@ -0,0 +1,3 @@ +FILES:${PN} += " \ + ${ros_prefix}/src \ +" diff --git a/bb_fix/gtest/fix/APPENDS b/bb_fix/gtest/fix/APPENDS new file mode 100644 index 0000000000000000000000000000000000000000..a0f8794c768b374dad7ed9325c63665ec6e7b690 --- /dev/null +++ b/bb_fix/gtest/fix/APPENDS @@ -0,0 +1 @@ +RPROVIDES:${PN} += "gmock" diff --git a/bb_fix/iceoryx-posh/fix/APPENDS b/bb_fix/iceoryx-posh/fix/APPENDS new file mode 100644 index 0000000000000000000000000000000000000000..5f4c0aafef351c9dfae7dd49251d13f14e929ddd --- /dev/null +++ b/bb_fix/iceoryx-posh/fix/APPENDS @@ -0,0 +1,3 @@ +do_configure:prepend() { + cp ${OPENEULER_SP_DIR}/iceoryx/cpptoml-0.1.1.tar.gz ${S}/cmake/cpptoml +} diff --git a/bb_fix/ignition-cmake2-vendor/fix/APPENDS b/bb_fix/ignition-cmake2-vendor/fix/APPENDS new file mode 100644 index 0000000000000000000000000000000000000000..4a00a30b0580d6316877fa737e60a4773c62d249 --- /dev/null +++ b/bb_fix/ignition-cmake2-vendor/fix/APPENDS @@ -0,0 +1,3 @@ +do_configure:prepend() { + cp ${OPENEULER_SP_DIR}/ignition_cmake2_vendor/ignition-cmake2_2.8.0.tar.gz ${S} +} diff --git a/bb_fix/ignition-math6-vendor/fix/APPENDS b/bb_fix/ignition-math6-vendor/fix/APPENDS new file mode 100644 index 0000000000000000000000000000000000000000..491f53afb83930e2b3bdeef096ff94c9d1cab7a1 --- /dev/null +++ b/bb_fix/ignition-math6-vendor/fix/APPENDS @@ -0,0 +1,3 @@ +do_configure:prepend() { + cp ${OPENEULER_SP_DIR}/ignition_math6_vendor/ignition-math6_6.9.2.tar.gz ${S} +} diff --git a/bb_fix/libyaml-vendor/fix/APPENDS b/bb_fix/libyaml-vendor/fix/APPENDS new file mode 100644 index 0000000000000000000000000000000000000000..2e35e7281f89266b87b2d1f2d919074414597bee --- /dev/null +++ b/bb_fix/libyaml-vendor/fix/APPENDS @@ -0,0 +1,17 @@ +do_configure:prepend() { + cp ${OPENEULER_SP_DIR}/libyaml_vendor/libyaml-0.2.5.tar.gz ${S} +} + +SYSROOT_DIRS:append = " \ + ${ros_prefix}/cmake \ +" + +FILES:${PN}:append = " \ + ${ros_prefix}/lib \ +" +FILES:${PN}-dev:remove = "\ + ${ros_prefix}/lib/lib*.so \ +" +FILES:${PN}-dev:append = " \ + ${ros_prefix}/cmake \ +" diff --git a/bb_fix/mimick-vendor/fix/APPENDS b/bb_fix/mimick-vendor/fix/APPENDS new file mode 100644 index 0000000000000000000000000000000000000000..ff65a24733c12749010deea9dc0f1710033248ce --- /dev/null +++ b/bb_fix/mimick-vendor/fix/APPENDS @@ -0,0 +1,4 @@ +do_configure:prepend() { + cp ${OPENEULER_SP_DIR}/mimick_vendor/Mimick-de11f8377eb95f932a03707b583bf3d4ce5bd3e7.tar.gz ${S} + cp ${OPENEULER_SP_DIR}/mimick_vendor/0-Mimick-remove-compile-flag-o0.patch ${S} +} diff --git a/bb_fix/pkg.remap b/bb_fix/pkg.remap new file mode 100644 index 0000000000000000000000000000000000000000..4b0ac09e0d5e47926266b646c4ea2d4cf0a8b342 --- /dev/null +++ b/bb_fix/pkg.remap @@ -0,0 +1,65 @@ +python3-setuptools_scm python3-setuptools-scm +gcc-c++ g++ +python3-PyYAML python3-pyyaml +libacl acl +libacl-devel acl +python3-yaml python3-pyyaml +gmock-devel gtest +cmake cmake-native +git git-native +#change all ament_cmake to native because they are tool package +ament-cmake ament-cmake-native +ament-cmake-auto ament-cmake-auto-native +ament-cmake-core ament-cmake-core-native +ament-cmake-export-definitions ament-cmake-export-definitions-native +ament-cmake-export-dependencies ament-cmake-export-dependencies-native +ament-cmake-export-include-directories ament-cmake-export-include-directories-native +ament-cmake-export-interfaces ament-cmake-export-interfaces-native +ament-cmake-export-libraries ament-cmake-export-libraries-native +ament-cmake-export-link-flags ament-cmake-export-link-flags-native +ament-cmake-export-targets ament-cmake-export-targets-native +ament-cmake-gen-version-h ament-cmake-gen-version-h-native +ament-cmake-gmock ament-cmake-gmock-native +ament-cmake-google-benchmark ament-cmake-google-benchmark-native +ament-cmake-gtest ament-cmake-gtest-native +ament-cmake-include-directories ament-cmake-include-directories-native +ament-cmake-libraries ament-cmake-libraries-native +ament-cmake-nose ament-cmake-nose-native +ament-cmake-pytest ament-cmake-pytest-native +ament-cmake-python ament-cmake-python-native +ament-cmake-target-dependencies ament-cmake-target-dependencies-native +ament-cmake-test ament-cmake-test-native +ament-cmake-version ament-cmake-version-native +#change all ament_lint to native because they are tool package +ment-clang-format ament-clang-format-native +ament-clang-tidy ament-clang-tidy-native +ament-cmake-clang-format ament-cmake-clang-format-native +ament-cmake-clang-tidy ament-cmake-clang-tidy-native +ament-cmake-copyright ament-cmake-copyright-native +ament-cmake-cppcheck ament-cmake-cppcheck-native +ament-cmake-cpplint ament-cmake-cpplint-native +ament-cmake-flake8 ament-cmake-flake8-native +ament-cmake-lint-cmake ament-cmake-lint-cmake-native +ament-cmake-mypy ament-cmake-mypy-native +ament-cmake-pclint ament-cmake-pclint-native +ament-cmake-pep257 ament-cmake-pep257-native +ament-cmake-pycodestyle ament-cmake-pycodestyle-native +ament-cmake-pyflakes ament-cmake-pyflakes-native +ament-cmake-uncrustify ament-cmake-uncrustify-native +ament-cmake-xmllint ament-cmake-xmllint-native +ament-copyright ament-copyright-native +ament-cppcheck ament-cppcheck-native +ament-cpplint ament-cpplint-native +ament-flake8 ament-flake8-native +ament-lint ament-lint-native +ament-lint-auto ament-lint-auto-native +ament-lint-cmake ament-lint-cmake-native +ament-lint-common ament-lint-common-native +ament-mypy ament-mypy-native +ament-pclint ament-pclint-native +ament-pep257 ament-pep257-native +ament-pycodestyle ament-pycodestyle-native +ament-pyflakes ament-pyflakes-native +ament-uncrustify ament-uncrustify-native +ament-xmllint ament-xmllint-native +ament-cmake-ros ament-cmake-ros-native diff --git a/bb_fix/python3-flake8/fix/RDEPENDS b/bb_fix/python3-flake8/fix/RDEPENDS new file mode 100644 index 0000000000000000000000000000000000000000..840b851acec8eb8268dfd28731908b826b7d8e53 --- /dev/null +++ b/bb_fix/python3-flake8/fix/RDEPENDS @@ -0,0 +1 @@ +-python3-mccabe diff --git a/bb_fix/python3-mccabe/files/0001-python-mccabe-fix-no-pip-error.patch b/bb_fix/python3-mccabe/files/0001-python-mccabe-fix-no-pip-error.patch new file mode 100644 index 0000000000000000000000000000000000000000..b9ac9837e10dfab5a70d3b6d41b43e1f5dcce1aa --- /dev/null +++ b/bb_fix/python3-mccabe/files/0001-python-mccabe-fix-no-pip-error.patch @@ -0,0 +1,48 @@ +diff -Naur mccabe-0.6.1_org/mccabe.egg-info/PKG-INFO mccabe-0.6.1/mccabe.egg-info/PKG-INFO +--- mccabe-0.6.1_org/mccabe.egg-info/PKG-INFO 2023-05-12 11:34:54.601426524 +0800 ++++ mccabe-0.6.1/mccabe.egg-info/PKG-INFO 2023-05-12 11:35:35.570675016 +0800 +@@ -19,9 +19,9 @@ + + You can install, upgrade, uninstall ``mccabe`` with these commands:: + +- $ pip install mccabe +- $ pip install --upgrade mccabe +- $ pip uninstall mccabe ++ $ pip3 install mccabe ++ $ pip3 install --upgrade mccabe ++ $ pip3 uninstall mccabe + + + Standalone script +diff -Naur mccabe-0.6.1_org/PKG-INFO mccabe-0.6.1/PKG-INFO +--- mccabe-0.6.1_org/PKG-INFO 2023-05-12 11:34:54.601426524 +0800 ++++ mccabe-0.6.1/PKG-INFO 2023-05-12 11:35:35.570675016 +0800 +@@ -19,9 +19,9 @@ + + You can install, upgrade, uninstall ``mccabe`` with these commands:: + +- $ pip install mccabe +- $ pip install --upgrade mccabe +- $ pip uninstall mccabe ++ $ pip3 install mccabe ++ $ pip3 install --upgrade mccabe ++ $ pip3 uninstall mccabe + + + Standalone script +diff -Naur mccabe-0.6.1_org/README.rst mccabe-0.6.1/README.rst +--- mccabe-0.6.1_org/README.rst 2023-05-12 11:34:54.601426524 +0800 ++++ mccabe-0.6.1/README.rst 2023-05-12 11:35:35.570675016 +0800 +@@ -11,9 +11,9 @@ + + You can install, upgrade, uninstall ``mccabe`` with these commands:: + +- $ pip install mccabe +- $ pip install --upgrade mccabe +- $ pip uninstall mccabe ++ $ pip3 install mccabe ++ $ pip3 install --upgrade mccabe ++ $ pip3 uninstall mccabe + + + Standalone script diff --git a/bb_fix/python3-mock/fix/DEPENDS b/bb_fix/python3-mock/fix/DEPENDS new file mode 100644 index 0000000000000000000000000000000000000000..8566cc02fa1fdc2d1bbda547dc4aa6ca39a89933 --- /dev/null +++ b/bb_fix/python3-mock/fix/DEPENDS @@ -0,0 +1 @@ +-python3-unittest2-native diff --git a/bb_fix/python3-pydocstyle/fix/RDEPENDS b/bb_fix/python3-pydocstyle/fix/RDEPENDS new file mode 100644 index 0000000000000000000000000000000000000000..254faedc01a4ff682d2ad99443b62d4e01fe0390 --- /dev/null +++ b/bb_fix/python3-pydocstyle/fix/RDEPENDS @@ -0,0 +1,2 @@ +-python3-pydocstyle +-python3-snowballstemmer diff --git a/bb_fix/python3-sphinx/fix/DEPENDS b/bb_fix/python3-sphinx/fix/DEPENDS new file mode 100644 index 0000000000000000000000000000000000000000..232411bbcdbda5f680b02432ec920259a1a8f925 --- /dev/null +++ b/bb_fix/python3-sphinx/fix/DEPENDS @@ -0,0 +1,13 @@ +-python3-sphinxcontrib-applehelp-native +-python3-sphinxcontrib-devhelp-native +-python3-sphinxcontrib-htmlhelp-native +-python3-sphinxcontrib-jsmath-native +-python3-sphinxcontrib-qthelp-native +-python3-sphinxcontrib-serializinghtml-native +-python3-sphinx-theme-alabaster-native +-python3-test-native +-python3-imagesize-native +-python3-snowballstemmer-native +-python3-mock-native +-graphviz-native +-dos2unix-native diff --git a/bb_fix/python3-sphinx/fix/RDEPENDS b/bb_fix/python3-sphinx/fix/RDEPENDS new file mode 100644 index 0000000000000000000000000000000000000000..5851a19ebef2bedc55cf1d64e22dc82329e2c3ae --- /dev/null +++ b/bb_fix/python3-sphinx/fix/RDEPENDS @@ -0,0 +1,10 @@ +-python-sphinx-locale +-python3-babel +-python3-snowballstemmer +-python3-imagesize +-environment(modules) +-python(Sphinx) +-python3-sphinxcontrib-websupport +-python3-sphinx-theme-alabaster +-python3-sphinx_rtd_theme +-python3-requests diff --git a/bb_fix/qpoases-vendor/fix/APPENDS b/bb_fix/qpoases-vendor/fix/APPENDS new file mode 100644 index 0000000000000000000000000000000000000000..403cef8e1e4da7b4896997abdb54ef5e28e0c894 --- /dev/null +++ b/bb_fix/qpoases-vendor/fix/APPENDS @@ -0,0 +1,3 @@ +do_configure:prepend() { + cp ${OPENEULER_SP_DIR}/qpoases_vendor/3.2.0.tar.gz ${S}/qpoases_3_2 +} diff --git a/bb_fix/rcl-yaml-param-parser/fix/APPENDS b/bb_fix/rcl-yaml-param-parser/fix/APPENDS new file mode 100644 index 0000000000000000000000000000000000000000..6f0598d2fbc74d8b151c0ef73ced3dac466cd126 --- /dev/null +++ b/bb_fix/rcl-yaml-param-parser/fix/APPENDS @@ -0,0 +1,6 @@ +FILES:${PN}:append = " \ + ${ros_prefix}/lib \ +" +FILES:${PN}-dev:remove = "\ + ${ros_prefix}/lib/lib*.so \ +" diff --git a/bb_fix/rcl-yaml-param-parser/fix/RDEPENDS b/bb_fix/rcl-yaml-param-parser/fix/RDEPENDS new file mode 100644 index 0000000000000000000000000000000000000000..f249edfb9c69eb6c2d783625968beed13d859baf --- /dev/null +++ b/bb_fix/rcl-yaml-param-parser/fix/RDEPENDS @@ -0,0 +1 @@ +-yaml-cpp diff --git a/bb_fix/rclcpp/fix/APPENDS b/bb_fix/rclcpp/fix/APPENDS new file mode 100644 index 0000000000000000000000000000000000000000..ad7dafd14a2d6b1e3b3cacd631e1c7b9082665a0 --- /dev/null +++ b/bb_fix/rclcpp/fix/APPENDS @@ -0,0 +1,6 @@ +FILES:${PN}-dev:remove = " \ + ${prefix}/lib/lib*.so \ +" +FILES:${PN}:append = " \ + ${prefix}/lib \ +" diff --git a/bb_fix/rclcpp/fix/DEPENDS b/bb_fix/rclcpp/fix/DEPENDS new file mode 100644 index 0000000000000000000000000000000000000000..73e9fb8e2866eb5557417c8aa4a6af9522942cdf --- /dev/null +++ b/bb_fix/rclcpp/fix/DEPENDS @@ -0,0 +1,16 @@ ++python3-empy-native ++rcutils-native +-ament-index-cpp-native +-builtin-interfaces-native +-rcl-interfaces-native +-rosgraph-msgs-native +-rosidl-runtime-cpp-native +-rosidl-typesupport-c-native +-rosidl-typesupport-cpp-native ++ament-index-cpp ++builtin-interfaces ++rcl-interfaces ++rosgraph-msgs ++rosidl-runtime-cpp ++rosidl-typesupport-c ++rosidl-typesupport-cpp diff --git a/bb_fix/rclcpp/fix/RDEPENDS b/bb_fix/rclcpp/fix/RDEPENDS new file mode 100644 index 0000000000000000000000000000000000000000..105d4c47da7155447766e69f6dccb2db023f0751 --- /dev/null +++ b/bb_fix/rclcpp/fix/RDEPENDS @@ -0,0 +1,7 @@ +-ament-index-cpp +-builtin-interfaces +-rcl-interfaces +-rosgraph-msgs +-rosidl-runtime-cpp +-rosidl-typesupport-c +-rosidl-typesupport-cpp diff --git a/bb_fix/rclpy/fix/APPENDS b/bb_fix/rclpy/fix/APPENDS new file mode 100644 index 0000000000000000000000000000000000000000..44f201359d74d63274b614fedcc411fbbb0f4b5c --- /dev/null +++ b/bb_fix/rclpy/fix/APPENDS @@ -0,0 +1,8 @@ +# fix link error +do_configure:prepend() { + rm -f ${STAGING_DIR_NATIVE}/usr/lib/libpython*.so +} + +do_install:append() { + mv ${D}/${prefix}/${PYTHON_SITEPACKAGES_DIR}/${ROS_BPN}/_rclpy_pybind11.cpython*.so ${D}/${prefix}/${PYTHON_SITEPACKAGES_DIR}/${ROS_BPN}/_rclpy_pybind11.${PYTHON_SOABI}.so +} diff --git a/bb_fix/rmw-implementation/fix/DEPENDS b/bb_fix/rmw-implementation/fix/DEPENDS new file mode 100644 index 0000000000000000000000000000000000000000..161a1da9b39df27c1174696de3715b691d3255ea --- /dev/null +++ b/bb_fix/rmw-implementation/fix/DEPENDS @@ -0,0 +1,4 @@ +-rmw-cyclonedds-cpp-native +-rmw-fastrtps-dynamic-cpp-native ++rmw-fastrtps-dynamic-cpp + diff --git a/bb_fix/rmw-implementation/fix/RDEPENDS b/bb_fix/rmw-implementation/fix/RDEPENDS new file mode 100644 index 0000000000000000000000000000000000000000..843697fadb916dd36708589772435b2d9ac06e95 --- /dev/null +++ b/bb_fix/rmw-implementation/fix/RDEPENDS @@ -0,0 +1 @@ ++rmw-fastrtps-cpp diff --git a/bb_fix/ros-core/fix/RDEPENDS b/bb_fix/ros-core/fix/RDEPENDS new file mode 100644 index 0000000000000000000000000000000000000000..1cacd8babde05343103760ba7a0e976160c66c58 --- /dev/null +++ b/bb_fix/ros-core/fix/RDEPENDS @@ -0,0 +1,14 @@ +-ament-cmake-auto-native +-ament-cmake-gmock-native +-ament-cmake-gtest-native +-ament-cmake-native +-ament-cmake-pytest-native +-ament-cmake-ros-native +-ament-lint-auto-native +-ament-lint-common-native +-ament-index-cpp +-ament-index-python +-launch-testing-ament-cmake +-rosidl-default-generators ++rosidl-generator-cpp ++rosidl-typesupport-c diff --git a/bb_fix/ros-workspace/files/ros-workspace-fix-ament-package-not-found.patch b/bb_fix/ros-workspace/files/ros-workspace-fix-ament-package-not-found.patch new file mode 100644 index 0000000000000000000000000000000000000000..ebaf6ddadc1e3752dd48c453f4b98ce9f697027e --- /dev/null +++ b/bb_fix/ros-workspace/files/ros-workspace-fix-ament-package-not-found.patch @@ -0,0 +1,12 @@ +diff -Naur ros-humble-ros-workspace-1.0.2_org/CMakeLists.txt ros-humble-ros-workspace-1.0.2/CMakeLists.txt +--- ros-humble-ros-workspace-1.0.2_org/CMakeLists.txt 2023-05-13 09:39:51.509756650 +0800 ++++ ros-humble-ros-workspace-1.0.2/CMakeLists.txt 2023-05-13 09:40:24.537975002 +0800 +@@ -14,7 +14,7 @@ + set(PYTHON_INSTALL_DIR "lib/python${PYTHON_MAJOR_MINOR}/site-packages") + set(SHELL_EXT "sh") + endif() +-set(AMENT_PACKAGE_DIR "${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTALL_DIR}/ament_package") ++set(AMENT_PACKAGE_DIR "$ENV{STAGING_DIR_NATIVE}/usr/${PYTHON_INSTALL_DIR}/ament_package") + if(NOT EXISTS "${AMENT_PACKAGE_DIR}") + # Check for an .egg-link file and use the listed directory if it exists + get_filename_component(AMENT_PACKAGE_EGG_LINK "${AMENT_PACKAGE_DIR}" DIRECTORY) diff --git a/bb_fix/ros-workspace/fix/APPENDS b/bb_fix/ros-workspace/fix/APPENDS new file mode 100644 index 0000000000000000000000000000000000000000..f3e22ab669be9fe526e973b0ce92be998fcf1eb3 --- /dev/null +++ b/bb_fix/ros-workspace/fix/APPENDS @@ -0,0 +1,6 @@ +FILES:${PN}:prepend = " \ + ${ros_prefix}/*.py \ + ${ros_prefix}/*.sh \ + ${ros_prefix}/*.bash \ + ${ros_prefix}/*.zsh \ +" diff --git a/bb_fix/ros-workspace/fix/DEPENDS b/bb_fix/ros-workspace/fix/DEPENDS new file mode 100644 index 0000000000000000000000000000000000000000..d0a27bcc9ad22cfbac42fc4c6c9b5886420df5e1 --- /dev/null +++ b/bb_fix/ros-workspace/fix/DEPENDS @@ -0,0 +1,4 @@ +-ament-cmake-core ++ament-cmake-core-native +-ament-package ++ament-package-native diff --git a/bb_fix/rosidl-typesupport-cpp/fix/DEPENDS b/bb_fix/rosidl-typesupport-cpp/fix/DEPENDS new file mode 100644 index 0000000000000000000000000000000000000000..088a0091de4106f4c01855371cd1f34714ce2dbd --- /dev/null +++ b/bb_fix/rosidl-typesupport-cpp/fix/DEPENDS @@ -0,0 +1,3 @@ +-rosidl-typesupport-introspection-cpp-native ++rosidl-typesupport-introspection-cpp ++rosidl-cmake diff --git a/bb_fix/rviz-ogre-vendor/fix/APPENDS b/bb_fix/rviz-ogre-vendor/fix/APPENDS new file mode 100644 index 0000000000000000000000000000000000000000..74e6e729c397bc67a84b9c948ba0c9cf85e9cb90 --- /dev/null +++ b/bb_fix/rviz-ogre-vendor/fix/APPENDS @@ -0,0 +1,3 @@ +do_configure:prepend() { + cp ${OPENEULER_SP_DIR}/rviz/ogre-rm-Media-1.12.1.tar.gz ${S} +} diff --git a/bb_fix/sros2/fix/RDEPENDS b/bb_fix/sros2/fix/RDEPENDS new file mode 100644 index 0000000000000000000000000000000000000000..8b65f197199fda6c1b159faab03cdb33ff7ada37 --- /dev/null +++ b/bb_fix/sros2/fix/RDEPENDS @@ -0,0 +1 @@ +-python3-cryptography diff --git a/bb_fix/tinyxml2/fix/APPENDS b/bb_fix/tinyxml2/fix/APPENDS new file mode 100644 index 0000000000000000000000000000000000000000..3e769d734937713ec36c780a53b27d202cbd3459 --- /dev/null +++ b/bb_fix/tinyxml2/fix/APPENDS @@ -0,0 +1,3 @@ +do_configure:prepend() { + sed -i -e 's,lib/,${CMAKE_INSTALL_LIBDIR}/,g' ${S}/CMakeLists.txt +} diff --git a/bb_fix/uncrustify-vendor/fix/APPENDS b/bb_fix/uncrustify-vendor/fix/APPENDS new file mode 100644 index 0000000000000000000000000000000000000000..896ad1209f8c660d759a93b79588c83db74eebc4 --- /dev/null +++ b/bb_fix/uncrustify-vendor/fix/APPENDS @@ -0,0 +1,3 @@ +do_configure:prepend() { + cp ${OPENEULER_SP_DIR}/uncrustify_vendor/uncrustify-0.72.0.tar.gz ${S} +} diff --git a/bb_fix/yaml-cpp/fix/APPENDS b/bb_fix/yaml-cpp/fix/APPENDS new file mode 100644 index 0000000000000000000000000000000000000000..f8b40f539bcfa15d7e3920e64fabbe0679b73b07 --- /dev/null +++ b/bb_fix/yaml-cpp/fix/APPENDS @@ -0,0 +1 @@ +EXTRA_OECMAKE += "-DYAML_CPP_BUILD_TESTS=OFF -DYAML_CPP_BUILD_TOOLS=OFF" diff --git a/create-ros-yaml-for-gitee.sh b/create-ros-yaml-for-gitee.sh index cbf94fafab97f96cc689be516b56ddcd8fb9eca3..f160270dffc64d78ae829a11baaea6541e981d4c 100755 --- a/create-ros-yaml-for-gitee.sh +++ b/create-ros-yaml-for-gitee.sh @@ -39,6 +39,12 @@ main() echo "- name: ${ROS_DISTRO}" >>${ROS_SIG_BASE}/$class/$project.yaml echo " type: protected" >>${ROS_SIG_BASE}/$class/$project.yaml echo " create_from: master" >>${ROS_SIG_BASE}/$class/$project.yaml + echo "- name: Multi-Version_ros-${ROS_DISTRO}_openEuler-22.03-LTS-Next" >>${ROS_SIG_BASE}/$class/$project.yaml + echo " type: protected" >>${ROS_SIG_BASE}/$class/$project.yaml + echo " create_from: ${ROS_DISTRO}" >>${ROS_SIG_BASE}/$class/$project.yaml + echo "- name: Multi-Version_ros-${ROS_DISTRO}_openEuler-22.03-LTS-SP2" >>${ROS_SIG_BASE}/$class/$project.yaml + echo " type: protected" >>${ROS_SIG_BASE}/$class/$project.yaml + echo " create_from: Multi-Version_ros-${ROS_DISTRO}_openEuler-22.03-LTS-Next" >>${ROS_SIG_BASE}/$class/$project.yaml echo "type: public" >>${ROS_SIG_BASE}/$class/$project.yaml done < ${ROS_PROJECTS_NAME} diff --git a/gen-pkg-bb.sh b/gen-pkg-bb.sh index eead0b9de86805b49f05ce14e99c8b95a51c090d..26584fd8a58992ed2e2e07e813596669ffcfc2ba 100755 --- a/gen-pkg-bb.sh +++ b/gen-pkg-bb.sh @@ -4,6 +4,8 @@ GEN_ONE=$1 +BB_FIX=${ROOT}/bb_fix +BB_FIX_PKG_REMAP=${BB_FIX}/pkg.remap ROS_PKG_SRC=${OUTPUT}/ros-pkg-src.list ROS_PACKAGE_FIX=${ROOT}/package_fix ROS_PKG_REMAP=${ROOT}/spec_fix/pkg.remap @@ -80,10 +82,10 @@ gen_license() fi done < ${OUTPUT}/.tempLicense - lic_org=`grep "license" ${pkg_dir}/package.xml` - lic_beginline=`grep -n "license" ${pkg_dir}/package.xml | head -1 | cut -d':' -f1` - lic_endline=`grep -n "license" ${pkg_dir}/package.xml | tail -1 | cut -d':' -f1` - lic_md5=`echo "$lic_org" | md5sum | cut -d' ' -f1` + lic_org=`grep "> $bbfile echo "LIC_FILES_CHKSUM = \"file://package.xml;beginline=${lic_beginline};endline=${lic_endline};md5=${lic_md5}\"" >> $bbfile @@ -97,38 +99,77 @@ gen_src_url() echo "SRC_URI = \" \\" >> $bbfile echo " file://\${OPENEULER_LOCAL_NAME}/ros-\${ROS_DISTRO}-\${ROS_SPN}_\${PV}.orig.tar.gz \\" >> $bbfile - if [ ! -d ${ROS_PACKAGE_FIX}/${pkg} ] + if [ -d ${ROS_PACKAGE_FIX}/${pkg} ] + then + for tarball in `cd ${ROS_PACKAGE_FIX}/${pkg} && ls | grep -v "\.fix" | grep -v "\.patch"` + do + echo " file://\${OPENEULER_LOCAL_NAME}/${tarball} \\" >> $bbfile + done + + if [ -f ${ROS_PACKAGE_FIX}/${pkg}/source.fix ] + then + for patch in `grep "^Patch.*: " ${ROS_PACKAGE_FIX}/${pkg}/source.fix | awk '{print $2}'` + do + echo " file://\${OPENEULER_LOCAL_NAME}/${patch} \\" >> $bbfile + done + fi + fi + + other_cfg=`ls ${BB_FIX}/$pkg 2>/dev/null | grep -v fix` + if [ "$other_cfg" == "" ] then echo "\"" >> $bbfile echo "" >> $bbfile return fi - for tarball in `cd ${ROS_PACKAGE_FIX}/${pkg} && ls | grep -v "\.fix" | grep -v "\.patch"` + pkg_bb_dir=`dirname "$bbfile"` + `cd ${BB_FIX}/$pkg && ls | grep -v fix | xargs -i cp -r {} ${pkg_bb_dir}` + + for patch in `cd ${BB_FIX}/$pkg/files 2>/dev/null && ls *.patch` do - echo " file://${tarball} \\" >> $bbfile + echo " file://${patch} \\" >> $bbfile done - if [ -f ${ROS_PACKAGE_FIX}/${pkg}/source.fix ] - then - for patch in `grep "^Patch.*: " ${ROS_PACKAGE_FIX}/${pkg}/source.fix | cut -d':' -f2` - do - echo " file://${patch} \\" >> $bbfile - done - fi - echo "\"" >> $bbfile echo "" >> $bbfile } +# rename the ros origin dependence package name(same this ubuntu) to openEuler, +# such as in ubuntu system, the develop package name of assimp is assimp-dev, +# but in openEuler system, the name is assimp-devel. +# use spec_fix/pkg.remap rename_requires() { require_file=$1 - while read deb_pkg rpm_pkg + for dep in `cat $require_file` + do + map=`grep "^${dep} " ${ROS_PKG_REMAP}` + [ "$map" == "" ] && continue + + bb_pkg=`echo $map | cut -d' ' -f2` + sed -i "s#^${dep}\$#${bb_pkg}#g" $require_file + done +} + +# rename the openEuler rpm package name to openEuler embedded package name, +# such as in openEuler Server system, the name of python package setuptools_scm is +# python3-setuptools_scm, but in openEuler embedded system, the name is +# python3-setuptools-scm(bcauses the bbfile name use _ to split package name and version). +# use bb_fix/pkg.remap +rename_depend() +{ + require_file=$1 + + for dep in `cat $require_file` do - sed -i "s#^${deb_pkg}\$#${rpm_pkg}#g" $require_file - done <${ROS_PKG_REMAP} + map=`grep "^${dep} " ${BB_FIX_PKG_REMAP}` + [ "$map" == "" ] && continue + + bb_pkg=`echo $map | cut -d' ' -f2` + sed -i "s#^${dep}\$#${bb_pkg}#g" $require_file + done } spec_fix() @@ -155,72 +196,143 @@ spec_fix() grep "^\+" $spec_fix_file | sed -e "s#^\+##g" >> ${require_file} } +# fix DEPENDS and RDEPENDS +bb_fix() +{ + pkg=$1 + require_file=$2 + fix_bb_deps=$3 + + if [ -f ${BB_FIX}/${pkg}/fix/${fix_bb_deps} ] + then + for dep in `grep "^\-" ${BB_FIX}/${pkg}/fix/${fix_bb_deps} | sed -e 's#^\-##g'` + do + sed -i "/^${dep}\$/d" $require_file + done + + for dep in `grep "^\+" ${BB_FIX}/${pkg}/fix/${fix_bb_deps} | sed -e 's#^\+##g'` + do + echo "$dep" >> $require_file + done + fi + + while read dep + do + sed -i "/^$dep\$/d" $require_file + done < ${BB_FIX}/all.remove +} gen_each_depend() { pkg=$1 - depend_name=$2 - deps_suffix=$3 - spec_fix_type=$4 - bbfile=$5 + fix_bb_deps=$2 + spec_deps_suffix=$3 + bbfile=$4 - debug_log "gen ${depend_name}" + debug_log "gen ${fix_bb_deps}" - package_xml_deps=${ROS_DEPS_BASE}/$pkg-${deps_suffix} + package_xml_deps=${ROS_DEPS_BASE}/$pkg-${spec_deps_suffix} require_file=${OUTPUT}/.tempDepends rm -f ${require_file} - [ -f ${package_xml_deps} ] && cp ${package_xml_deps} ${require_file} - spec_fix $pkg $spec_fix_type $require_file + if [ -f ${package_xml_deps} ] + then + if [ "$fix_bb_deps" == "TDEPENDS" ] + then + cat ${package_xml_deps} | sed -e "s#^BuildRequires: ##g" > ${require_file} + else + cat ${package_xml_deps} | sed -e "s#^${spec_deps_suffix}: ##g" > ${require_file} + fi + fi + + spec_fix $pkg $spec_deps_suffix $require_file if [ ! -f ${require_file} ] then - echo "$depend_name = \" \\" >> $bbfile - echo "\"" >> $bbfile - echo "" >> $bbfile return fi + + sed -i 's#ros-%{ros_distro}-##g' $require_file + if [ "$pkg" != "ament-cmake-core" -a "$pkg" != "ament-package" -a "$pkg" != "ros-workspace" ] + then + echo "ros-workspace" >> $require_file + fi + rename_requires $require_file + rename_depend $require_file - echo "$depend_name = \" \\" >> $bbfile + cat $require_file | sed -e 's#-devel$##g' | sort | uniq >${OUTPUT}/.temp${fix_bb_deps} - if [ "$pkg" != "ament-cmake-core" -a "$pkg" != "ament-package" -a "$pkg" != "ros-workspace" ] + if [ "$fix_bb_deps" == "DEPENDS" ] then - if [ "$depend_name" == "ROS_BUILD_DEPENDS" -o "$depend_name" == "ROS_EXEC_DEPENDS" ] + if [ ! -f ${OUTPUT}/.tempRDEPENDS ] then - echo "ros-workspace" >> $require_file + bb_fix $pkg ${OUTPUT}/.temp${fix_bb_deps} $fix_bb_deps + cat ${OUTPUT}/.temp${fix_bb_deps} | sort | uniq | sed -e 's#$# \\#g' -e 's#^# #g' >> $bbfile + cat ${OUTPUT}/.temp${fix_bb_deps} >> ${ROS_NATIVE_PKGS_TMP1} + return fi + + rm -f ${OUTPUT}/.temp${fix_bb_deps} + + for i in `cat $require_file | sed -e 's#-devel$##g' | sort | uniq` + do + grep -q "^${i}$" ${OUTPUT}/.tempRDEPENDS + if [ $? -eq 0 -o "${i##*-}" == "native" ] + then + # if package in RDEPENDS, it's must a target device package. + echo "$i" >> ${OUTPUT}/.temp${fix_bb_deps} + else + echo "${i}-native" >> ${OUTPUT}/.temp${fix_bb_deps} + echo "$i" >> ${ROS_NATIVE_PKGS_TMP1} + fi + done + cat ${OUTPUT}/.tempRDEPENDS >> ${OUTPUT}/.temp${fix_bb_deps} fi + + bb_fix $pkg ${OUTPUT}/.temp${fix_bb_deps} $fix_bb_deps - if [ "$depend_name" == "ROS_BUILDTOOL_DEPENDS" -o "$depend_name" == "ROS_BUILDTOOL_EXPORT_DEPENDS" ] + if [ "$fix_bb_deps" == "RDEPENDS" ] then - cat $require_file >> ${ROS_NATIVE_PKGS_TMP1} - cat $require_file | sed -e 's#$#-native \\#g' -e 's#^# #g' >> $bbfile + cat ${OUTPUT}/.temp${fix_bb_deps} | sed -e 's#-native$##g' | sort | uniq | sed -e 's#$# \\#g' -e 's#^# #g' >> $bbfile else - cat $require_file | sed -e 's#$# \\#g' -e 's#^# #g' >> $bbfile + cat ${OUTPUT}/.temp${fix_bb_deps} | sort | uniq | sed -e 's#$# \\#g' -e 's#^# #g' >> $bbfile fi +} + +gen_depends() +{ + pkg=$1 + bbfile=$2 + + rm -f ${OUTPUT}/{.tempRDEPENDS,.tempDEPENDS,.tempTDEPENDS} + echo 'RDEPENDS:${PN} += "\' >> $bbfile + gen_each_depend $pkg RDEPENDS Requires $bbfile + echo '"' >> $bbfile + echo "" >> $bbfile + + echo 'DEPENDS = "\' >> $bbfile + gen_each_depend $pkg DEPENDS BuildRequires $bbfile + echo '"' >> $bbfile + echo "" >> $bbfile + + echo 'TDEPENDS = "\' >> $bbfile + gen_each_depend $pkg TDEPENDS test-BuildRequires $bbfile + echo '"' >> $bbfile - echo "\"" >> $bbfile echo "" >> $bbfile } -gen_depends() +gen_appends() { pkg=$1 bbfile=$2 - gen_each_depend $pkg ROS_BUILD_DEPENDS BuildDepends BuildRequires $bbfile - gen_each_depend $pkg ROS_BUILD_EXPORT_DEPENDS BuildExportDepends BuildRequires $bbfile - gen_each_depend $pkg ROS_BUILDTOOL_DEPENDS BuildToolDepends BuildRequires $bbfile - gen_each_depend $pkg ROS_BUILDTOOL_EXPORT_DEPENDS BuildToolExportDepends BuildRequires $bbfile - gen_each_depend $pkg ROS_EXEC_DEPENDS ExecDepends Requires $bbfile - gen_each_depend $pkg ROS_TEST_DEPENDS TestDepends test-BuildRequires $bbfile + [ ! -f ${BB_FIX}/${pkg}/fix/APPENDS ] && return - echo 'DEPENDS = "${ROS_BUILD_DEPENDS} ${ROS_BUILD_EXPORT_DEPENDS}"' >> $bbfile - echo 'DEPENDS += "${ROS_BUILDTOOL_DEPENDS} ${ROS_BUILDTOOL_EXPORT_DEPENDS}"' >> $bbfile - echo 'RDEPENDS:${PN} += "${ROS_EXEC_DEPENDS}"' >> $bbfile + cat ${BB_FIX}/${pkg}/fix/APPENDS >> $bbfile echo "" >> $bbfile } @@ -295,8 +407,10 @@ main() pkg_dir_name=`cd ${ROS_SRC_BASE}/${repo} && ls ros-${ROS_DISTRO}-${pkg}_*.orig.tar.gz | sed -e "s#.orig.tar.gz##g" | sed -e "s#_#-#g"` + mkdir -p ${ROS_GENERAGTED_BB_BASE}/${repo}/${pkg} + #bbfile=${pkg}_${base_version}-${release_version}.bb - bbfile=${pkg}.bb + bbfile=${ROS_GENERAGTED_BB_BASE}/${repo}/${pkg}/${pkg}.bb echo "# Generated by ros-porting-tools -- DO NOT EDIT" > $bbfile echo "# Copyright Huawei Technologies Co., Ltd." >> $bbfile @@ -332,6 +446,7 @@ main() gen_license $pkg ${ROS_SRC_BASE}/${repo}/${pkg_dir_name} $bbfile gen_src_url $pkg $bbfile gen_depends $pkg $bbfile + gen_appends $pkg $bbfile gen_build_type ${ROS_SRC_BASE}/${repo}/${pkg_dir_name} $bbfile done < ${OUTPUT}/.repo_pkgs done diff --git a/gen-pkg-ext-bb.sh b/gen-pkg-ext-bb.sh new file mode 100755 index 0000000000000000000000000000000000000000..c3432335a456607d90402625228239b9358be9d3 --- /dev/null +++ b/gen-pkg-ext-bb.sh @@ -0,0 +1,348 @@ +#!/bin/bash + +. base.sh + +GEN_ONE=$1 + +SPEC_TO_BB_LIST=${ROS_DISTRO}/spec_to_bb.list +BB_FIX=${ROOT}/bb_fix +BB_FIX_PKG_REMAP=${BB_FIX}/pkg.remap +BB_DEVTOOLS_BASE=${ROS_BB_BASE}/recipes-devtools +BB_EXTERNAL_BASE=${ROS_BB_BASE}/recipes-external +BB_TMP_BASE=${ROS_BB_BASE}/.tmp + +prepare() +{ + if [ ! -f ${SPEC_TO_BB_LIST} ] + then + error_log "Can not find ${SPEC_TO_BB_LIST}." + exit 1 + fi + + if [ "$GEN_ONE" == "" ] + then + rm -rf ${BB_DEVTOOLS_BASE} + rm -rf ${BB_EXTERNAL_BASE} + fi + + mkdir -p ${BB_DEVTOOLS_BASE}/python + mkdir -p ${BB_EXTERNAL_BASE} + mkdir -p ${BB_TMP_BASE} +} + +gen_single_line_config() +{ + spec=$1 + bbfile=$2 + prefix=$3 + config_key=$4 + + ret=`grep -i "^${prefix}" $spec | head -1 | awk -F"${prefix}" '{print $2}' | awk '$1=$1'` + if [ "$ret" == "" ] + then + error_log "${config_key} is null." + fi + echo "${config_key} = \"$ret\"" >> $bbfile +} + +gen_src_uri() +{ + spec=$1 + bbfile=$2 + src_name=$3 + pkg=$4 + + echo "SRC_URI = \" \\" >> $bbfile + echo " file://\${OPENEULER_LOCAL_NAME}/${src_name} \\" >> $bbfile + + for patch in `grep "^Patch.*: " $spec | awk '{print $2}'` + do + echo " file://\${OPENEULER_LOCAL_NAME}/${patch} \\" >> $bbfile + done + + other_cfg=`ls ${BB_FIX}/$pkg 2>/dev/null | grep -v fix` + if [ "$other_cfg" == "" ] + then + echo "\"" >> $bbfile + return + fi + + pkg_bb_dir=`dirname "$bbfile"` + `cd ${BB_FIX}/$pkg && ls | grep -v fix | xargs -i cp -r {} ${pkg_bb_dir}` + + for patch in `cd ${BB_FIX}/$package_name/files 2>/dev/null && ls *.patch` + do + echo " file://${patch} \\" >> $bbfile + done + + echo "\"" >> $bbfile +} + +gen_license() +{ + spec=$1 + bbfile=$2 + spec_name=$3 + + grep -i "^License:" $spec | head -1 | awk -F":" '{print $2}' | awk '$1=$1' | sed -e "s# and #\n#g" > ${OUTPUT}/.tempLicense + lics="" + while read lic + do + yocto_lic=`python3 ${ROOT}/get-license.py "$lic"` + [ "$yocto_lic" == "" ] && error_log "can not get license, origin license is \"$lic\"" && exit 1 + + if [ "$lics" == "" ] + then + lics="$yocto_lic" + else + lics="$lics & $yocto_lic" + fi + done < ${OUTPUT}/.tempLicense + + if [ "$lics" == "" ] + then + error_log "license is null." + fi + + echo "LICENSE = \"$lics\"" >> $bbfile + + #md5=`md5sum $spec | cut -d' ' -f1` + #echo "LIC_FILES_CHKSUM = \"file://../${spec_name};md5=${md5}\"" >> $bbfile + echo "LIC_FILES_CHKSUM = \"file://\${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10\"" >> $bbfile +} + +rename_depend() +{ + require_file=$1 + + sed -i 's#python%{python3_pkgversion}#python3#g' $require_file + + for dep in `cat $require_file` + do + map=`grep "^${dep} " ${BB_FIX_PKG_REMAP}` + [ "$map" == "" ] && continue + + bb_pkg=`echo $map | cut -d' ' -f2` + sed -i "s#^${dep}\$#${bb_pkg}#g" $require_file + done +} + +# fix DEPENDS and RDEPENDS +bb_fix() +{ + pkg=$1 + require_file=$2 + fix_bb_deps=$3 + + if [ -f ${BB_FIX}/${pkg}/fix/${fix_bb_deps} ] + then + for dep in `grep "^\-" ${BB_FIX}/${pkg}/fix/${fix_bb_deps} | sed -e 's#^\-##g'` + do + sed -i "/^${dep}\$/d" $require_file + done + + for dep in `grep "^\+" ${BB_FIX}/${pkg}/fix/${fix_bb_deps} | sed -e 's#^\+##g'` + do + echo "$dep" >> $require_file + done + fi + + while read dep + do + sed -i "/^$dep\$/d" $require_file + done < ${BB_FIX}/all.remove +} +gen_each_depend() +{ + pkg=$1 + spec=$2 + bbfile=$3 + bbfile_name=$4 + fix_bb_deps=$5 + spec_deps=$6 + + require_file=${OUTPUT}/.tempDepends + + >$require_file + for dep in `grep "^${spec_deps}:" $spec | awk -F":" '{print $2}' | awk -F">=" '{print $1}' | grep -v " = "` + do + echo $dep >>$require_file + done + + rename_depend ${require_file} + + cat $require_file | sed -e 's#-devel$##g' | sort | uniq >${OUTPUT}/.temp${fix_bb_deps} + + if [ "$fix_bb_deps" == "DEPENDS" ] + then + if [ ! -f ${OUTPUT}/.tempRDEPENDS ] + then + bb_fix $pkg ${OUTPUT}/.temp${fix_bb_deps} $fix_bb_deps + cat ${OUTPUT}/.temp${fix_bb_deps} | sort | uniq | sed -e 's#$# \\#g' -e 's#^# #g' >> $bbfile + return + fi + + rm -f ${OUTPUT}/.temp${fix_bb_deps} + + for i in `cat $require_file | sed -e 's#-devel$##g' | sort | uniq` + do + grep -q "^${i}$" ${OUTPUT}/.tempRDEPENDS + if [ $? -eq 0 -o "${i##*-}" == "native" ] + then + # if package in RDEPENDS, it's must a target device package. + echo "$i" >> ${OUTPUT}/.temp${fix_bb_deps} + else + echo "${i}-native" >> ${OUTPUT}/.temp${fix_bb_deps} + fi + done + cat ${OUTPUT}/.tempRDEPENDS >> ${OUTPUT}/.temp${fix_bb_deps} + fi + + bb_fix $pkg ${OUTPUT}/.temp${fix_bb_deps} $fix_bb_deps + + if [ "$fix_bb_deps" == "RDEPENDS" ] + then + cat ${OUTPUT}/.temp${fix_bb_deps} | sed -e 's#-native$##g' | sort | uniq | sed -e 's#$# \\#g' -e 's#^# #g' >> $bbfile + else + cat ${OUTPUT}/.temp${fix_bb_deps} | sort | uniq | sed -e 's#$# \\#g' -e 's#^# #g' >> $bbfile + fi +} + +gen_depends() +{ + pkg=$1 + spec=$2 + bbfile=$3 + bbfile_name=$4 + + rm -f ${OUTPUT}/{.tempRDEPENDS,.tempDEPENDS,.tempTDEPENDS} + echo "RDEPENDS_\${PN} += \" \\" >> $bbfile + gen_each_depend $pkg $spec $bbfile $bbfile_name RDEPENDS Requires + echo "\"" >> $bbfile + echo "" >> $bbfile + + echo "DEPENDS += \" \\" >> $bbfile + gen_each_depend $pkg $spec $bbfile $bbfile_name DEPENDS BuildRequires + echo "\"" >> $bbfile + echo "" >> $bbfile +} + +gen_appends() +{ + pkg=$1 + bbfile=$2 + + [ ! -f ${BB_FIX}/${pkg}/fix/APPENDS ] && return + + cat ${BB_FIX}/${pkg}/fix/APPENDS >> $bbfile + echo "" >> $bbfile +} + +gen_files() +{ + bbfile=$1 + + echo 'FILES:${PN}: += " \' >> $bbfile + echo ' ${libdir}/${BPN}/cmake/* \' >> $bbfile + echo ' ${libdir}/cmake/* \' >> $bbfile + echo ' ${prefix}/lib/${BPN}/cmake/* \' >> $bbfile + echo ' ${prefix}/lib/cmake/* \' >> $bbfile + echo '"' >> $bbfile + echo "" >> $bbfile +} + +main() +{ + prepare + + info_log "Start to generate bb file." + + while read package_name package_type is_native bbfile_name spec_url source_name unpack_name + do + echo "${package_name}" | grep -q "^#" && continue + [ "$GEN_ONE" != "" -a "$package_name" != "$GEN_ONE" ] && continue + + if [ "${package_name}" == "" -o "${package_type}" == "" -o "${is_native}" == "" -o "${bbfile_name}" == "" -o "${spec_url}" == "" -o "${source_name}" == "" -o "${unpack_name}" == "" ] + then + error_log "configuration of $package_name is incomplete." + continue + fi + + info_log "start to generate bbfile for $package_name" + + if [ "$is_native" == "yes" -a "$package_type" == "python" ] + then + bbfile_prefix=${BB_DEVTOOLS_BASE}/python + elif [ "$is_native" == "yes" -a "$package_type" == "cmake" ] + then + bbfile_prefix=${BB_DEVTOOLS_BASE} + else + bbfile_prefix=${BB_EXTERNAL_BASE} + fi + + mkdir -p ${bbfile_prefix}/${package_name} + + bbfile=${bbfile_prefix}/${package_name}/${bbfile_name}.bb + + #the format of spec_url must be like https://gitee.com/src-openeuler/catkin_pkg/raw/master/catkin-pkg.spec + spec_name=`echo $spec_url | cut -d'/' -f8` + branch=`echo $spec_url | cut -d'/' -f7` + repo=`echo $spec_url | cut -d'/' -f5` + git_url=`echo $spec_url | awk -F'/' '{print $1"//"$2"/"$3"/"$4}'` + spec=${BB_TMP_BASE}/$spec_name + + [ ! -f $spec ] && wget --no-check-certificate -q --show-progress --progress=bar:force 2>&1 -c -P ${BB_TMP_BASE} ${spec_url} + + if [ ! -f $spec ] + then + error_log "download spec error, $spec_url" + continue + fi + + echo "PN = \"${package_name}\"" > $bbfile + + gen_single_line_config $spec $bbfile "Summary:" "DESCRIPTION" + gen_single_line_config $spec $bbfile "URL:" "HOMEPAGE" + gen_license $spec $bbfile $spec_name + gen_single_line_config $spec $bbfile "Version:" "PV" + echo "" >> $bbfile + + if [ "$package_type" == "python" ] + then + echo "inherit pypi setuptools3" >> $bbfile + echo "" >> $bbfile + echo "PYPI_PACKAGE = \"${package_name}\"" >> $bbfile + echo "" >> $bbfile + else + echo "inherit cmake" >> $bbfile + echo "" >> $bbfile + fi + + echo "OPENEULER_GIT_URL = \"${git_url}\"" >> $bbfile + echo "OPENEULER_REPO_NAME = \"${repo}\"" >> $bbfile + echo 'OPENEULER_LOCAL_NAME = "${OPENEULER_REPO_NAME}"' >> $bbfile + echo "OPENEULER_BRANCH = \"${branch}\"" >> $bbfile + echo "" >> $bbfile + + gen_src_uri $spec $bbfile $source_name $package_name + echo "S = \"\${WORKDIR}/${unpack_name}\"" >> $bbfile + echo "" >> $bbfile + + gen_depends $package_name $spec $bbfile $bbfile_name + + gen_appends $package_name $bbfile + + if [ "$is_native" == "yes" ] + then + echo "BBCLASSEXTEND = \"native nativesdk\"" >> $bbfile + else + echo "BBCLASSEXTEND = \"native\"" >> $bbfile + fi + + #gen_files $bbfile + done < ${SPEC_TO_BB_LIST} + + info_log "Gen bb files done, you can find it in ${ROS_BB_BASE}" +} + +main $* diff --git a/get-license.py b/get-license.py index 09a2b7c7b62faef2c4d4e909ab9bfd93feee7783..603cfbaa23eb6ea1e87b4633e15469a6a4bce443 100644 --- a/get-license.py +++ b/get-license.py @@ -494,6 +494,7 @@ def get_license(lic): 'GNU GPL v3.0': 'GPL-3.0-only', 'GPL v3': 'GPL-3.0-only', 'GPLv3': 'GPL-3.0-only', + 'GPLv3+': 'GPL-3.0-or-later', 'ECL2.0': 'EPL-2.0', 'Eclipse Public License 2.0': 'EPL-2.0', 'Mozilla Public License Version 1.1': 'MPL-1.1', diff --git a/humble/spec_to_bb.list b/humble/spec_to_bb.list new file mode 100644 index 0000000000000000000000000000000000000000..63f25de7974467fd89202a84fbedf0f304077cff --- /dev/null +++ b/humble/spec_to_bb.list @@ -0,0 +1,24 @@ +#package_name package_type is_native bbfile_name spec_url source_name unpack_name +python3-importlib-resources python yes python3-importlib-resources https://gitee.com/src-openeuler/python-importlib-resources/raw/openEuler-22.03-LTS-SP1/python-importlib-resources.spec importlib_resources-5.4.0.tar.gz importlib_resources-5.4.0 +python3-catkin_pkg python yes python3-catkin-pkg https://gitee.com/will_niutao/catkin_pkg/raw/master/catkin-pkg.spec 0.5.2.tar.gz catkin_pkg-0.5.2 +python3-sphinx python no python3-sphinx https://gitee.com/src-openeuler/python-sphinx/raw/openEuler-22.03-LTS-SP1/python-sphinx.spec Sphinx-4.4.0.tar.gz Sphinx-4.4.0 +python3-docutils python yes python3-docutils https://gitee.com/src-openeuler/python-docutils/raw/openEuler-22.03-LTS-SP1/python-docutils.spec docutils-0.17.1.tar.gz docutils-0.17.1 +python3-flake8 python yes python3-flake8 https://gitee.com/src-openeuler/python-flake8/raw/openEuler-22.03-LTS-SP1/python-flake8.spec flake8-3.9.2.tar.gz flake8-3.9.2 +python3-mock python yes python3-mock https://gitee.com/src-openeuler/python-mock/raw/openEuler-22.03-LTS-SP1/python-mock.spec mock-4.0.3.tar.gz mock-4.0.3 +#python3-mccabe python yes python3-mccabe https://gitee.com/src-openeuler/python-mccabe/raw/openEuler-22.03-LTS-SP1/python-mccabe.spec mccabe-0.6.1.tar.gz mccabe-0.6.1 +python3-empy python yes python3-empy https://gitee.com/will_niutao/python-empy/raw/master/python-empy.spec empy-3.3.4.tar.gz empy-3.3.4 +gtest cmake yes gtest https://gitee.com/src-openeuler/gtest/raw/openEuler-22.03-LTS-SP1/gtest.spec release-1.8.1.tar.gz googletest-release-1.8.1 +#python3-yaml python yes python3-yaml https://gitee.com/src-openeuler/PyYAML/raw/openEuler-22.03-LTS-SP1/PyYAML.spec PyYAML-6.0.tar.gz PyYAML-6.0 +console-bridge cmake yes console-bridge https://gitee.com/will_niutao/console_bridge/raw/master/console_bridge.spec 1.0.2.tar.gz console_bridge-1.0.2 +yaml-cpp cmake yes yaml-cpp https://gitee.com/src-openeuler/yaml-cpp/raw/openEuler-22.03-LTS-SP1/yaml-cpp.spec yaml-cpp-0.6.3.tar.gz yaml-cpp-yaml-cpp-0.6.3 +python3-lark-parser python yes python3-lark-parser https://gitee.com/src-openeuler/python-lark-parser/raw/master/python-lark-parser.spec lark-parser-0.12.0.tar.gz lark-parser-0.12.0 +python3-netifaces python yes python3-netifaces https://gitee.com/src-openeuler/python-netifaces/raw/openEuler-22.03-LTS-SP1/python-netifaces.spec netifaces-0.11.0.tar.gz netifaces-0.11.0 +pybind11 cmake yes pybind11 https://gitee.com/src-openeuler/pybind11/raw/openEuler-22.03-LTS-SP1/pybind11.spec v2.8.1.tar.gz pybind11-2.8.1 +tinyxml2 cmake yes tinyxml2 https://gitee.com/src-openeuler/tinyxml2/raw/openEuler-22.03-LTS-SP1/tinyxml2.spec tinyxml2-6.0.0-8c8293b.tar.gz tinyxml2-8c8293ba8969a46947606a93ff0cb5a083aab47a +python3-rosdistro python yes python3-rosdistro https://gitee.com/will_niutao/python-rosdistro/raw/master/python-rosdistro.spec 0.9.0.tar.gz rosdistro-0.9.0 +python3-rospkg python yes python3-rospkg https://gitee.com/will_niutao/python-rospkg/raw/master/python-rospkg.spec 1.5.0.tar.gz rospkg-1.5.0 +python3-catkin-sphinx python yes python3-catkin-sphinx https://gitee.com/will_niutao/python-catkin-sphinx/raw/master/python-catkin-sphinx.spec 0.3.2.tar.gz catkin-sphinx-0.3.2 +cppcheck cmake yes cppcheck https://gitee.com/src-openeuler/cppcheck/raw/openEuler-22.03-LTS-SP1/cppcheck.spec 2.6.3.tar.gz cppcheck-2.6.3 +python3-pydocstyle python yes python3-pydocstyle https://gitee.com/src-openeuler/python-pydocstyle/raw/openEuler-22.03-LTS-SP1/python-pydocstyle.spec 6.1.1.tar.gz pydocstyle-6.1.1 +#acl cmake yes acl https://gitee.com/src-openeuler/acl/raw/openEuler-22.03-LTS-SP1/acl.spec acl-2.3.1.tar.gz acl-2.3.1 +eigen3 cmake yes eigen3 https://gitee.com/will_niutao/eigen/raw/master/eigen3.spec eigen-3.3.8.tar.bz2 eigen-3.3.8