Skip to content

Commit

Permalink
chore(cpn): update to Qt 5.15.2 and rework application packaging (#4270)
Browse files Browse the repository at this point in the history
Co-authored-by: raphaelcoeffic <[email protected]>
Co-authored-by: philmoz <[email protected]>
  • Loading branch information
3 people authored Nov 10, 2023
1 parent 9d5c6e6 commit a3faf7e
Show file tree
Hide file tree
Showing 49 changed files with 347 additions and 197 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/macosx_cpn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ on:
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
QT_VERSION: "5.12.9"
QT_VERSION: "5.15.2"

jobs:
build:
Expand Down Expand Up @@ -71,27 +71,27 @@ jobs:
run: python3 -m pip install --upgrade pip Pillow lz4 clang jinja2

- name: Patch GitHub macOS build
run: brew install pkg-config
run: brew install pkg-config

- name: Install libusb
run: wget https://github.com/libusb/libusb/releases/download/v1.0.20/libusb-1.0.20.tar.bz2 &&
export MACOSX_DEPLOYMENT_TARGET=10.9 &&
tar xfv libusb-1.0.20.tar.bz2 &&
cd libusb-1.0.20 &&
./configure &&
make install &&
cd ..
run: brew install libusb

- name: Install dfu-util
run: wget https://downloads.sourceforge.net/project/dfu-util/dfu-util-0.9.tar.gz &&
tar xfv dfu-util-0.9.tar.gz &&
cd dfu-util-0.9 &&
./configure &&
make install
run: brew install dfu-util

- name: Select XCode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '13.2.1'

- name: Install SDL2
run: brew install SDL2

- name: Select XCode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '11.7'

- name: Build
working-directory: ${{github.workspace}}
shell: bash
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/win-cpn-32.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
CMAKE_GENERATOR: "MSYS Makefiles"
QT_VERSION: "5.12.9"
MINGW_VERSION: "win32_mingw73"
MINGW_PATH: "mingw73_32"
QT_VERSION: "5.15.2"
MINGW_VERSION: "win32_mingw81"
MINGW_PATH: "mingw81_32"

jobs:
build:
Expand Down Expand Up @@ -56,7 +56,9 @@ jobs:
mingw-w64-i686-libraqm \
mingw-w64-i686-SDL2 \
mingw-w64-i686-clang \
mingw-w64-i686-nsis
mingw-w64-i686-nsis \
mingw-w64-i686-dfu-util \
mingw-w64-i686-openssl
python -m pip install clang jinja2
- name: Install Qt
Expand All @@ -66,7 +68,6 @@ jobs:
cache-key-prefix: 'install-qt-action-win32'
version: ${{ env.QT_VERSION }}
arch: ${{ env.MINGW_VERSION }}
tools: 'tools_openssl_x86'

- name: Check out the repo
uses: actions/checkout@v3
Expand All @@ -79,7 +80,6 @@ jobs:
run: |
mkdir output && \
CMAKE_PREFIX_PATH=$RUNNER_WORKSPACE/Qt/$QT_VERSION/$MINGW_PATH \
QT_TOOLS_OPENSSL_ROOT_PATH=$RUNNER_WORKSPACE/Qt/Tools/OpenSSL/Win_x86 \
tools/build-companion.sh "$(pwd)" "$(pwd)/output/"
- name: Compose release filename
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/win_cpn-64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
CMAKE_GENERATOR: "MSYS Makefiles"
QT_VERSION: "5.12.9"
MINGW_VERSION: "win64_mingw73"
MINGW_PATH: "mingw73_64"
QT_VERSION: "5.15.2"
MINGW_VERSION: "win64_mingw81"
MINGW_PATH: "mingw81_64"

jobs:
build:
Expand Down Expand Up @@ -70,7 +70,9 @@ jobs:
mingw-w64-x86_64-libraqm \
mingw-w64-x86_64-SDL2 \
mingw-w64-x86_64-clang \
mingw-w64-x86_64-nsis
mingw-w64-x86_64-nsis \
mingw-w64-x86_64-dfu-util \
mingw-w64-x86_64-openssl
python -m pip install clang jinja2
- name: Install Qt
Expand All @@ -80,7 +82,6 @@ jobs:
cache-key-prefix: 'install-qt-action-win64'
version: ${{ env.QT_VERSION }}
arch: ${{ env.MINGW_VERSION }}
tools: 'tools_openssl_x64'

- name: Check out the repo
uses: actions/checkout@v3
Expand All @@ -93,7 +94,6 @@ jobs:
run: |
mkdir output && \
CMAKE_PREFIX_PATH=$RUNNER_WORKSPACE/Qt/$QT_VERSION/$MINGW_PATH \
QT_TOOLS_OPENSSL_ROOT_PATH=$RUNNER_WORKSPACE/Qt/Tools/OpenSSL/Win_x64 \
tools/build-companion.sh "$(pwd)" "$(pwd)/output/"
- name: Compose release filename
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if(EdgeTX_SUPERBUILD)

# Add explicit targets for triggering cmake in the external projects
set_property(DIRECTORY PROPERTY EP_STEP_TARGETS configure clean)

# Native targets
ExternalProject_Add(native
SOURCE_DIR ${CMAKE_SOURCE_DIR}
Expand Down Expand Up @@ -136,7 +136,7 @@ if(NATIVE_BUILD)
include(NativeTargets)
else()
# Prevent CMake warnings
set(IGNORE "${SDL2_LIBRARY_PATH}")
set(IGNORE "${SDL2_LIBRARY_PATH}" "${LIBSSL1_ROOT_DIR}" "${OPENSSL_ROOT_DIR}")
endif()

add_subdirectory(${RADIO_SRC_DIR})
25 changes: 25 additions & 0 deletions cmake/FindDfuutil.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# - try to find program dfu-util

set(DFU_UTIL_ROOT_DIR
"${DFU_UTIL_ROOT_DIR}"
CACHE
PATH
"Root directory to search for dfu-util")

find_program(DFU_UTIL_PROGRAM
NAMES
dfu-util
HINTS
"${DFU_UTIL_ROOT_DIR}")

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(DFU_UTIL
DEFAULT_MSG
DFU_UTIL_PROGRAM)

if(DFU_UTIL_FOUND)
set(DFU_UTIL_PATH "${DFU_UTIL_PROGRAM}")
mark_as_advanced(DFU_UTIL_ROOT_DIR)
endif()

mark_as_advanced(DFU_UTIL_PROGRAM)
27 changes: 27 additions & 0 deletions cmake/FindLibssl1.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# - try to find libssl-1 library

if (DEFINED ENV{LIBSSL1_ROOT_DIR})
set(LIBSSL1_ROOT_DIR "$ENV{LIBSSL1_ROOT_DIR}")
endif()

find_library(LIBSSL1_LIBRARY
NAMES
libssl.so.1.1
libssl-1_1.dll
libssl-1_1.dylib
HINTS
"${LIBSSL1_ROOT_DIR}")

get_filename_component(LIBSSL1_LIBRARY_PATH ${LIBSSL1_LIBRARY} PATH)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LIBSSL1
DEFAULT_MSG
LIBSSL1_LIBRARY_PATH)

if(LIBSSL1_FOUND)
set(LIBSSL1_LIBRARY_DIR "${LIBSSL1_LIBRARY_PATH}")
mark_as_advanced(LIBSSL1_ROOT_DIR)
endif()

mark_as_advanced(LIBSSL1_LIBRARY_PATH)
31 changes: 31 additions & 0 deletions cmake/FindLibusb1.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# - try to find libusb-1 library

set(LIBUSB1_ROOT_DIR
"${LIBUSB1_ROOT_DIR}"
CACHE
PATH
"Root directory to search for libusb-1")

find_library(LIBUSB1_LIBRARY
NAMES
libusb-1.0
libusb-1.0.so
libusb-1.0.so.0
libusb-1.0.dll
libusb-1.0.dylib
HINTS
"${LIBUSB1_ROOT_DIR}")

get_filename_component(LIBUSB1_LIBRARY_PATH ${LIBUSB1_LIBRARY} PATH)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LIBUSB1
DEFAULT_MSG
LIBUSB1_LIBRARY_PATH)

if(LIBUSB1_FOUND)
set(LIBUSB1_LIBRARY_DIR "${LIBUSB1_LIBRARY_PATH}")
mark_as_advanced(LIBUSB1_ROOT_DIR)
endif()

mark_as_advanced(LIBUSB1_LIBRARY_PATH)
32 changes: 30 additions & 2 deletions cmake/NativeTargets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,40 @@ if(Qt5Core_FOUND OR FOX_FOUND)
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}")
# find_package("SDL2") does not set a variable holding the path to the location of the SDL2 shared library
find_file(SDL2_LIB_PATH
NAMES
libSDL2.so
SDL2.dll
SDL2.dylib
HINTS
"/usr/lib/x86_64-linux-gnu"
${SDL2_LIBRARY_PATH})
message(STATUS "SDL2 Lib: ${SDL2_LIB_PATH} Libs: ${SDL2_LIBRARIES}; Headers: ${SDL2_INCLUDE_DIRS}")
else()
message(STATUS "SDL not found! Simulator audio, and joystick inputs, will not work.")
message(STATUS "SDL2 not found! Simulator audio, and joystick inputs, will not work.")
endif()
endif()

if(Qt5Core_FOUND AND NOT DISABLE_COMPANION)
find_package(Libusb1)
if(LIBUSB1_FOUND)
find_package(Dfuutil)
endif()

if(LINUX)
find_package(Libssl1)
endif()

# OpenSSL
# environment variable set in github workflows and build-edgetx Dockerfile
if (DEFINED ENV{OPENSSL_ROOT_DIR})
set(OPENSSL_ROOT_DIR "$ENV{OPENSSL_ROOT_DIR}")
endif()

find_package(OpenSSL)
endif()

# Windows-specific includes and libs shared by sub-projects
if(WIN32)
list(APPEND WIN_INCLUDE_DIRS "${RADIO_SRC_DIR}/thirdparty/windows/dirent")
Expand Down
Loading

0 comments on commit a3faf7e

Please sign in to comment.