diff --git a/ci/kuiper/cmake_toolchain.cmake b/ci/kuiper/cmake_toolchain.cmake new file mode 100644 index 0000000000..8122187471 --- /dev/null +++ b/ci/kuiper/cmake_toolchain.cmake @@ -0,0 +1,64 @@ +cmake_minimum_required(VERSION 3.18) + +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_PROCESSOR arm) +set(CMAKE_LIBRARY_ARCHITECTURE arm-linux-gnueabihf) + +# In this case the variables CMAKE_SYSROOT and STAGING_AREA are defined as parameters to the cmake command +set(TOOLCHAIN_FILE ${STAGING_AREA}/cross-pi-gcc) +set(TOOLCHAIN_BIN ${TOOLCHAIN_FILE}/bin) +set(CMAKE_PREFIX_PATH "${CMAKE_SYSROOT}/usr/local/qt5.15") +list(APPEND CMAKE_PREFIX_PATH "${CMAKE_SYSROOT}/usr/lib/arm-linux-gnueabihf") +list(APPEND CMAKE_PREFIX_PATH "${CMAKE_SYSROOT}/lib") +set(CMAKE_VERBOSE ON) + +set(PKG_CONFIG_EXECUTABLE "${CMAKE_SYSROOT}/usr/bin/arm-linux-gnueabihf-pkg-config" CACHE PATH "PKG_CONFIG_EXECUTABLE" FORCE) +set(ENV{PKG_CONFIG_ALLOW_CROSS} 1) +set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON) +set(RPI_PKG_CONFIG_LIBDIR "${CMAKE_SYSROOT}/usr/lib/arm-linux-gnueabihf/pkgconfig:${RPI_PKG_CONFIG_LIBDIR}") +set(RPI_PKG_CONFIG_LIBDIR "${CMAKE_SYSROOT}/usr/share/pkgconfig:${RPI_PKG_CONFIG_LIBDIR}") +set(RPI_PKG_CONFIG_LIBDIR "${CMAKE_SYSROOT}/usr/lib/pkgconfig:${RPI_PKG_CONFIG_LIBDIR}") +set(RPI_PKG_CONFIG_LIBDIR "${CMAKE_SYSROOT}/usr/local/lib/pkgconfig:${RPI_PKG_CONFIG_LIBDIR}") +set(ENV{PKG_CONFIG_LIBDIR} "${RPI_PKG_CONFIG_LIBDIR}") +set(ENV{PKG_CONFIG} "${CMAKE_SYSROOT}/usr/bin/arm-linux-gnueabihf-pkg-config" ) +set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${CMAKE_SYSROOT}/include:${CMAKE_SYSROOT}/usr/include:${CMAKE_SYSROOT}/usr/include/arm-linux-gnueabihf:${CMAKE_SYSROOT}/usr/share/include") +set(ENV{PKG_CONFIG_SYSROOT_DIR} "${CMAKE_SYSROOT}") + +set(ENV{LD_LIBRARY_PATH} "${CMAKE_SYSROOT}/usr/lib/arm-linux-gnueabihf:$ENV{LD_LIBRARY_PATH}") +set(CMAKE_LIBRARY_PATH "${CMAKE_SYSROOT}/usr/lib" "${CMAKE_SYSROOT}/usr/lib/arm-linux-gnueabihf" "${CMAKE_SYSROOT}/usr/local/lib" "${CMAKE_SYSROOT}/usr/local/lib/arm-linux-gnueabihf") + +set(CMAKE_AR ${TOOLCHAIN_BIN}/arm-linux-gnueabihf-ar) +set(CMAKE_ASM_COMPILER ${TOOLCHAIN_BIN}/arm-linux-gnueabihf-gcc) +set(CMAKE_C_COMPILER ${TOOLCHAIN_BIN}/arm-linux-gnueabihf-gcc) +set(CMAKE_CXX_COMPILER ${TOOLCHAIN_BIN}/arm-linux-gnueabihf-g++) +set(CMAKE_LINKER ${TOOLCHAIN_BIN}/arm-linux-gnueabihf-ld ) +set(CMAKE_OBJCOPY ${TOOLCHAIN_BIN}/arm-linux-gnueabihf-objcopy) +set(CMAKE_RANLIB ${TOOLCHAIN_BIN}/arm-linux-gnueabihf-ranlib) +set(CMAKE_SIZE ${TOOLCHAIN_BIN}/arm-linux-gnueabihf-size) +set(CMAKE_STRIP ${TOOLCHAIN_BIN}/arm-linux-gnueabihf-strip) + +set(CMAKE_C_FLAGS "-march=armv7-a -mfloat-abi=hard -mfpu=vfp" ) +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I${CMAKE_SYSROOT}/include -I${CMAKE_SYSROOT}/usr/include -I${CMAKE_SYSROOT}/usr/include/arm-linux-gnueabihf -I${CMAKE_SYSROOT}/usr/share/include -fPIC") +set(CMAKE_CXX_FLAGS "-fexceptions -frtti ${CMAKE_C_FLAGS}") +set(CMAKE_CXX_FLAGS_DEBUG "-Os -g" ) +set(CMAKE_CXX_FLAGS_RELEASE "-Os -DNDEBUG" ) +set(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,-O1 -Wl,--hash-style=gnu -mthumb -lpthread -pthread") +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${CMAKE_SYSROOT}/usr/lib/arm-linux-gnueabihf") +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${CMAKE_SYSROOT}/usr/lib") +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${TOOLCHAIN_FILE}/arm-linux-gnueabihf/lib") +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${TOOLCHAIN_FILE}/arm-linux-gnueabihf/libc/lib") +set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) + +# Debug Mode +#set(PKG_CONFIG_ARGN "--debug") +#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--verbose ") + +set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) # Perform compiler test with static library +set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) +set(CMAKE_INSTALL_RPATH "$ORIGIN" "$ORIGIN/../lib" "/lib/arm-linux-gnueabihf" "/lib") +set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) diff --git a/ci/kuiper/kuiper_build_process.sh b/ci/kuiper/kuiper_build_process.sh new file mode 100755 index 0000000000..45ea02c1cb --- /dev/null +++ b/ci/kuiper/kuiper_build_process.sh @@ -0,0 +1,434 @@ +#!/bin/bash + +set -ex +SRC_DIR=$(git rev-parse --show-toplevel) +source $SRC_DIR/ci/kuiper/kuiper_build_config.sh + +echo -- USING CMAKE COMMAND: +echo $CMAKE +echo -- USING QT: $QT +echo -- USING QMAKE: $QMAKE_BIN + +build_with_cmake() { + BUILD_FOLDER=$PWD/build + rm -rf $BUILD_FOLDER + mkdir -p $BUILD_FOLDER + cd $BUILD_FOLDER + $CMAKE $CURRENT_BUILD_CMAKE_OPTS ../ + make $JOBS + CURRENT_BUILD_CMAKE_OPTS="" +} + +set_config_opts() { + CPP="${TOOLCHAIN_BIN}/${TOOLCHAIN_HOST}-cpp" + CC="${TOOLCHAIN_BIN}/${TOOLCHAIN_HOST}-gcc" + CXX="${TOOLCHAIN_BIN}/${TOOLCHAIN_HOST}-g++" + LD="${TOOLCHAIN_BIN}/${TOOLCHAIN_HOST}-ld" + AS="${TOOLCHAIN_BIN}/${TOOLCHAIN_HOST}-as" + AR="${TOOLCHAIN_BIN}/${TOOLCHAIN_HOST}-ar" + RANLIB="${TOOLCHAIN_BIN}/${TOOLCHAIN_HOST}-ranlib" + + CFLAGS=" -I${SYSROOT}/include -I${SYSROOT}/include/arm-linux-gnueabihf -I${SYSROOT}/usr/include -I${SYSROOT}/usr/include/arm-linux-gnueabihf -I${TOOLCHAIN}/include- -fPIC" + CPPFLAGS="-fexceptions ${CFLAGS}" + LDFLAGS="-Wl,-rpath=XORIGIN -L${TOOLCHAIN}/arm-linux-gnueabihf/lib -L${TOOLCHAIN}/arm-linux-gnueabihf/libc/lib -L${TOOLCHAIN}/arm-linux-gnueabihf/libc/usr/lib -L${SYSROOT}/lib -L${SYSROOT}/usr/lib -L${SYSROOT}/usr/lib/arm-linux-gnueabihf -L${SYSROOT}/usr/lib/arm-linux-gnueabihf" + + CONFIG_OPTS=() + CONFIG_OPTS+=("--prefix=${SYSROOT}") + CONFIG_OPTS+=("--host=${TOOLCHAIN_HOST}") + CONFIG_OPTS+=("--with-sysroot=${SYSROOT}") + CONFIG_OPTS+=("CFLAGS=${CFLAGS}") + CONFIG_OPTS+=("CPPFLAGS=${CPPFLAGS}") + CONFIG_OPTS+=("LDFLAGS=${LDFLAGS}") + CONFIG_OPTS+=("PKG_CONFIG=${SYSROOT}/usr/bin/arm-linux-gnueabihf-pkg-config" ) + CONFIG_OPTS+=("PKG_CONFIG_DIR=") + CONFIG_OPTS+=("PKG_CONFIG_LIBDIR=${SYSROOT}/usr/lib/arm-linux-gnueabihf/pkgconfig:${SYSROOT}/usr/share/pkgconfig:${SYSROOT}/usr/lib/arm-linux-gnueabihf/pkgconfig:${SYSROOT}/usr/local/lib/pkgconfig") + CONFIG_OPTS+=("PKG_CONFIG_SYSROOT=${SYSROOT}") + CONFIG_OPTS+=("PKG_CONFIG_SYSROOT_DIR=${SYSROOT}") + CONFIG_OPTS+=("PKG_CONFIG_PATH=${SYSROOT}/usr/bin/arm-linux-gnueabihf-pkg-config") + CONFIG_OPTS+=("PKG_CONFIG_ALLOW_CROSS=1") + CONFIG_OPTS+=("CPP=${CPP}") + CONFIG_OPTS+=("CC=${CC}") + CONFIG_OPTS+=("CXX=${CXX}") + CONFIG_OPTS+=("LD=${LD}") + CONFIG_OPTS+=("AS=${AS}") + CONFIG_OPTS+=("AR=${AR}") + CONFIG_OPTS+=("RANLIB=${RANLIB}") +} + +install_packages() { + 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 \ + pigz libncurses-dev autoconf automake tar figlet liborc-0.4-dev* patchelf libc6-dev-armhf-cross squashfs-tools + pip install mako +} + +download_cmake() { + mkdir -p ${STAGING_AREA} + pushd ${STAGING_AREA} + if [ ! -d cmake ];then + wget ${CMAKE_DOWNLOAD_LINK} + tar -xvf cmake*.tar.gz && rm cmake*.tar.gz && mv cmake* cmake # unzip and rename + else + echo "Cmake already downloaded" + fi + popd +} + +download_crosscompiler(){ + mkdir -p ${STAGING_AREA} + pushd ${STAGING_AREA} + if [ ! -d cross-pi-gcc ];then + wget --progress=dot:giga ${CROSSCOMPILER_DOWNLOAD_LINK} + tar -xf cross-gcc-*.tar.gz && rm cross-gcc-*.tar.gz && mv cross-pi-* cross-pi-gcc # unzip and rename + else + echo "Crosscompiler already downloaded" + fi + popd +} + +clone() { + echo "#######CLONE#######" + mkdir -p $STAGING_AREA + pushd $STAGING_AREA + [ -d 'libiio' ] || git clone --recursive https://github.com/analogdevicesinc/libiio.git -b $LIBIIO_VERSION libiio + [ -d 'libad9361' ] || git clone --recursive https://github.com/analogdevicesinc/libad9361-iio.git -b $LIBAD9361_BRANCH libad9361 + [ -d 'libm2k' ] || git clone --recursive https://github.com/analogdevicesinc/libm2k.git -b $LIBM2K_BRANCH libm2k + [ -d 'spdlog' ] || git clone --recursive https://github.com/gabime/spdlog.git -b $SPDLOG_BRANCH spdlog + [ -d 'gr-scopy' ] || git clone --recursive https://github.com/analogdevicesinc/gr-scopy.git -b $GRSCOPY_BRANCH gr-scopy + [ -d 'gr-m2k' ] || git clone --recursive https://github.com/analogdevicesinc/gr-m2k.git -b $GRM2K_BRANCH gr-m2k + [ -d 'volk' ] || git clone --recursive https://github.com/gnuradio/volk.git -b $VOLK_BRANCH volk + [ -d 'gnuradio' ] || git clone --recursive https://github.com/gnuradio/gnuradio.git -b $GNURADIO_BRANCH gnuradio + [ -d 'qwt' ] || git clone --recursive https://github.com/cseci/qwt.git -b $QWT_BRANCH qwt + [ -d 'libsigrokdecode' ] || git clone --recursive https://github.com/sigrokproject/libsigrokdecode.git -b $LIBSIGROKDECODE_BRANCH libsigrokdecode + [ -d 'libtinyiiod' ] || git clone --recursive https://github.com/analogdevicesinc/libtinyiiod.git -b $LIBTINYIIOD_BRANCH libtinyiiod + [ -d 'iio-emu' ] || git clone --recursive https://github.com/analogdevicesinc/iio-emu -b $IIOEMU_BRANCH iio-emu + popd +} + +build_libiio() { + echo "### Building libiio - version $LIBIIO_VERSION" + pushd $STAGING_AREA/libiio + CURRENT_BUILD_CMAKE_OPTS="\ + -DWITH_TESTS:BOOL=OFF \ + -DWITH_DOC:BOOL=OFF \ + -DHAVE_DNS_SD:BOOL=OFF\ + -DWITH_MATLAB_BINDINGS:BOOL=OFF \ + -DCSHARP_BINDINGS:BOOL=OFF \ + -DPYTHON_BINDINGS:BOOL=OFF \ + -DWITH_SERIAL_BACKEND:BOOL=ON \ + -DENABLE_IPV6:BOOL=OFF \ + -DINSTALL_UDEV_RULE:BOOL=OFF + " + build_with_cmake + sudo make install + popd +} + +build_libad9361() { + echo "### Building libad9361 - branch $LIBAD9361_BRANCH" + pushd $STAGING_AREA/libad9361 + build_with_cmake + sudo make install + popd +} + +build_spdlog() { + echo "### Building spdlog - branch $SPDLOG_BRANCH" + pushd $STAGING_AREA/spdlog + CURRENT_BUILD_CMAKE_OPTS="-DSPDLOG_BUILD_SHARED=ON" + build_with_cmake + sudo make install + popd +} + +build_libm2k() { + echo "### Building libm2k - branch $LIBM2K_BRANCH" + pushd $STAGING_AREA/libm2k + CURRENT_BUILD_CMAKE_OPTS="\ + -DENABLE_PYTHON=OFF \ + -DENABLE_CSHARP=OFF \ + -DBUILD_EXAMPLES=OFF \ + -DENABLE_TOOLS=OFF \ + -DINSTALL_UDEV_RULES=OFF \ + -DENABLE_LOG=OFF + " + #temporary build without logging + build_with_cmake + sudo make install + popd +} + +build_volk() { + echo "### Building volk - branch $VOLK_BRANCH" + pushd $STAGING_AREA/volk + build_with_cmake + sudo make install + popd +} + +build_gnuradio() { + echo "### Building gnuradio - branch $GNURADIO_BRANCH" + pushd $STAGING_AREA/gnuradio + CURRENT_BUILD_CMAKE_OPTS="\ + -DENABLE_DEFAULT=OFF \ + -DENABLE_GNURADIO_RUNTIME=ON \ + -DENABLE_GR_ANALOG=ON \ + -DENABLE_GR_BLOCKS=ON \ + -DENABLE_GR_FFT=ON \ + -DENABLE_GR_FILTER=ON \ + -DENABLE_GR_IIO=ON \ + -DENABLE_POSTINSTALL=OFF + " + build_with_cmake + sudo make install + popd +} + +build_grscopy() { + echo "### Building gr-scopy - branch $GRSCOPY_BRANCH" + pushd $STAGING_AREA/gr-scopy + build_with_cmake + sudo make install + popd +} + +build_grm2k() { + echo "### Building gr-m2k - branch $GRM2K_BRANCH" + pushd $STAGING_AREA/gr-m2k + CURRENT_BUILD_CMAKE_OPTS="\ + -DENABLE_PYTHON=OFF \ + -DDIGITAL=OFF + " + build_with_cmake + sudo make install + popd +} + +build_qwt() { + echo "### Building qwt - branch $QWT_BRANCH" + pushd $STAGING_AREA/qwt + git clean -xdf + sed -i 's|/usr/local/qwt-$$QWT_VERSION-ma|/usr/local|g' qwtconfig.pri + $QMAKE_BIN INCLUDEPATH=$SYSROOT/include LIBS=-L$SYSROOT/lib qwt.pro + make $JOBS + patchelf --force-rpath --set-rpath \$ORIGIN $STAGING_AREA/qwt/lib/libqwt.so + sudo make INSTALL_ROOT=$SYSROOT install + popd +} + +build_libsigrokdecode() { + echo "### Building libsigrokdecode - branch $LIBSIGROKDECODE_BRANCH" + set_config_opts + pushd $STAGING_AREA/libsigrokdecode + git clean -xdf + ./autogen.sh + ./configure "${CONFIG_OPTS[@]}" + make $JOBS + patchelf --force-rpath --set-rpath \$ORIGIN $STAGING_AREA/libsigrokdecode/.libs/libsigrokdecode.so + sudo make install + popd +} + +build_libtinyiiod() { + echo "### Building libtinyiiod - branch $LIBTINYIIOD_BRANCH" + pushd $STAGING_AREA/libtinyiiod + CURRENT_BUILD_CMAKE_OPTS="-DBUILD_EXAMPLES=OFF" + build_with_cmake + sudo make install + popd +} + +build_iio-emu(){ + echo "### Building iio-emu - branch $IIOEMU_BRANCH" + pushd $STAGING_AREA/iio-emu + build_with_cmake + sudo make install + popd +} + +build_scopy() { + echo "### Building scopy" + pushd $SRC_DIR + CURRENT_BUILD_CMAKE_OPTS="\ + -DENABLE_PLUGIN_TEST=ON \ + -DENABLE_TESTING=ON + " + build_with_cmake + popd +} + +build_deps(){ + build_libiio + build_libad9361 + build_spdlog + build_libm2k + build_volk + build_gnuradio + build_grscopy + build_grm2k + build_qwt + build_libsigrokdecode + build_libtinyiiod + build_iio-emu +} + +create_appdir(){ + + BUILD_FOLDER=$SRC_DIR/build + + EMU_BUILD_FOLDER=$STAGING_AREA/iio-emu/build + + PLUGINBASE_DLL=$BUILD_FOLDER/pluginbase + CORE_DLL=$BUILD_FOLDER/core + GUI_DLL=$BUILD_FOLDER/gui + GR_UTIL_DLL=$BUILD_FOLDER/gr-util + IIOUTIL_DLL=$BUILD_FOLDER/iioutil + IIOWIDGETS_DLL=$BUILD_FOLDER/iio-widgets + COMMON_DLL=$BUILD_FOLDER/common + PLUGINS=$BUILD_FOLDER/plugins/plugins + + REGMAP_XMLS=$BUILD_FOLDER/plugins/regmap/xmls + TRANSLATIONS_QM=$(find $BUILD_FOLDER/translations -type f -name "*.qm") + + rm -rf $APP_DIR + mkdir $APP_DIR + mkdir -p $APP_DIR/usr/bin + mkdir -p $APP_DIR/usr/lib + mkdir -p $APP_DIR/usr/share/applications + mkdir -p $APP_DIR/usr/share/icons/hicolor/512x512 + + cp $APP_RUN $APP_DIR + cp $APP_DESKTOP $APP_DIR + cp $SRC_DIR/gui/res/scopy.png $APP_DIR + cp $SRC_DIR/gui/res/scopy.png $APP_DIR/usr/share/icons/hicolor/512x512 + cp $APP_DESKTOP $APP_DIR/usr/share/applications + + cp $EMU_BUILD_FOLDER/iio-emu $APP_DIR/usr/bin + cp $BUILD_FOLDER/scopy $APP_DIR/usr/bin + + cp $PLUGINBASE_DLL/libscopy-pluginbase.so $APP_DIR/usr/lib + cp $CORE_DLL/libscopy-core.so $APP_DIR/usr/lib + cp $IIOUTIL_DLL/libscopy-iioutil.so $APP_DIR/usr/lib + cp $IIOWIDGETS_DLL/libscopy-iio-widgets.so $APP_DIR/usr/lib + cp $GUI_DLL/libscopy-gui.so $APP_DIR/usr/lib + cp $GUI_DLL/libscopy-gr-gui.so $APP_DIR/usr/lib + cp $GUI_DLL/libscopy-sigrok-gui.so $APP_DIR/usr/lib + cp $GR_UTIL_DLL/libscopy-gr-util.so $APP_DIR/usr/lib + cp $COMMON_DLL/libscopy-common.so $APP_DIR/usr/lib + cp -r $PLUGINS $APP_DIR/usr/share + + mkdir $APP_DIR/usr/share/translations + cp $TRANSLATIONS_QM $APP_DIR/usr/share/translations + + if [ -d $REGMAP_XMLS ]; then + cp -r $REGMAP_XMLS $APP_DIR/usr/share/plugins + fi + + + ./copy-deps.sh $APP_DIR/usr/bin/scopy $APP_DIR/usr/lib + ./copy-deps.sh $APP_DIR/usr/bin/iio-emu $APP_DIR/usr/lib + ./copy-deps.sh $APP_DIR/usr/bin/scopy $APP_DIR/usr/lib + ./copy-deps.sh "$APP_DIR/usr/share/plugins/*.so" $APP_DIR/usr/lib + + cp -r $QT_LOCATION/plugins $APP_DIR/usr + cp -r $SYSROOT/lib/python3.9 $APP_DIR/usr/lib + cp -r $SYSROOT/share/libsigrokdecode/decoders $APP_DIR/usr/lib + + + # cp $SYSROOT/usr/local/lib/libqwt.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/libiio.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/libm2k.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/tinyiiod.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/libvolk.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/libad9361.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/libspdlog.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/libsigrokdecode.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/libgnuradio* $APP_DIR/usr/lib + + # cp $QT_LOCATION/lib/libQt5Concurrent.so* $APP_DIR/usr/lib + # cp $QT_LOCATION/lib/libQt5Core.so* $APP_DIR/usr/lib + # cp $QT_LOCATION/lib/libQt5Gui.so* $APP_DIR/usr/lib + # cp $QT_LOCATION/lib/libQt5Network.so* $APP_DIR/usr/lib + # cp $QT_LOCATION/lib/libQt5OpenGL.so* $APP_DIR/usr/lib + # cp $QT_LOCATION/lib/libQt5PrintSupport.so* $APP_DIR/usr/lib + # cp $QT_LOCATION/lib/libQt5Qml.so* $APP_DIR/usr/lib + # cp $QT_LOCATION/lib/libQt5Svg.so* $APP_DIR/usr/lib + # cp $QT_LOCATION/lib/libQt5Widgets.so* $APP_DIR/usr/lib + # cp $QT_LOCATION/lib/libQt5Xml.so* $APP_DIR/usr/lib + + cp $QT_LOCATION/lib/libQt5XcbQpa.so* $APP_DIR/usr/lib + cp $QT_LOCATION/lib/libQt5EglFSDeviceIntegration.so* $APP_DIR/usr/lib + cp $QT_LOCATION/lib/libQt5DBus.so* $APP_DIR/usr/lib + + + cp $SYSROOT/lib/arm-linux-gnueabihf/libstdc++.so* $APP_DIR/usr/lib + cp $SYSROOT/lib/arm-linux-gnueabihf/libc.so* $APP_DIR/usr/lib + cp $SYSROOT/lib/arm-linux-gnueabihf/libdl.so* $APP_DIR/usr/lib + cp $SYSROOT/lib/arm-linux-gnueabihf/libpthread.so* $APP_DIR/usr/lib + cp $SYSROOT/lib/arm-linux-gnueabihf/libGLESv2.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libpng16.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libz.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libharfbuzz.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libmd4c.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libdouble-conversion.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libicui18n.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libicuuc.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libicudata.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libpcre2-16.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libzstd.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libgthread-2.0.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libglib-2.0.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libpython3.9.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/librt.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libusb-1.0.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libserialport.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libxml2.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libgssapi_krb5.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libkrb5.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libk5crypto.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libcom_err.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libkrb5support.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libkeyutils.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libresolv.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libavahi-client.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libavahi-common.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libGLdispatch.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libfreetype.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libgraphite2.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libpcre.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libexpat.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libutil.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libudev.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libdbus-1.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/liblzma.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libbrotlidec.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libsystemd.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libbrotlicommon.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/liblz4.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libgcrypt.so* $APP_DIR/usr/lib + # cp $SYSROOT/lib/arm-linux-gnueabihf/libgpg-error.so* $APP_DIR/usr/lib + + cp $SYSROOT/usr/lib/arm-linux-gnueabihf/ld-linux-armhf.so* $APP_DIR/usr/lib + cp $SYSROOT/usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so* $APP_DIR/usr/lib + cp $SYSROOT/usr/lib/arm-linux-gnueabihf/libm.so* $APP_DIR/usr/lib + cp $SYSROOT/usr/lib/arm-linux-gnueabihf/libgcc_s.so* $APP_DIR/usr/lib + cp $SYSROOT/usr/lib/arm-linux-gnueabihf/libdl.so* $APP_DIR/usr/lib + cp $SYSROOT/usr/lib/arm-linux-gnueabihf/libmd.so* $APP_DIR/usr/lib + cp $SYSROOT/lib/arm-linux-gnueabihf/libbsd.so* $APP_DIR/usr/lib + 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 +} + +create_appimage(){ + rm -rf $APP_IMAGE + mksquashfs $APP_DIR $APP_SQUASHFS -root-owned -noappend + cat $RUNTIME_ARMHF >> $APP_IMAGE + cat $APP_SQUASHFS >> $APP_IMAGE + chmod a+x $APP_IMAGE +} + + +for arg in $@; do + $arg +done