From 8d91c0ae95dba55c77583afb9c05bbb7c9a55967 Mon Sep 17 00:00:00 2001 From: Malte Langermann <54738901+gagarinlg@users.noreply.github.com> Date: Wed, 22 Feb 2023 11:32:51 +0100 Subject: [PATCH] chore: Convert simu/simulator/companion to SDL2 (#3085) * chore(pc): convert simu/simulator/companion to use SDL2 * switch companion builds to SDL2 - OSX is not converted the linux change is done a bit hacky, it should be done by updating the EdgeTX docker container * update build system setup scripts * add compatibility for old and new SDL2 cmake integration * fix windows installer * fix simulator audio on windows by using DirectSound vie SDL2 * fix windows audio with SDL2 enable simu for windows builds * remove workflow changes for linux builds, this needs to be fixed in the build environment * fix OSX build, thx @pafleraf * fix windows audio for companion and simulator with SDL2 * select SDL2 branch of the build-docker environment * Revert "select SDL2 branch of the build-docker environment" This reverts commit da801609d78e1aed513ad7d9d8ab3ebded2900b9. * fix tests with SDL2 --- .github/workflows/macosx_cpn.yml | 15 ++------------ .github/workflows/win-cpn-32.yml | 2 +- .github/workflows/win_cpn-64.yml | 2 +- CMakeLists.txt | 2 +- cmake/NativeTargets.cmake | 23 +++++++++------------- companion/src/CMakeLists.txt | 21 +++++++++++--------- companion/src/companion.cpp | 3 +++ companion/src/simulation/CMakeLists.txt | 2 +- companion/src/simulation/joystick.cpp | 8 +++++++- companion/src/simulator.cpp | 3 +++ companion/targets/windows/companion.nsi.in | 2 +- radio/src/CMakeLists.txt | 2 +- radio/src/opentx.h | 2 +- radio/src/simu.cpp | 15 ++++++++------ radio/src/targets/simu/CMakeLists.txt | 11 +++++++---- radio/src/targets/simu/simpgmspace.cpp | 8 ++++---- radio/src/tests/CMakeLists.txt | 6 +++--- tools/build-companion.sh | 4 ++-- tools/msys2_fetch_and_build_all.sh | 4 ++-- tools/setup_buildenv_msys2_stage2.sh | 2 +- tools/setup_buildenv_ubuntu20.04.sh | 2 +- 21 files changed, 72 insertions(+), 67 deletions(-) diff --git a/.github/workflows/macosx_cpn.yml b/.github/workflows/macosx_cpn.yml index ff210f3e6..15b0193a0 100644 --- a/.github/workflows/macosx_cpn.yml +++ b/.github/workflows/macosx_cpn.yml @@ -89,19 +89,8 @@ jobs: ./configure && make install - - name: Install libsdl - run: wget https://www.libsdl.org/release/SDL-1.2.15.tar.gz && - tar xfv SDL-1.2.15.tar.gz && - export MACOSX_DEPLOYMENT_TARGET=10.9 && - cd SDL-1.2.15 && - wget 'https://bugzilla-attachments.libsdl.org/attachment.cgi?id=1320' -O patch1 && - wget 'https://bugzilla-attachments.libsdl.org/attachment.cgi?id=1324' -O patch2 && - wget 'https://hg.libsdl.org/SDL/raw-rev/91ad7b43317a' -O patch3 && - patch -p1 < patch1 && - patch -p1 < patch2 && - patch -p1 < patch3 && - ./configure --without-x && - make install + - name: Install SDL2 + run: brew install SDL2 - name: Build working-directory: ${{github.workspace}} diff --git a/.github/workflows/win-cpn-32.yml b/.github/workflows/win-cpn-32.yml index e3f19d7b8..cf93aad2a 100644 --- a/.github/workflows/win-cpn-32.yml +++ b/.github/workflows/win-cpn-32.yml @@ -54,7 +54,7 @@ jobs: mingw-w64-i686-openjpeg2 \ mingw-w64-i686-libimagequant \ mingw-w64-i686-libraqm \ - mingw-w64-i686-SDL \ + mingw-w64-i686-SDL2 \ mingw-w64-i686-clang \ mingw-w64-i686-nsis python -m pip install clang diff --git a/.github/workflows/win_cpn-64.yml b/.github/workflows/win_cpn-64.yml index 5ac11e0f7..56d4602b7 100644 --- a/.github/workflows/win_cpn-64.yml +++ b/.github/workflows/win_cpn-64.yml @@ -68,7 +68,7 @@ jobs: mingw-w64-x86_64-openjpeg2 \ mingw-w64-x86_64-libimagequant \ mingw-w64-x86_64-libraqm \ - mingw-w64-x86_64-SDL \ + mingw-w64-x86_64-SDL2 \ mingw-w64-x86_64-clang \ mingw-w64-x86_64-nsis python -m pip install clang diff --git a/CMakeLists.txt b/CMakeLists.txt index fd6c5037c..099de1170 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -136,7 +136,7 @@ if(NATIVE_BUILD) include(NativeTargets) else() # Prevent CMake warnings - set(IGNORE "${SDL_LIBRARY_PATH}") + set(IGNORE "${SDL2_LIBRARY_PATH}") endif() add_subdirectory(${RADIO_SRC_DIR}) diff --git a/cmake/NativeTargets.cmake b/cmake/NativeTargets.cmake index 9d2ef2416..6139c84ce 100644 --- a/cmake/NativeTargets.cmake +++ b/cmake/NativeTargets.cmake @@ -8,13 +8,11 @@ option(DISABLE_COMPANION "Disable building companion and simulators" OFF) # endif() # libfox -if(NOT WIN32) - find_package(Fox QUIET) # QUIET not working on WIN32? - if (FOX_FOUND) - message(STATUS "Foxlib found at ${FOX_LIBRARY}") - else() # if(NOT WIN32) - message("Libfox not found, simu target will not be available") - endif() +find_package(Fox QUIET) # QUIET not working on WIN32? +if (FOX_FOUND) + message(STATUS "Foxlib found at ${FOX_LIBRARY}") +else() + message("Libfox not found, simu target will not be available") endif() if(NOT DISABLE_COMPANION) @@ -22,13 +20,10 @@ if(NOT DISABLE_COMPANION) endif(NOT DISABLE_COMPANION) if(Qt5Core_FOUND OR FOX_FOUND) - set(SDL_BUILDING_LIBRARY YES) # this prevents FindSDL from appending SDLmain lib to the results, which we don't want - find_package("SDL") - if(SDL_FOUND) - message(STATUS "SDL Lib: ${SDL_LIBRARY}; Headers: ${SDL_INCLUDE_DIR}; Version: ${SDL_VERSION_STRING}") - if (NOT ${SDL_VERSION_STRING} VERSION_LESS "2.0") - message(FATAL_ERROR "OpenTX requires SDL 1.x, not 2.x") - endif() + set(SDL2_BUILDING_LIBRARY YES) # this prevents FindSDL from appending SDLmain lib to the results, which we don't want + find_package("SDL2") + if(SDL2_FOUND) + message(STATUS "SDL2 Lib: ${SDL2_LIBRARIES}; Headers: ${SDL2_INCLUDE_DIRS}") else() message(STATUS "SDL not found! Simulator audio, and joystick inputs, will not work.") endif() diff --git a/companion/src/CMakeLists.txt b/companion/src/CMakeLists.txt index 8cc500e7a..a4d82b158 100644 --- a/companion/src/CMakeLists.txt +++ b/companion/src/CMakeLists.txt @@ -48,9 +48,12 @@ if(WIN32) endif() endif() -if(SDL_FOUND) - include_directories(${SDL_INCLUDE_DIR}) +if(SDL2_FOUND) + include_directories(${SDL2_INCLUDE_DIRS}) add_definitions(-DJOYSTICKS) + if(TARGET SDL2::SDL2) + set(SDL2_LIBRARIES SDL2::SDL2) + endif() endif() add_definitions(${APP_COMMON_DEFINES}) # set in top-level CMakeLists @@ -175,7 +178,7 @@ target_link_libraries(common Qt5::Xml Qt5::Widgets ${PTHREAD_LIBRARY} - ${SDL_LIBRARY} + ${SDL2_LIBRARIES} ${WIN_LINK_LIBRARIES} ) @@ -417,12 +420,12 @@ elseif(WIN32) # Add installer command to execute windeployqt message(STATUS "windeployqt command: ${QT_BIN_DIR}/windeployqt.exe ${wdqtopts}") - # SDL dll - if(SDL_FOUND AND EXISTS "${SDL_LIBRARY_PATH}/SDL.dll") - set(SDL_DIR ${SDL_LIBRARY_PATH}) # this is also used by NSIS installer script - install(FILES ${SDL_DIR}/SDL.dll DESTINATION ${INSTALL_DESTINATION}) - elseif(SDL_FOUND) - message(WARNING "Installer: SDL.dll not found, set SDL_LIBRARY_PATH manually.") + # SDL2 dll + if(SDL2_FOUND AND EXISTS "${SDL2_LIBRARY_PATH}/SDL2.dll") + set(SDL2_DIR ${SDL2_LIBRARY_PATH}) # this is also used by NSIS installer script + install(FILES ${SDL2_DIR}/SDL2.dll DESTINATION ${INSTALL_DESTINATION}) + elseif(SDL2_FOUND) + message(WARNING "Installer: SDL2.dll not found, set SDL2_LIBRARY_PATH manually.") endif() if (OPENSSL_FOUND) diff --git a/companion/src/companion.cpp b/companion/src/companion.cpp index 5059d93ff..62c8b480c 100644 --- a/companion/src/companion.cpp +++ b/companion/src/companion.cpp @@ -222,6 +222,9 @@ int main(int argc, char *argv[]) #ifdef SIMU_AUDIO sdlFlags |= SDL_INIT_AUDIO; #endif + #if defined(_WIN32) || defined(_WIN64) + putenv("SDL_AUDIODRIVER=directsound"); + #endif if (SDL_Init(sdlFlags) < 0) { fprintf(stderr, "ERROR: couldn't initialize SDL: %s\n", SDL_GetError()); } diff --git a/companion/src/simulation/CMakeLists.txt b/companion/src/simulation/CMakeLists.txt index b9f824d2c..34f190f42 100644 --- a/companion/src/simulation/CMakeLists.txt +++ b/companion/src/simulation/CMakeLists.txt @@ -93,7 +93,7 @@ set(simulation_HDRS widgets/virtualjoystickwidget.h ) -if(SDL_FOUND) +if(SDL2_FOUND) set(simulation_SRCS ${simulation_SRCS} joystick.cpp diff --git a/companion/src/simulation/joystick.cpp b/companion/src/simulation/joystick.cpp index fb6501a06..d34f72e6a 100644 --- a/companion/src/simulation/joystick.cpp +++ b/companion/src/simulation/joystick.cpp @@ -26,7 +26,13 @@ Joystick::Joystick(QObject *parent, int joystickEventTimeout, bool doAutoRepeat, if ( SDL_WasInit(SDL_INIT_JOYSTICK) ) { int i; for (i = 0; i < SDL_NumJoysticks(); i++) - joystickNames.append(SDL_JoystickName(i)); + { + SDL_Joystick* joy = SDL_JoystickOpen(i); + if(joy == nullptr) + continue; + joystickNames.append(SDL_JoystickName(joy)); + SDL_JoystickClose(joy); + } connect(&joystickTimer, SIGNAL(timeout()), this, SLOT(processEvents())); } else { fprintf(stderr, "ERROR: couldn't initialize SDL joystick support\n"); diff --git a/companion/src/simulator.cpp b/companion/src/simulator.cpp index 7caca8e97..f92c70593 100644 --- a/companion/src/simulator.cpp +++ b/companion/src/simulator.cpp @@ -270,6 +270,9 @@ int main(int argc, char *argv[]) #ifdef SIMU_AUDIO sdlFlags |= SDL_INIT_AUDIO; #endif + #if defined(_WIN32) || defined(_WIN64) + putenv("SDL_AUDIODRIVER=directsound"); + #endif if (SDL_Init(sdlFlags) < 0) { showMessage(QApplication::translate("SimulatorMain", "WARNING: couldn't initialize SDL:\n%1").arg(SDL_GetError()), QMessageBox::Warning); } diff --git a/companion/targets/windows/companion.nsi.in b/companion/targets/windows/companion.nsi.in index 81c04314e..3e91eecbd 100644 --- a/companion/targets/windows/companion.nsi.in +++ b/companion/targets/windows/companion.nsi.in @@ -178,7 +178,7 @@ Section "un.EdgeTX Companion @VERSION_FAMILY@" Delete "$INSTDIR\companion.exe" Delete "$INSTDIR\simulator.exe" Delete "$INSTDIR\*edgetx-*-simulator.dll" - Delete "$INSTDIR\SDL.dll" + Delete "$INSTDIR\SDL2.dll" ; MSVC-specific libs Delete "$INSTDIR\msvcp140.dll" Delete "$INSTDIR\vcruntime140.dll" diff --git a/radio/src/CMakeLists.txt b/radio/src/CMakeLists.txt index 15f6f4fc8..960bec0ed 100644 --- a/radio/src/CMakeLists.txt +++ b/radio/src/CMakeLists.txt @@ -32,7 +32,7 @@ option(SEMIHOSTING "Enable debugger semihosting" OFF) option(JITTER_MEASURE "Enable ADC jitter measurement" OFF) option(WATCHDOG "Enable hardware Watchdog" ON) option(ASTERISK "Enable asterisk icon (test only firmware)" OFF) -if(SDL_FOUND) +if(SDL2_FOUND) option(SIMU_AUDIO "Enable simulator audio." ON) endif() option(LUA "Enable LUA support" ON) diff --git a/radio/src/opentx.h b/radio/src/opentx.h index 4121281e5..22a294ea6 100644 --- a/radio/src/opentx.h +++ b/radio/src/opentx.h @@ -22,9 +22,9 @@ #pragma once #include +#include "debounce.h" #include "definitions.h" #include "opentx_types.h" -#include "debounce.h" #include "opentx_helpers.h" #include "touch.h" diff --git a/radio/src/simu.cpp b/radio/src/simu.cpp index f2a6eb9db..67747a86e 100644 --- a/radio/src/simu.cpp +++ b/radio/src/simu.cpp @@ -19,6 +19,11 @@ * GNU General Public License for more details. */ +#if defined(SIMU_AUDIO) + #include + #undef main +#endif + #include "fx.h" #include "FXExpression.h" #include "FXPNGImage.h" @@ -29,11 +34,6 @@ #include #include "targets/simu/simulcd.h" -#if defined(SIMU_AUDIO) - #include - #undef main -#endif - #if LCD_W > 212 #define LCD_ZOOM 1 #else @@ -94,11 +94,14 @@ FXDEFMAP(OpenTxSim) OpenTxSimMap[] = { FXIMPLEMENT(OpenTxSim, FXMainWindow, OpenTxSimMap, ARRAYNUMBER(OpenTxSimMap)) OpenTxSim::OpenTxSim(FXApp* a): - FXMainWindow(a, "OpenTX Simu", nullptr, nullptr, DECOR_ALL, 20, 90, 0, 0) + FXMainWindow(a, "EdgeTX Simu", nullptr, nullptr, DECOR_ALL, 20, 90, 0, 0) { bmp = new FXPPMImage(getApp(), nullptr, IMAGE_OWNED|IMAGE_KEEP|IMAGE_SHMI|IMAGE_SHMP, W2, H2); #if defined(SIMU_AUDIO) + #if defined(_WIN32) || defined(_WIN64) + putenv("SDL_AUDIODRIVER=directsound"); + #endif SDL_Init(SDL_INIT_AUDIO); #endif diff --git a/radio/src/targets/simu/CMakeLists.txt b/radio/src/targets/simu/CMakeLists.txt index 831f66b01..afda4cf09 100644 --- a/radio/src/targets/simu/CMakeLists.txt +++ b/radio/src/targets/simu/CMakeLists.txt @@ -19,9 +19,12 @@ set(SIMU_DRIVERS ) -if(SDL_FOUND) - include_directories(${SDL_INCLUDE_DIR}) +if(SDL2_FOUND) + include_directories(${SDL2_INCLUDE_DIRS}) add_definitions(-DJOYSTICKS) + if(TARGET SDL2::SDL2) + set(SDL2_LIBRARIES SDL2::SDL2) + endif() endif() if(SIMU_LUA_COMPILER) @@ -76,7 +79,7 @@ if(Qt5Widgets_FOUND) target_compile_options(${SIMULATOR_TARGET} PRIVATE ${SIMU_SRC_OPTIONS}) target_compile_definitions(${SIMULATOR_TARGET} PUBLIC ${APP_COMMON_DEFINES}) - target_link_libraries(${SIMULATOR_TARGET} ${SDL_LIBRARY} Qt5::Core) + target_link_libraries(${SIMULATOR_TARGET} ${SDL2_LIBRARIES} Qt5::Core) # Remove debug symbols on release builds if(NOT CLANG) @@ -162,7 +165,7 @@ if(FOX_FOUND) ${RADIO_SRC_DIR}/simu.cpp) target_include_directories(simu PUBLIC ${FOX_INCLUDE_DIR} ) - target_link_libraries(simu ${FOX_LIBRARY} pthread ${SDL_LIBRARY}) + target_link_libraries(simu ${FOX_LIBRARY} pthread ${SDL2_LIBRARIES}) target_compile_options(simu PRIVATE -DSIMU) endif() diff --git a/radio/src/targets/simu/simpgmspace.cpp b/radio/src/targets/simu/simpgmspace.cpp index 4759f4e88..90b9444ac 100644 --- a/radio/src/targets/simu/simpgmspace.cpp +++ b/radio/src/targets/simu/simpgmspace.cpp @@ -21,6 +21,10 @@ #define SIMPGMSPC_USE_QT 0 +#if defined(SIMU_AUDIO) + #include +#endif + #include "opentx.h" #include "simulcd.h" @@ -33,10 +37,6 @@ #include #endif -#if defined(SIMU_AUDIO) - #include -#endif - int g_snapshot_idx = 0; uint8_t simu_start_mode = 0; diff --git a/radio/src/tests/CMakeLists.txt b/radio/src/tests/CMakeLists.txt index 8bc3f68e2..12e5d4891 100644 --- a/radio/src/tests/CMakeLists.txt +++ b/radio/src/tests/CMakeLists.txt @@ -34,9 +34,9 @@ if(GTEST_INCDIR AND GTEST_SRCDIR AND Qt5Widgets_FOUND) target_link_libraries(gtests-radio-lib PRIVATE ${WIN_LINK_LIBRARIES}) endif(WIN32) - if(SDL_FOUND AND SIMU_AUDIO) - target_include_directories(gtests-radio-lib PUBLIC ${SDL_INCLUDE_DIR}) - target_link_libraries(gtests-radio-lib PRIVATE ${SDL_LIBRARY}) + if(SDL2_FOUND) + target_include_directories(gtests-radio-lib PUBLIC ${SDL2_INCLUDE_DIR}) + target_link_libraries(gtests-radio-lib PRIVATE ${SDL2_LIBRARIES}) endif() diff --git a/tools/build-companion.sh b/tools/build-companion.sh index ef6de2a86..6e17ceb2c 100755 --- a/tools/build-companion.sh +++ b/tools/build-companion.sh @@ -35,9 +35,9 @@ if [ "$(uname)" = "Darwin" ]; then COMMON_OPTIONS="${COMMON_OPTIONS} -DCMAKE_OSX_DEPLOYMENT_TARGET='10.9'" elif [ "$(uname)" != "Linux" ]; then # Assume Windows and MSYS2 if [ "${MSYSTEM,,}" == "mingw32" ]; then # MSYS 32bit detected - COMMON_OPTIONS="${COMMON_OPTIONS} -DSDL_LIBRARY_PATH=/mingw32/bin/" + COMMON_OPTIONS="${COMMON_OPTIONS} -DSDL2_LIBRARY_PATH=/mingw32/bin/" else # fallback to 64bit - COMMON_OPTIONS="${COMMON_OPTIONS} -DSDL_LIBRARY_PATH=/mingw64/bin/" + COMMON_OPTIONS="${COMMON_OPTIONS} -DSDL2_LIBRARY_PATH=/mingw64/bin/" fi fi diff --git a/tools/msys2_fetch_and_build_all.sh b/tools/msys2_fetch_and_build_all.sh index fdbd3e3e5..1acf83d8e 100644 --- a/tools/msys2_fetch_and_build_all.sh +++ b/tools/msys2_fetch_and_build_all.sh @@ -185,8 +185,8 @@ if [[ $PAUSEAFTEREACHLINE == "true" ]]; then fi echo "=== Step $((STEP++)): Running CMake for ${RADIO_TYPE} as an example ===" -cmake -G "MSYS Makefiles" -Wno-dev -DCMAKE_PREFIX_PATH=$HOME/5.12.9/mingw73_64 -DSDL_LIBRARY_PATH=/mingw64/bin/ ${BUILD_OPTIONS} -DCMAKE_BUILD_TYPE=Release ../ -check_command $? "cmake -G MSYS Makefiles -Wno-dev -DCMAKE_PREFIX_PATH=$HOME/5.12.9/mingw73_64 -DSDL_LIBRARY_PATH=/mingw64/bin/ ${BUILD_OPTIONS} -DCMAKE_BUILD_TYPE=Release ../" +cmake -G "MSYS Makefiles" -Wno-dev -DCMAKE_PREFIX_PATH=$HOME/5.12.9/mingw73_64 -DSDL2_LIBRARY_PATH=/mingw64/bin/ ${BUILD_OPTIONS} -DCMAKE_BUILD_TYPE=Release ../ +check_command $? "cmake -G MSYS Makefiles -Wno-dev -DCMAKE_PREFIX_PATH=$HOME/5.12.9/mingw73_64 -DSDL2_LIBRARY_PATH=/mingw64/bin/ ${BUILD_OPTIONS} -DCMAKE_BUILD_TYPE=Release ../" if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." read diff --git a/tools/setup_buildenv_msys2_stage2.sh b/tools/setup_buildenv_msys2_stage2.sh index ebc72dc81..3187b48a0 100644 --- a/tools/setup_buildenv_msys2_stage2.sh +++ b/tools/setup_buildenv_msys2_stage2.sh @@ -14,7 +14,7 @@ do done echo "=== Step $((STEP++)): Installing packages ===" -pacman -S --noconfirm mingw-w64-x86_64-cmake mingw-w64-x86_64-python-pip mingw-w64-x86_64-python-pillow mingw-w64-x86_64-python-lz4 mingw-w64-x86_64-arm-none-eabi-gcc mingw-w64-x86_64-libjpeg-turbo mingw-w64-x86_64-zlib mingw-w64-x86_64-libtiff mingw-w64-x86_64-freetype mingw-w64-x86_64-lcms2 mingw-w64-x86_64-libwebp mingw-w64-x86_64-openjpeg2 mingw-w64-x86_64-libimagequant mingw-w64-x86_64-libraqm mingw-w64-x86_64-SDL mingw-w64-x86_64-nsis mingw-w64-x86_64-clang mingw-w64-x86_64-openssl +pacman -S --noconfirm mingw-w64-x86_64-cmake mingw-w64-x86_64-python-pip mingw-w64-x86_64-python-pillow mingw-w64-x86_64-python-lz4 mingw-w64-x86_64-arm-none-eabi-gcc mingw-w64-x86_64-libjpeg-turbo mingw-w64-x86_64-zlib mingw-w64-x86_64-libtiff mingw-w64-x86_64-freetype mingw-w64-x86_64-lcms2 mingw-w64-x86_64-libwebp mingw-w64-x86_64-openjpeg2 mingw-w64-x86_64-libimagequant mingw-w64-x86_64-libraqm mingw-w64-x86_64-SDL2 mingw-w64-x86_64-nsis mingw-w64-x86_64-clang mingw-w64-x86_64-openssl if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." read diff --git a/tools/setup_buildenv_ubuntu20.04.sh b/tools/setup_buildenv_ubuntu20.04.sh index 94b131ef5..10d6eba89 100755 --- a/tools/setup_buildenv_ubuntu20.04.sh +++ b/tools/setup_buildenv_ubuntu20.04.sh @@ -42,7 +42,7 @@ if [[ $PAUSEAFTEREACHLINE == "true" ]]; then fi echo "=== Step $((STEP++)): Installing packages ===" -sudo apt-get -y install build-essential cmake gcc git lib32ncurses-dev lib32z1 libfox-1.6-dev libsdl1.2-dev qt5-default qtmultimedia5-dev qttools5-dev qttools5-dev-tools qtcreator libqt5svg5-dev software-properties-common wget zip python-pip-whl python-pil libgtest-dev python3-pip python3-tk python3-setuptools clang-7 python-clang-7 libusb-1.0-0-dev stlink-tools openocd npm pv libncurses5:i386 libpython2.7:i386 libclang-6.0-dev +sudo apt-get -y install build-essential cmake gcc git lib32ncurses-dev lib32z1 libfox-1.6-dev libsdl2-dev qt5-default qtmultimedia5-dev qttools5-dev qttools5-dev-tools qtcreator libqt5svg5-dev software-properties-common wget zip python-pip-whl python-pil libgtest-dev python3-pip python3-tk python3-setuptools clang-7 python-clang-7 libusb-1.0-0-dev stlink-tools openocd npm pv libncurses5:i386 libpython2.7:i386 libclang-6.0-dev if [[ $PAUSEAFTEREACHLINE == "true" ]]; then echo "Step finished. Please check the output above and press Enter to continue or Ctrl+C to stop." read