diff --git a/CI/kuiper/AppRun b/CI/kuiper/AppRun index 9a575a5c17..f66a8dcf19 100755 --- a/CI/kuiper/AppRun +++ b/CI/kuiper/AppRun @@ -7,4 +7,9 @@ export QT_PLUGIN_PATH=$HERE/usr/plugins export QT_QPA_PLATFORM_PLUGIN_PATH=$HERE/usr/plugins/platforms export LD_LIBRARY_PATH=$HERE/usr/lib +python_dir=$(find "$HERE/usr/lib/" -maxdepth 1 -type d -name "python3.*") +export PYTHONHOME=$python_dir +export PYTHONPATH=$python_dir:$python_dir/lib-dynload:$python_dir/site-packages:$python_dir/encodings +echo "Starting Scopy" +ldd $HERE/usr/bin/scopy exec $HERE/usr/bin/scopy diff --git a/CI/kuiper/kuiper_build_config.sh b/CI/kuiper/kuiper_build_config.sh index d9d53f5683..157d6f7978 100644 --- a/CI/kuiper/kuiper_build_config.sh +++ b/CI/kuiper/kuiper_build_config.sh @@ -14,6 +14,10 @@ QWT_BRANCH=qwt-multiaxes-updated LIBTINYIIOD_BRANCH=master IIOEMU_BRANCH=master +export APPIMAGE=1 + +PYTHON_VERSION=python3.9 # default python version used in CI scripts, can be changed to match locally installed python + STAGING_AREA=$SRC_DIR/CI/kuiper/staging SYSROOT=$STAGING_AREA/sysroot SYSROOT_TAR=$STAGING_AREA/sysroot.tar.gz diff --git a/CI/kuiper/kuiper_build_process.sh b/CI/kuiper/kuiper_build_process.sh index fba1523027..304ca9b0e0 100755 --- a/CI/kuiper/kuiper_build_process.sh +++ b/CI/kuiper/kuiper_build_process.sh @@ -59,7 +59,7 @@ set_config_opts() { install_packages() { sudo apt update sudo apt install -y build-essential cmake unzip gfortran gcc git bison libtool \ - python3 pip gperf pkg-config gdb-multiarch g++ flex texinfo gawk openssl \ + ${PYTHON_VERSION}-full pip gperf pkg-config gdb-multiarch g++ flex texinfo gawk openssl \ pigz libncurses-dev autoconf automake tar figlet liborc-0.4-dev* patchelf libc6-dev-armhf-cross squashfs-tools pip install mako } @@ -255,7 +255,8 @@ build_scopy() { echo "### Building scopy" pushd $SRC_DIR CURRENT_BUILD_CMAKE_OPTS="\ - -DCLONE_IIO_EMU=OFF + -DCLONE_IIO_EMU=OFF \ + -DPYTHON_EXECUTABLE=/usr/bin/python3.9 " build_with_cmake popd @@ -302,7 +303,10 @@ create_appdir(){ cp -r $QT_LOCATION/plugins $APP_DIR/usr - cp -r $SYSROOT/lib/python3.9 $APP_DIR/usr/lib + # search for the python version linked by cmake and copy inside the appimage the same version + FOUND_PYTHON_VERSION=$(grep 'PYTHON_VERSION' $SRC_DIR/build/CMakeCache.txt | awk -F= '{print $2}' | grep -o 'python[0-9]\+\.[0-9]\+') + python_path=/usr/lib/$FOUND_PYTHON_VERSION + cp -r $python_path $APP_DIR/usr/lib cp -r $SYSROOT/share/libsigrokdecode/decoders $APP_DIR/usr/lib cp $QT_LOCATION/lib/libQt5XcbQpa.so* $APP_DIR/usr/lib @@ -326,6 +330,7 @@ create_appdir(){ cp $SYSROOT/lib/arm-linux-gnueabihf/libXdmcp.so* $APP_DIR/usr/lib cp $SYSROOT/usr/lib/arm-linux-gnueabihf/libXau.so* $APP_DIR/usr/lib cp $SYSROOT/usr/lib/arm-linux-gnueabihf/libxcb.so* $APP_DIR/usr/lib + cp $SYSROOT/usr/lib/arm-linux-gnueabihf/libffi.so* $APP_DIR/usr/lib } diff --git a/CMakeLists.txt b/CMakeLists.txt index 0723fcc9ca..10ecef8fb6 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,8 +27,17 @@ if(PYTHON_EXECUTABLE) else() message(STATUS "Using default Python EXECUTABLE") endif() -find_package(Python3 REQUIRED COMPONENTS Interpreter Development) -message (STATUS "Found Python " ${Python3_VERSION} " at " ${Python3_EXECUTABLE} " and " ${Python3_LIBRARY}) + +if(CMAKE_SYSTEM_PROCESSOR MATCHES arm) + find_package(Python3 3.9 EXACT REQUIRED COMPONENTS Interpreter) + message (STATUS "Host Python Interpreter " ${Python3_EXECUTABLE}) + set(Python3_EXECUTABLE ${CMAKE_SYSROOT}/bin/python3.9) + message (STATUS "Target Python Interpreter " ${Python3_EXECUTABLE}) +else() + find_package(Python3 REQUIRED COMPONENTS Interpreter Development) + message (STATUS "Python Interpreter " ${Python3_EXECUTABLE}) + message (STATUS "Python Libraries " ${Python3_LIBRARIES}) +endif() set(PYTHON_VERSION python${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR} CACHE STRING "PYTHON_USED") function(dump_cmake_variables)