Add support for RK3576 platform and restructure vendor packages directory

This commit is contained in:
EricX-Zhao
2026-07-07 10:07:30 +03:00
parent 31d7fab23a
commit ea0313a66d
57 changed files with 116 additions and 34 deletions
+31
View File
@@ -0,0 +1,31 @@
#!/bin/bash
set -euo pipefail
SITE_PACKAGES="${1:?usage: extract_wheels.sh <site-packages-dir> <wheels-dir>}"
WHEELS_DIR="${2:?usage: extract_wheels.sh <site-packages-dir> <wheels-dir>}"
mkdir -p "$SITE_PACKAGES"
for f in "$WHEELS_DIR"/*; do
case "$f" in
*.whl)
python3 -m zipfile -e "$f" "$SITE_PACKAGES/"
;;
*.tar.gz|*.tar.bz2)
tmpdir=$(mktemp -d)
tar xf "$f" -C "$tmpdir"
for pkgdir in "$tmpdir"/*/; do
for inner in "$pkgdir"*/; do
if [ -f "${inner}__init__.py" ]; then
cp -r "$inner" "$SITE_PACKAGES/"
fi
done
find "$pkgdir" -maxdepth 1 -name "*.py" -exec cp {} "$SITE_PACKAGES/" \;
done
rm -rf "$tmpdir"
;;
esac
done
echo "Extraction done. Contents of $SITE_PACKAGES:"
ls "$SITE_PACKAGES"
@@ -0,0 +1,32 @@
cmake_minimum_required(VERSION 3.8)
project(asio_vendor)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
include(FetchContent)
FetchContent_Declare(
asio_vendor
GIT_REPOSITORY https://github.com/chriskohlhoff/asio.git
GIT_TAG asio-1-28-1
GIT_SHALLOW TRUE
)
FetchContent_GetProperties(asio_vendor)
if (NOT asio_vendor_POPULATED)
FetchContent_Populate(asio_vendor)
message(STATUS "asio_vendor_SOURCE_DIR: ${asio_vendor_SOURCE_DIR}")
install(
DIRECTORY ${asio_vendor_SOURCE_DIR}/asio/include/
DESTINATION include
PATTERN ".gitignore" EXCLUDE # 排除所有 txt 文件
PATTERN "*.am" EXCLUDE # 排除 docs 目录
)
endif()
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>asio_vendor</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="ericzhao0325@163.com">ericx</maintainer>
<license>TODO: License declaration</license>
<export>
<build_type>cmake</build_type>
</export>
</package>
@@ -0,0 +1,30 @@
cmake_minimum_required(VERSION 3.8)
project(ceres_vendor)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
include(FetchContent)
FetchContent_Declare(
ceres_vendor
URL https://github.com/ceres-solver/ceres-solver/archive/refs/tags/2.1.0.tar.gz
# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/
)
set(MINIGLOG ON CACHE BOOL "Use a stripped down version of glog." FORCE)
set(GFLAGS OFF CACHE BOOL "Enable Google Flags." FORCE)
set(BUILD_SHARED_LIBS ON CACHE BOOL "Build Shared Library" FORCE)
set(BUILD_EXAMPLES OFF CACHE BOOL "BUILD_EXAMPLES" FORCE)
set(BUILD_TESTING OFF CACHE BOOL "BUILD_TESTING" FORCE)
set(BUILD_BENCHMARKS OFF CACHE BOOL "BUILD_BENCHMARKS" FORCE)
set(CMAKE_BUILD_TYPE Release)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMAX_LOG_LEVEL=-1")
FetchContent_MakeAvailable(ceres_vendor)
+17
View File
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>ceres_vendor</name>
<version>2.1.0</version>
<description>ceres 2.1.0</description>
<maintainer email="ericzhao0325@163.com">ericx</maintainer>
<license>TODO: License declaration</license>
<depend>eigen3_vendor</depend>
<!-- <depend>glog_vendor</depend> -->
<!-- <depend>suitesparse_vendor</depend> -->
<export>
<build_type>cmake</build_type>
</export>
</package>
@@ -0,0 +1,25 @@
cmake_minimum_required(VERSION 3.8)
project(console_bridge_vendor)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
include(ExternalProject)
ExternalProject_Add(
console_bridge_vendor
GIT_REPOSITORY https://github.com/ros/console_bridge.git
GIT_TAG 81ec67f6daf3cd19ef506e00f02efb1645597b9c
CMAKE_ARGS
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-DBUILD_TESTING=OFF
)
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>console_bridge_vendor</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="ericzhao0325@163.com">ericx</maintainer>
<license>TODO: License declaration</license>
<export>
<build_type>cmake</build_type>
</export>
</package>
@@ -0,0 +1,29 @@
cmake_minimum_required(VERSION 3.8)
project(eigen3_vendor)
set(eigen3_vendor_MAJOR_VERSION 0)
set(eigen3_vendor_MINOR_VERSION 0)
set(eigen3_vendor_PATCH_VERSION 0)
set(eigen3_vendor_VERSION
${eigen3_vendor_MAJOR_VERSION}.${eigen3_vendor_MINOR_VERSION}.${eigen3_vendor_PATCH_VERSION})
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
include(FetchContent)
FetchContent_Declare(
eigen3
URL https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz
# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/
)
set(CMAKE_BUILD_TYPE Release)
set(BUILD_TESTING OFF)
FetchContent_MakeAvailable(eigen3)
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>eigen3_vendor</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="ericzhao0325@163.com">ericx</maintainer>
<license>TODO: License declaration</license>
<export>
<build_type>cmake</build_type>
</export>
</package>
@@ -0,0 +1,26 @@
cmake_minimum_required(VERSION 3.8)
project(flann_vendor)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
include(FetchContent)
FetchContent_Declare(
flann
URL https://github.com/flann-lib/flann/archive/refs/tags/1.9.2.tar.gz
)
set(BUILD_PYTHON_BINDINGS OFF CACHE BOOL "BUILD_PYTHON_BINDINGS." FORCE)
set(BUILD_MATLAB_BINDINGS OFF CACHE BOOL "BUILD_MATLAB_BINDINGS." FORCE)
set(BUILD_EXAMPLES OFF CACHE BOOL "BUILD_EXAMPLES." FORCE)
set(BUILD_TESTS OFF CACHE BOOL "BUILD_TESTS." FORCE)
set(BUILD_DOC OFF CACHE BOOL "BUILD_DOC." FORCE)
set(CMAKE_BUILD_TYPE Release)
FetchContent_MakeAvailable(flann)
+15
View File
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>flann_vendor</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="ericzhao0325@163.com">ericx</maintainer>
<license>TODO: License declaration</license>
<depend>liblz4_vendor</depend>
<export>
<build_type>cmake</build_type>
</export>
</package>
@@ -0,0 +1,21 @@
cmake_minimum_required(VERSION 3.8)
project(geographiclib_vendor)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
include(FetchContent)
FetchContent_Declare(
geographiclib_vendor
URL https://github.com/geographiclib/geographiclib/archive/refs/tags/v2.5.tar.gz
)
set(CMAKE_BUILD_TYPE Release)
FetchContent_MakeAvailable(geographiclib_vendor)
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>geographiclib_vendor</name>
<version>2.1.0</version>
<description>ceres 2.1.0</description>
<maintainer email="ericzhao0325@163.com">ericx</maintainer>
<license>TODO: License declaration</license>
<export>
<build_type>cmake</build_type>
</export>
</package>
@@ -0,0 +1,25 @@
cmake_minimum_required(VERSION 3.8)
project(gflags_vendor)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
include(FetchContent)
FetchContent_Declare(
gflags_vendor
URL https://github.com/gflags/gflags/archive/v2.2.1.zip
# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/
)
set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared libraries" FORCE)
set(INSTALL_HEADERS ON CACHE BOOL "Request installation of headers and other development files." FORCE)
set(GFLAGS_NAMESPACE "google" CACHE STRING "gflags namespace" FORCE)
FetchContent_MakeAvailable(gflags_vendor)
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>gflags_vendor</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="ericzhao0325@163.com">ericx</maintainer>
<license>TODO: License declaration</license>
<export>
<build_type>cmake</build_type>
</export>
</package>
@@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 3.8)
project(glog_vendor)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
include(FetchContent)
FetchContent_Declare(
glog_vendor
URL https://github.com/google/glog/archive/refs/tags/v0.7.1.tar.gz
)
set(BUILD_EXAMPLES OFF CACHE BOOL "BUILD_EXAMPLES" FORCE)
set(WITH_GTEST OFF CACHE BOOL "WITH_GTEST" FORCE)
FetchContent_MakeAvailable(glog_vendor)
+15
View File
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>glog_vendor</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="ericzhao0325@163.com">ericx</maintainer>
<license>TODO: License declaration</license>
<depend>gflags_vendor</depend>
<export>
<build_type>cmake</build_type>
</export>
</package>
@@ -0,0 +1,23 @@
cmake_minimum_required(VERSION 3.8)
project(json_vendor)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
include(FetchContent)
FetchContent_Declare(
json_vendor
URL https://github.com/nlohmann/json/archive/refs/tags/v3.12.0.tar.gz
)
set(CMAKE_BUILD_TYPE Release)
set(JSON_BuildTests OFF CACHE BOOL "JSON_BuildTests" FORCE)
set(JSON_Install ON CACHE BOOL "JSON_Install" FORCE)
FetchContent_MakeAvailable(json_vendor)
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>json_vendor</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="ericzhao0325@163.com">ericx</maintainer>
<license>TODO: License declaration</license>
<export>
<build_type>cmake</build_type>
</export>
</package>
@@ -0,0 +1,27 @@
cmake_minimum_required(VERSION 3.10)
project(liblz4_vendor)
# ament_package(CONFIG_EXTRAS liblz4_vendor-extras.cmake)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
include(FetchContent)
FetchContent_Declare(
liblz4_vendor
URL https://github.com/lz4/lz4/archive/refs/tags/v1.9.4.tar.gz
SOURCE_SUBDIR build/cmake
)
set(BUILD_STATIC_LIBS OFF CACHE BOOL "BUILD_STATIC_LIBS." FORCE)
set(LZ4_BUILD_LEGACY_LZ4C OFF CACHE BOOL "LZ4_BUILD_LEGACY_LZ4C." FORCE)
set(LZ4_BUILD_CLI OFF CACHE BOOL "LZ4_BUILD_CLI." FORCE)
set(LZ4_BUNDLED_MODE OFF CACHE BOOL "LZ4_BUILD_CLI." FORCE)
set(CMAKE_BUILD_TYPE Release)
FetchContent_MakeAvailable(liblz4_vendor)
+17
View File
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="2">
<name>liblz4_vendor</name>
<version>0.0.0</version>
<maintainer email="ericzhao0325@163.com">ericx</maintainer>
<description>LZ4 compression vendor package, providing a dependency for LZ4.</description>
<license>Apache License 2.0</license> <!-- the contents of this package are Apache 2.0 -->
<license>BSD</license> <!-- The LZ4 library is BSD; see README.md for more information -->
<license>GPLv2</license> <!-- All other LZ4 files are GPLv2; see README.md for more information -->
<url type="website">https://github.com/lz4/lz4/</url>
<export>
<build_type>cmake</build_type>
</export>
</package>
@@ -0,0 +1,19 @@
cmake_minimum_required(VERSION 3.8)
project(libyaml_vendor)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
include(FetchContent)
FetchContent_Declare(
libyaml_vendor
URL https://github.com/yaml/libyaml/archive/refs/tags/0.2.5.tar.gz
)
FetchContent_MakeAvailable(libyaml_vendor)
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>libyaml_vendor</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="ericzhao0325@163.com">ericx</maintainer>
<license>TODO: License declaration</license>
<export>
<build_type>cmake</build_type>
</export>
</package>
@@ -0,0 +1,20 @@
cmake_minimum_required(VERSION 3.8)
project(mimick_vendor)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
include(FetchContent)
FetchContent_Declare(
mimick_vendor
GIT_REPOSITORY https://github.com/ros2/Mimick.git
GIT_TAG 1e138b0e13da99278453dc96af954890d9f48348
)
FetchContent_MakeAvailable(mimick_vendor)
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>mimick_vendor</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="ericzhao0325@163.com">ericx</maintainer>
<license>TODO: License declaration</license>
<export>
<build_type>cmake</build_type>
</export>
</package>
@@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 3.8)
project(openblas_vendor)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
include(FetchContent)
FetchContent_Declare(
openblas_vendor
URL https://github.com/OpenMathLib/OpenBLAS/archive/refs/tags/v0.3.31.tar.gz
)
set(BUILD_TESTING OFF CACHE BOOL "BUILD_TESTING." FORCE)
set(BUILD_SHARED_LIBS ON CACHE BOOL "BUILD_SHARED_LIBS." FORCE)
FetchContent_MakeAvailable(openblas_vendor)
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>openblas_vendor</name>
<version>0.3.31</version>
<description>TODO: Package description</description>
<maintainer email="ericzhao0325@163.com">ericx</maintainer>
<license>TODO: License declaration</license>
<export>
<build_type>cmake</build_type>
</export>
</package>
@@ -0,0 +1,67 @@
cmake_minimum_required(VERSION 3.8)
project(opencv_vendor)
set(opencv_MAJOR_VERSION 0)
set(opencv_MINOR_VERSION 0)
set(opencv_PATCH_VERSION 0)
set(opencv_VERSION
${opencv_MAJOR_VERSION}.${opencv_MINOR_VERSION}.${opencv_PATCH_VERSION})
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
include(FetchContent)
FetchContent_Declare(
opencv
URL https://github.com/opencv/opencv/archive/refs/tags/4.12.0.tar.gz
)
FetchContent_Declare(
opencv_contrib
URL https://github.com/opencv/opencv_contrib/archive/refs/tags/4.12.0.tar.gz
)
# 先单独 populate contrib:只解压,不当子工程 configure(它根目录没有 CMakeLists.txt
FetchContent_GetProperties(opencv_contrib)
if(NOT opencv_contrib_POPULATED)
FetchContent_Populate(opencv_contrib)
endif()
# 必须是 CACHE PATH,且要在 MakeAvailable(opencv) 之前设
set(OPENCV_EXTRA_MODULES_PATH "${opencv_contrib_SOURCE_DIR}/modules"
CACHE PATH "" FORCE)
set(WITH_ADE OFF)
set(WITH_GTK OFF)
set(WITH_ITT OFF)
set(WITH_IPP OFF)
set(WITH_VTK OFF)
set(BUILD_IPP_IW OFF)
set(BUILD_ITT OFF)
set(BUILD_JAVA OFF)
set(BUILD_JPEG ON)
set(BUILD_PACKAGE OFF)
set(BUILD_PERF_TESTS OFF)
set(BUILD_PNG ON)
set(BUILD_TESTS OFF)
set(BUILD_TIFF ON)
set(BUILD_WEBP ON)
set(BUILD_ZLIB ON)
set(BUILD_opencv_apps OFF)
set(CMAKE_CXX_STANDARD 14)
set(BUILD_ANDROID_PROJECTS OFF)
set(BUILD_ANDROID_EXAMPLES OFF)
set(BUILD_EXAMPLES OFF)
set(WITH_OPENCL ON)
set(BUILD_opencv_python3 OFF)
set(BUILD_opencv_python2 OFF)
set(ENABLE_NEON ON)
set(BUILD_SHARED_LIBS ON)
set(CMAKE_BUILD_TYPE Release)
FetchContent_MakeAvailable(opencv)
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>opencv_vendor</name>
<version>4.12.0</version>
<description>opencv vendor</description>
<maintainer email="ericzhao0325@163.com">ericx</maintainer>
<license>TODO: License declaration</license>
<export>
<build_type>cmake</build_type>
</export>
</package>
@@ -0,0 +1,27 @@
cmake_minimum_required(VERSION 3.8)
project(orocos_kdl_vendor)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
include(FetchContent)
FetchContent_Declare(
orocos_kdl_vendor
GIT_REPOSITORY https://github.com/orocos/orocos_kinematics_dynamics.git
GIT_TAG ce4bcb65a050615b6d7f21bc60fbb2656515791b
)
if (NOT orocos_kdl_vendor_POPULATED)
FetchContent_Populate(orocos_kdl_vendor)
set(CMAKE_CXX_STANDARD 14)
set(ENABLE_TESTS OFF CACHE BOOL "ENABLE_TESTS" FORCE)
set(ENABLE_EXAMPLES OFF CACHE BOOL "ENABLE_EXAMPLES" FORCE)
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)
add_subdirectory(${orocos_kdl_vendor_SOURCE_DIR}/orocos_kdl ${orocos_kdl_vendor_BINARY_DIR})
endif()
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>orocos_kdl_vendor</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="ericzhao0325@163.com">ericx</maintainer>
<license>TODO: License declaration</license>
<depend>eigen3_vendor</depend>
<export>
<build_type>cmake</build_type>
</export>
</package>
+38
View File
@@ -0,0 +1,38 @@
cmake_minimum_required(VERSION 3.8)
project(pcl_vendor)
set(tinyxml2_MAJOR_VERSION 0)
set(tinyxml2_MINOR_VERSION 0)
set(tinyxml2_PATCH_VERSION 0)
set(tinyxml2_VERSION
${tinyxml2_MAJOR_VERSION}.${tinyxml2_MINOR_VERSION}.${tinyxml2_PATCH_VERSION})
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
include(FetchContent)
FetchContent_Declare(
pcl
URL https://github.com/PointCloudLibrary/pcl/archive/refs/tags/pcl-1.15.1.tar.gz
)
set(WITH_LIBUSB OFF CACHE BOOL "WITH_LIBUSB." FORCE)
set(WITH_CUDA OFF CACHE BOOL "WITH_CUDA." FORCE)
set(WITH_PCAP OFF CACHE BOOL "WITH_PCAP." FORCE)
set(WITH_OPENGL OFF CACHE BOOL "WITH_OPENGL." FORCE)
set(WITH_GLEW OFF CACHE BOOL "WITH_GLEW." FORCE)
set(WITH_VTK OFF CACHE BOOL "WITH_VTK." FORCE)
set(BUILD_apps OFF CACHE BOOL "BUild_apps." FORCE)
set(BUILD_global_tests OFF CACHE BOOL "BUild_global_tests." FORCE)
# set(BUILD_features OFF CACHE BOOL "BUILD_features." FORCE)
# set(BUILD_sample_consensus OFF CACHE BOOL "BUILD_sample_consensus." FORCE)
# set(BUILD_segmentation OFF CACHE BOOL "BUILD_segmentation." FORCE)
set(CMAKE_BUILD_TYPE Release)
FetchContent_MakeAvailable(pcl)
+16
View File
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>pcl_vendor</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="ericzhao0325@163.com">ericx</maintainer>
<license>TODO: License declaration</license>
<depend>eigen3_vendor</depend>
<depend>flann_vendor</depend>
<export>
<build_type>cmake</build_type>
</export>
</package>
@@ -0,0 +1,29 @@
cmake_minimum_required(VERSION 3.8)
project(pybind11_vendor)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
include(FetchContent)
FetchContent_Declare(
pybind11_vendor
GIT_REPOSITORY https://github.com/pybind/pybind11.git
GIT_TAG v2.11.1
GIT_SHALLOW TRUE
)
if (NOT pybind11_vendor_POPULATED)
FetchContent_Populate(pybind11_vendor)
set(CMAKE_BUILD_TYPE Release)
set(PYBIND11_INSTALL ON CACHE BOOL "PYBIND11_INSTALL" FORCE)
set(PYBIND11_TEST OFF CACHE BOOL "PYBIND11_TEST" FORCE)
set(PYBIND11_NOPYTHON ON CACHE BOOL "PYBIND11_NOPYTHON" FORCE)
add_subdirectory(${pybind11_vendor_SOURCE_DIR} ${pybind11_vendor_BINARY_DIR})
endif()
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>pybind11_vendor</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="ericzhao0325@163.com">ericx</maintainer>
<license>TODO: License declaration</license>
<export>
<build_type>cmake</build_type>
</export>
</package>
@@ -0,0 +1,26 @@
cmake_minimum_required(VERSION 3.8)
project(spdlog_vendor)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
include(FetchContent)
FetchContent_Declare(
spdlog_vendor
URL https://github.com/gabime/spdlog/archive/refs/tags/v1.12.0.tar.gz
)
set(CMAKE_BUILD_TYPE Release)
set(SPDLOG_BUILD_SHARED ON CACHE BOOL "SPDLOG_BUILD_SHARED" FORCE)
set(SPDLOG_BUILD_TESTS OFF CACHE BOOL "SPDLOG_BUILD_TESTS" FORCE)
set(SPDLOG_BUILD_EXAMPLE OFF CACHE BOOL "SPDLOG_BUILD_EXAMPLE" FORCE)
set(SPDLOG_INSTALL ON CACHE BOOL "SPDLOG_INSTALL" FORCE)
set(SPDLOG_BUILD_PIC ON CACHE BOOL "SPDLOG_BUILD_PIC" FORCE)
FetchContent_MakeAvailable(spdlog_vendor)
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>spdlog_vendor</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="ericzhao0325@163.com">ericx</maintainer>
<license>TODO: License declaration</license>
<export>
<build_type>cmake</build_type>
</export>
</package>
@@ -0,0 +1,38 @@
cmake_minimum_required(VERSION 3.8)
project(suitesparse_vendor)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
include(FetchContent)
FetchContent_Declare(
suitesparse_vendor
URL https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/refs/tags/v7.12.1.tar.gz
SOURCE_SUBDIR SuiteSparse-7.12.1
)
FetchContent_GetProperties(suitesparse_vendor)
if (NOT suitesparse_vendor_POPULATED)
FetchContent_Populate(suitesparse_vendor)
set(BUILD_SHARED_LIBS ON CACHE BOOL "BUILD_SHARED_LIBS." FORCE)
set(BUILD_STATIC_LIBS OFF CACHE BOOL "BUILD_STATIC_LIBS." FORCE)
set(SUITESPARSE_ROOT_CMAKELISTS OFF CACHE BOOL "SUITESPARSE_ROOT_CMAKELISTS." FORCE)
set(SUITESPARSE_ENABLE_PROJECTS "suitesparse_config;mongoose;amd;btf;camd;ccolamd;colamd;cholmod;cxsparse;ldl;klu;umfpack;paru;rbio;spqr" CACHE STRING "" FORCE)
set(BUILD_TESTING OFF CACHE BOOL "BUILD_TESTING." FORCE)
set(SUITESPARSE_DEMOS OFF CACHE BOOL "SUITESPARSE_DEMOS." FORCE)
add_subdirectory(${suitesparse_vendor_SOURCE_DIR} ${suitesparse_vendor_BINARY_DIR})
endif()
# cmake .. \
# -DCMAKE_TOOLCHAIN_FILE=/opt/cmake/rk3588.toolchain.cmake \
# -DCMAKE_INSTALL_PREFIX=/workspace/output/RK3588/install \
# -DSUITESPARSE_ENABLE_PROJECTS="suitesparse_config;mongoose;amd;btf;camd;ccolamd;colamd;cholmod;cxsparse;ldl;klu;umfpack;paru;rbio;spqr" \
# -DBUILD_SHARED_LIBS=ON \
# -DSUITESPARSE_DEMOS=OFF \
# -DCMAKE_EXE_LINKER_FLAGS="-Wl,-rpath-link,/workspace/output/RK3588/install/lib" \
# -DBUILD_TESTING=OFF \
# -DBUILD_STATIC_LIBS=OFF
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>suitesparse_vendor</name>
<version>7.12.1</version>
<description>TODO: Package description</description>
<maintainer email="ericzhao0325@163.com">ericx</maintainer>
<license>TODO: License declaration</license>
<depend>openblas_vendor</depend>
<export>
<build_type>cmake</build_type>
</export>
</package>
@@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.8)
project(system_vendor_packages)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
@@ -0,0 +1,29 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>system_vendor_packages</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="ericzhao0325@163.com">ericx</maintainer>
<license>TODO: License declaration</license>
<depend>liblz4_vendor</depend>
<depend>libyaml_vendor</depend>
<depend>tinyxml2_vendor</depend>
<depend>yaml_cpp_vendor</depend>
<depend>zstd_vendor</depend>
<depend>geographiclib_vendor</depend>
<depend>orocos_kdl_vendor</depend>
<depend>uncrustify_vendor</depend>
<depend>mimick_vendor</depend>
<depend>pybind11_vendor</depend>
<depend>spdlog_vendor</depend>
<depend>asio_vendor</depend>
<depend>console_bridge_vendor</depend>
<depend>zlib_vendor</depend>
<depend>json_vendor</depend>
<export>
<build_type>cmake</build_type>
</export>
</package>
@@ -0,0 +1,23 @@
cmake_minimum_required(VERSION 3.8)
project(tinyxml2_vendor)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
include(FetchContent)
FetchContent_Declare(
tinyxml2_vendor
URL https://github.com/leethomason/tinyxml2/archive/refs/tags/10.0.0.tar.gz
# SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ext/
)
set(tinyxml2_SHARED_LIBS ON)
set(CMAKE_BUILD_TYPE Release)
set(tinyxml2_BUILD_TESTING OFF)
FetchContent_MakeAvailable(tinyxml2_vendor)
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>tinyxml2_vendor</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="ericzhao0325@163.com">ericx</maintainer>
<license>TODO: License declaration</license>
<export>
<build_type>cmake</build_type>
</export>
</package>
@@ -0,0 +1,23 @@
cmake_minimum_required(VERSION 3.8)
project(uncrustify_vendor)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
include(FetchContent)
FetchContent_Declare(
uncrustify_vendor
GIT_REPOSITORY https://github.com/uncrustify/uncrustify.git
GIT_TAG uncrustify-0.78.1
GIT_SHALLOW TRUE
)
set(NoGitVersionString ON CACHE BOOL "NoGitVersionString" FORCE)
FetchContent_MakeAvailable(uncrustify_vendor)
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>uncrustify_vendor</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="ericzhao0325@163.com">ericx</maintainer>
<license>TODO: License declaration</license>
<export>
<build_type>cmake</build_type>
</export>
</package>
@@ -0,0 +1,22 @@
cmake_minimum_required(VERSION 3.8)
project(yaml_cpp_vendor)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
include(FetchContent)
FetchContent_Declare(
yaml_cpp_vendor
URL https://github.com/jbeder/yaml-cpp/archive/refs/tags/yaml-cpp-0.9.0.tar.gz
)
set(CMAKE_BUILD_TYPE Release)
set(YAML_BUILD_SHARED_LIBS ON CACHE BOOL "YAML_BUILD_SHARED_LIBS" FORCE)
set(YAML_CPP_INSTALL ON CACHE BOOL "YAML_CPP_INSTALL" FORCE)
FetchContent_MakeAvailable(yaml_cpp_vendor)
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>yaml_cpp_vendor</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="ericzhao0325@163.com">ericx</maintainer>
<license>TODO: License declaration</license>
<export>
<build_type>cmake</build_type>
</export>
</package>
@@ -0,0 +1,22 @@
cmake_minimum_required(VERSION 3.8)
project(zlib_vendor)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
include(FetchContent)
FetchContent_Declare(
zlib_vendor
URL https://github.com/madler/zlib/archive/refs/tags/v1.3.1.tar.gz
)
set(CMAKE_BUILD_TYPE Release)
set(ZLIB_BUILD_EXAMPLES OFF CACHE BOOL "ZLIB_BUILD_EXAMPLES" FORCE)
FetchContent_MakeAvailable(zlib_vendor)
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>zlib_vendor</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="ericzhao0325@163.com">ericx</maintainer>
<license>TODO: License declaration</license>
<export>
<build_type>cmake</build_type>
</export>
</package>
@@ -0,0 +1,25 @@
cmake_minimum_required(VERSION 3.8)
project(zstd_vendor)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
include(FetchContent)
FetchContent_Declare(
zstd_vendor
URL https://github.com/facebook/zstd/archive/refs/tags/v1.5.7.tar.gz
SOURCE_SUBDIR build/cmake
)
set(CMAKE_BUILD_TYPE Release)
set(ZSTD_BUILD_STATIC ON CACHE BOOL "ZSTD_BUILD_STATIC" FORCE)
set(ZSTD_BUILD_SHARED ON CACHE BOOL "ZSTD_BUILD_SHARED" FORCE)
set(ZSTD_BUILD_PROGRAMS ON CACHE BOOL "ZSTD_BUILD_PROGRAMS" FORCE)
FetchContent_MakeAvailable(zstd_vendor)
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>zstd_vendor</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="ericzhao0325@163.com">ericx</maintainer>
<license>TODO: License declaration</license>
<export>
<build_type>cmake</build_type>
</export>
</package>
+199
View File
@@ -0,0 +1,199 @@
ARG CC_PLATFORM_IMAGE
FROM ${CC_PLATFORM_IMAGE} AS system_packages
COPY vendor/packages workspace/src/
RUN cd workspace \
&& colcon build \
--install-base ${TARGET_SYSROOT} \
--merge-install \
--packages-up-to system_vendor_packages \
--cmake-force-configure \
--cmake-args \
--no-warn-unused-cli \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=OFF \
-DCMAKE_TOOLCHAIN_FILE=${CC_TOOLCHAIN_FILE}
FROM ${CC_PLATFORM_IMAGE} AS ceres_vendor
COPY vendor/packages/eigen3_vendor workspace/src/eigen3_vendor
# COPY vendor_packages/gflags_vendor workspace/src/gflags_vendor
# COPY vendor_packages/glog_vendor workspace/src/glog_vendor
# COPY vendor_packages/openblas_vendor workspace/src/openblas_vendor
# COPY vendor_packages/suitesparse_vendor workspace/src/suitesparse_vendor
COPY vendor/packages/ceres_vendor workspace/src/ceres_vendor
RUN cd workspace \
&& colcon build \
--install-base ${TARGET_SYSROOT} \
--merge-install \
--packages-up-to ceres_vendor \
--cmake-force-configure \
--cmake-args \
--no-warn-unused-cli \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=${CC_TOOLCHAIN_FILE}
FROM ${CC_PLATFORM_IMAGE} AS opencv_vendor
COPY vendor/packages/opencv_vendor workspace/src/opencv_vendor
RUN cd workspace \
&& colcon build \
--install-base ${TARGET_SYSROOT} \
--merge-install \
--packages-up-to opencv_vendor \
--cmake-force-configure \
--cmake-args \
--no-warn-unused-cli \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=${CC_TOOLCHAIN_FILE}
FROM ${CC_PLATFORM_IMAGE} AS boost
WORKDIR /tmp
RUN wget https://archives.boost.io/release/1.83.0/source/boost_1_83_0.tar.gz
RUN tar -zxf boost_1_83_0.tar.gz \
&& cd boost_1_83_0 \
&& ./bootstrap.sh --prefix=${TARGET_SYSROOT} --without-libraries=python \
&& sed -i "/using gcc/c using gcc : arm64 : aarch64-none-linux-gnu-gcc ;" project-config.jam \
&& ./b2 cxxflags="-fPIC" cflags="-fPIC" link=static install
FROM ${CC_PLATFORM_IMAGE} AS pcl_vendor
COPY vendor/packages/eigen3_vendor workspace/src/eigen3_vendor
COPY vendor/packages/liblz4_vendor workspace/src/liblz4_vendor
COPY vendor/packages/flann_vendor workspace/src/flann_vendor
COPY vendor/packages/pcl_vendor workspace/src/pcl_vendor
COPY --from=boost ${TARGET_SYSROOT} ${TARGET_SYSROOT}
RUN cd workspace \
&& colcon build \
--install-base ${TARGET_SYSROOT} \
--merge-install \
--packages-up-to pcl_vendor \
--cmake-force-configure \
--cmake-args \
--no-warn-unused-cli \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=${CC_TOOLCHAIN_FILE}
# OpenSSL
FROM ${CC_PLATFORM_IMAGE} AS ssl_builder
WORKDIR /tmp
RUN git clone --depth=1 https://github.com/janbar/openssl-cmake.git \
&& cd openssl-cmake \
&& mkdir build \
&& cd build \
&& cmake .. \
-DCMAKE_TOOLCHAIN_FILE=${CC_TOOLCHAIN_FILE} \
-DCMAKE_INSTALL_PREFIX=${TARGET_SYSROOT} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
&& make -j$(($(nproc) / 2)) && make install \
&& rm -rf /tmp
# ffi
FROM ${CC_PLATFORM_IMAGE} AS ffi_builder
RUN git clone --depth=1 https://github.com/libffi/libffi.git \
&& cd libffi \
&& ./autogen.sh \
&& ./configure --host=aarch64-none-linux-gnu --build=x86_64-linux-gnu --disable-docs --prefix=${TARGET_SYSROOT} \
&& make -j$(nproc) && make install
# Python 3.12
FROM ${CC_PLATFORM_IMAGE} AS python_builder
WORKDIR /tmp
COPY --from=ssl_builder ${TARGET_SYSROOT} ${TARGET_SYSROOT}
COPY --from=system_packages ${TARGET_SYSROOT} ${TARGET_SYSROOT}
COPY --from=ffi_builder ${TARGET_SYSROOT} ${TARGET_SYSROOT}
# COPY vendor_packages/Python-3.10.12.tar.xz .
RUN wget https://www.python.org/ftp/python/3.10.12/Python-3.10.12.tar.xz \
&& tar -xf Python-3.10.12.tar.xz \
&& rm Python-3.10.12.tar.xz
# 配置和编译 Python
WORKDIR /tmp/Python-3.10.12
ENV CC=aarch64-none-linux-gnu-gcc \
CXX=aarch64-none-linux-gnu-g++ \
AR=aarch64-none-linux-gnu-ar \
RANLIB=aarch64-none-linux-gnu-ranlib \
HOSTARCH=aarch64-none-linux-gnu \
BUILDARCH=x86_64-linux-gnu
ENV CPPFLAGS="-I${TARGET_SYSROOT}/include" \
LDFLAGS="-L${TARGET_SYSROOT}/lib -Wl,-rpath-link=${TARGET_SYSROOT}/lib" \
CFLAGS="-fPIC" \
PKG_CONFIG_PATH="" \
PKG_CONFIG_LIBDIR="${TARGET_SYSROOT}/lib/pkgconfig" \
PKG_CONFIG_SYSROOT_DIR="${TARGET_SYSROOT}"
RUN ./configure \
--host=aarch64-none-linux-gnu \
--build=x86_64-linux-gnu \
--prefix=${TARGET_SYSROOT} \
--enable-shared \
--disable-ipv6 \
--enable-optimizations \
--with-openssl=${TARGET_SYSROOT} \
ac_cv_file__dev_ptmx=yes \
ac_cv_file__dev_ptc=yes \
&& make -j$(($(nproc) / 2)) \
&& make install
# https://github.com/benfogle/crossenv
# cross compile python packages
WORKDIR /tmp
COPY vendor/extract_wheels.sh /tmp/extract_wheels.sh
# python packages
RUN pip download --no-deps -d /wheels \
empy==3.3.4 \
lark \
pyyaml \
catkin_pkg \
setuptools \
packaging \
pyparsing \
argcomplete \
osrf-pycommon \
typing-extensions \
psutil
# python packages with c extension
RUN pip download \
--no-deps \
--only-binary=:all: \
--python-version 310 \
--implementation cp \
--abi cp310 \
--platform manylinux2014_aarch64 \
-d /wheels \
psutil
RUN chmod +x /tmp/extract_wheels.sh && \
/tmp/extract_wheels.sh "${TARGET_SYSROOT}/lib/python3.10/site-packages" /wheels
RUN python3 -m pip install crossenv \
&& python3 -m crossenv ${TARGET_SYSROOT}/bin/python3 venv \
&& . venv/bin/activate \
&& pip -v install numpy==1.21.5 --prefix=${TARGET_SYSROOT}
FROM ${CC_PLATFORM_IMAGE} AS final
COPY --from=system_packages ${TARGET_SYSROOT} ${TARGET_SYSROOT}
COPY --from=ceres_vendor ${TARGET_SYSROOT} ${TARGET_SYSROOT}
COPY --from=opencv_vendor ${TARGET_SYSROOT} ${TARGET_SYSROOT}
COPY --from=pcl_vendor ${TARGET_SYSROOT} ${TARGET_SYSROOT}
COPY --from=python_builder ${TARGET_SYSROOT} ${TARGET_SYSROOT}