Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade system version of build container #2

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @RadxaYuntian
5 changes: 3 additions & 2 deletions .github/container/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
FROM debian:bullseye
FROM debian:bookworm

RUN dpkg --add-architecture arm64 && \
apt-get update && \
apt-get full-upgrade --no-install-recommends -y \
build-essential crossbuild-essential-arm64 default-jdk-headless git \
cmake debhelper devscripts lintian swig pkgconf:arm64 python3-dev:arm64 libjson-c-dev:arm64 && \
cmake debhelper devscripts lintian swig pkgconf:arm64 python3-dev:arm64 \
libjson-c-dev:arm64 libstdc++6:arm64 && \
adduser --gecos runner --disabled-password runner && \
rm -rf /var/lib/apt/lists/*
64 changes: 45 additions & 19 deletions cmake/modules/OpenCVDetectPython.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,55 @@ function(find_python preferred_version min_version library_env include_dir_env
if(NOT ${found})
if(${executable})
set(PYTHON_EXECUTABLE "${${executable}}")
set(Python_EXECUTABLE "${PYTHON_EXECUTABLE}")
CodeChenL marked this conversation as resolved.
Show resolved Hide resolved
endif()

find_package(PythonInterp "${preferred_version}")
if(NOT PYTHONINTERP_FOUND)
find_package(PythonInterp "${min_version}")
endif()
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.12")
find_package(Python "${preferred_version}" COMPONENTS Interpreter)
if(NOT Python_Interpreter_FOUND)
find_package(Python "${min_version}" COMPONENTS Interpreter)
endif()

if(PYTHONINTERP_FOUND)
# Copy outputs
set(_found ${PYTHONINTERP_FOUND})
set(_executable ${PYTHON_EXECUTABLE})
set(_version_string ${PYTHON_VERSION_STRING})
set(_version_major ${PYTHON_VERSION_MAJOR})
set(_version_minor ${PYTHON_VERSION_MINOR})
set(_version_patch ${PYTHON_VERSION_PATCH})
if(Python_Interpreter_FOUND)
# Copy outputs
set(_found ${Python_Interpreter_FOUND})
set(_executable ${Python_EXECUTABLE})
set(_version_string ${Python_VERSION})
set(_version_major ${Python_VERSION_MAJOR})
set(_version_minor ${Python_VERSION_MINOR})
set(_version_patch ${Python_VERSION_PATCH})

# Clear find_host_package side effects
unset(PYTHONINTERP_FOUND)
unset(PYTHON_EXECUTABLE CACHE)
unset(PYTHON_VERSION_STRING)
unset(PYTHON_VERSION_MAJOR)
unset(PYTHON_VERSION_MINOR)
unset(PYTHON_VERSION_PATCH)
# Clear find_host_package side effects
unset(Python_Interpreter_FOUND)
unset(Python_EXECUTABLE CACHE)
unset(Python_VERSION)
unset(Python_VERSION_MAJOR)
unset(Python_VERSION_MINOR)
unset(Python_VERSION_PATCH)
endif()
else()
find_package(PythonInterp "${preferred_version}")
if(NOT PYTHONINTERP_FOUND)
find_package(PythonInterp "${min_version}")
endif()

if(PYTHONINTERP_FOUND)
# Copy outputs
set(_found ${PYTHONINTERP_FOUND})
set(_executable ${PYTHON_EXECUTABLE})
set(_version_string ${PYTHON_VERSION_STRING})
set(_version_major ${PYTHON_VERSION_MAJOR})
set(_version_minor ${PYTHON_VERSION_MINOR})
set(_version_patch ${PYTHON_VERSION_PATCH})

# Clear find_host_package side effects
unset(PYTHONINTERP_FOUND)
unset(PYTHON_EXECUTABLE CACHE)
unset(PYTHON_VERSION_STRING)
unset(PYTHON_VERSION_MAJOR)
unset(PYTHON_VERSION_MINOR)
unset(PYTHON_VERSION_PATCH)
endif()
endif()

if(_found)
Expand Down
2 changes: 1 addition & 1 deletion debian/python3-mraa.install
Original file line number Diff line number Diff line change
@@ -1 +1 @@
usr/lib/python3.9/dist-packages/* usr/lib/python3/dist-packages/
usr/lib/python3*/dist-packages/* usr/lib/python3/dist-packages/
Loading