From 261374d6d55ff51516f7d057c6773bc5cbb40b65 Mon Sep 17 00:00:00 2001 From: Norbert Takacs Date: Thu, 3 Jul 2025 07:41:18 +0200 Subject: [PATCH 1/6] Fix CMake target_link_libraries keyword signature inconsistency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix mixed keyword and plain signatures in target_link_libraries calls that were causing CMake build errors on macOS. All calls now use the consistent PRIVATE keyword signature. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6df96d4..55845cc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -47,10 +47,14 @@ if (UNIX AND NOT APPLE) include(FindPkgConfig) pkg_check_modules(libudev REQUIRED IMPORTED_TARGET libudev) find_library(HIDAPI_LIBRARY NAMES udev) - target_link_libraries(xpanel PkgConfig::libudev) + target_link_libraries(xpanel PRIVATE PkgConfig::libudev) +elseif (APPLE) + find_library(HIDAPI_LIBRARY IOKit) + find_library(COREFOUNDATION_LIBRARY CoreFoundation) + target_link_libraries(xpanel PRIVATE ${HIDAPI_LIBRARY} ${COREFOUNDATION_LIBRARY}) endif() -target_link_libraries(xpanel xpsdk::xpsdk Lua::Lua FIPSDK::FIPSDK) +target_link_libraries(xpanel PRIVATE xpsdk::xpsdk Lua::Lua FIPSDK::FIPSDK) set_target_properties(xpanel PROPERTIES CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN TRUE) target_compile_definitions(xpanel PRIVATE PLUGIN_SIGNATURE="${PROJECT_NAME_LOWERCASE}" PLUGIN_VERSION="${PROJECT_VERSION}") From cb91d741f43344a2474520db06ac9b70055c9fbf Mon Sep 17 00:00:00 2001 From: Norbert Takacs Date: Thu, 3 Jul 2025 07:42:03 +0200 Subject: [PATCH 2/6] Add macOS support to GitHub Actions CI/CD workflows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add macOS runner to build matrix in build-and-test workflow - Install macOS dependencies via Homebrew (cmake, lua, hidapi) - Add macOS artifact upload to CI workflow - Add macOS build artifacts to release workflow - Include macOS plugin zip in release process 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/build-and-test.yml | 16 ++++++++++++++-- .github/workflows/release.yml | 16 ++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 35fe6ce..72da3ca 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -50,7 +50,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-22.04, windows-latest] + os: [ubuntu-22.04, windows-latest, macos-latest] name: Build and Test (CMake, ${{ matrix.os }}) runs-on: ${{ matrix.os }} @@ -58,12 +58,17 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Install dependencies + - name: Install dependencies (Linux) if: matrix.os == 'ubuntu-22.04' run: | sudo apt-get update -qq && sudo apt-get install -y build-essential cmake liblua5.4-dev libudev-dev libhidapi-dev echo 'XPANEL_INSTALL_DEPS_FLAG=-DINSTALL_DEPS=ON' >> $GITHUB_ENV + - name: Install dependencies (macOS) + if: matrix.os == 'macos-latest' + run: | + brew install cmake lua hidapi + - name: Build run: | @@ -83,6 +88,13 @@ jobs: name: built-plugin-linux path: ${{ github.workspace }}/install/XPanel/64/* + - name: Upload built plugin (macOS) + if: matrix.os == 'macos-latest' + uses: actions/upload-artifact@v3 + with: + name: built-plugin-macos + path: ${{ github.workspace }}/install/XPanel/64/* + docs: name: Docs runs-on: ubuntu-latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f368bd5..24fecaa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,6 +25,7 @@ jobs: TAG: v${{ inputs.release-version }} WINDOWS_RELEASE_PLUGIN_ZIP: xpanel_windows_v${{ inputs.release-version }}.zip LINUX_RELEASE_PLUGIN_ZIP: xpanel_linux_v${{ inputs.release-version }}_glibc2.35.zip + MACOS_RELEASE_PLUGIN_ZIP: xpanel_macos_v${{ inputs.release-version }}.zip SAMPLE_CONFIG_ZIP: sample_configs_v${{ inputs.release-version }}.zip steps: @@ -42,6 +43,12 @@ jobs: name: built-plugin-linux path: built-plugin-linux/plugins/XPanel/64/ + - name: Download built plugin (macOS) + uses: actions/download-artifact@v4.1.7 + with: + name: built-plugin-macos + path: built-plugin-macos/plugins/XPanel/64/ + - name: Download docs uses: actions/download-artifact@v4.1.7 with: @@ -57,16 +64,19 @@ jobs: run: | cp sample-config/board-config.ini built-plugin-windows/plugins/XPanel/64/ cp sample-config/board-config.ini built-plugin-linux/plugins/XPanel/64/ + cp sample-config/board-config.ini built-plugin-macos/plugins/XPanel/64/ - name: Copy FIP Fonts BMP run: | cp 3rdparty/FIP-SDK/fonts/fip-fonts.bmp built-plugin-windows/plugins/XPanel/64/ cp 3rdparty/FIP-SDK/fonts/fip-fonts.bmp built-plugin-linux/plugins/XPanel/64/ + cp 3rdparty/FIP-SDK/fonts/fip-fonts.bmp built-plugin-macos/plugins/XPanel/64/ - name: Copy Doc PDF run: | cp doc/documentation.pdf built-plugin-windows/plugins/XPanel/64/ cp doc/documentation.pdf built-plugin-linux/plugins/XPanel/64/ + cp doc/documentation.pdf built-plugin-macos/plugins/XPanel/64/ - name: Create release plugin zip (Windows) run: | @@ -78,6 +88,11 @@ jobs: cd built-plugin-linux zip -r ../${LINUX_RELEASE_PLUGIN_ZIP} . + - name: Create release plugin zip (macOS) + run: | + cd built-plugin-macos + zip -r ../${MACOS_RELEASE_PLUGIN_ZIP} . + - name: Create sample configs zip run: | cd sample-config @@ -92,4 +107,5 @@ jobs: ${TAG} \ ${WINDOWS_RELEASE_PLUGIN_ZIP} \ ${LINUX_RELEASE_PLUGIN_ZIP} \ + ${MACOS_RELEASE_PLUGIN_ZIP} \ ${SAMPLE_CONFIG_ZIP} From 9382af9b6a9108895a1265a36504ad6eadcb4bcb Mon Sep 17 00:00:00 2001 From: Norbert Takacs Date: Thu, 3 Jul 2025 07:42:33 +0200 Subject: [PATCH 3/6] Add macOS build script for local development MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Create build-macos.sh script to simplify macOS builds: - Checks for macOS environment - Installs dependencies via Homebrew - Configures CMake with local install prefix - Builds and installs plugin to project directory - Provides clear success message with install path 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- build-macos.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 build-macos.sh diff --git a/build-macos.sh b/build-macos.sh new file mode 100755 index 0000000..c050b3c --- /dev/null +++ b/build-macos.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +# XPanel macOS Build Script +# Builds the XPanel plugin for macOS + +set -e + +echo "Building XPanel for macOS..." + +# Check if we're on macOS +if [[ "$OSTYPE" != "darwin"* ]]; then + echo "Error: This script must be run on macOS" + exit 1 +fi + +# Install dependencies if needed +if ! command -v brew &> /dev/null; then + echo "Homebrew not found. Please install Homebrew first." + exit 1 +fi + +echo "Installing dependencies..." +brew install cmake lua hidapi + +# Create build directory +mkdir -p build +cd build + +# Configure CMake +echo "Configuring CMake..." +cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$PWD/../install" .. + +# Build +echo "Building..." +cmake --build . --config Release + +# Install +echo "Installing..." +cmake --build . --target install + +echo "Build completed successfully!" +echo "Plugin installed in: $(cd .. && pwd)/install/XPanel/64/" \ No newline at end of file From a3323d684468dab0fe8c475a040e3e0cec81677d Mon Sep 17 00:00:00 2001 From: Norbert Takacs Date: Thu, 3 Jul 2025 07:43:03 +0200 Subject: [PATCH 4/6] Update README with comprehensive macOS build instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add Homebrew installation prerequisites - Include PATH setup instructions for Homebrew - Document both script-based and manual build options - Provide clear step-by-step macOS build process - Update dependency installation commands 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- README.md | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bc376bb..1bc686d 100644 --- a/README.md +++ b/README.md @@ -100,10 +100,37 @@ $ cmake --install build ## macOS -Dependencies: +### Prerequisites +First, install Homebrew (if not already installed): +```bash +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +``` + +After installation, add Homebrew to your PATH (the installer will show you the exact commands): +```bash +echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zshrc +eval "$(/opt/homebrew/bin/brew shellenv)" ``` -brew install lua -brew install pkg-config + +### Build Instructions + +Check out the latest source file from [github](https://github.com/norberttak/XPanel) + +Install dependencies: +```bash +brew install cmake lua hidapi +``` + +Build using the provided script: +```bash +./build-macos.sh +``` + +Or build manually: +```bash +cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/xpanel-install -S . -B build +cmake --build build --config Release +cmake --build build --target install ``` Copy or link the `/tmp/xpanel-install/XPanel` directory into the X-Plane plugin folder. From 83e8103e11e5936536906e72a9e86491460c9251 Mon Sep 17 00:00:00 2001 From: Norbert Takacs Date: Thu, 3 Jul 2025 08:45:47 +0200 Subject: [PATCH 5/6] Update actions/upload-artifact from v3 to v4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update all upload-artifact actions to use the latest v4 version to avoid deprecation warnings and ensure compatibility. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/build-and-test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 72da3ca..257dd02 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -35,13 +35,13 @@ jobs: run: vstest.console.exe /Platform:x64 x64/Release/test.dll - name: Upload built plugin - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: built-plugin-windows path: Release/plugins/XPanel/64/* - name: Upload test logs - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: test_log path: x64/Release/test_log.txt @@ -83,14 +83,14 @@ jobs: - name: Upload built plugin (Linux glibc 2.35) if: matrix.os == 'ubuntu-22.04' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: built-plugin-linux path: ${{ github.workspace }}/install/XPanel/64/* - name: Upload built plugin (macOS) if: matrix.os == 'macos-latest' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: built-plugin-macos path: ${{ github.workspace }}/install/XPanel/64/* @@ -106,7 +106,7 @@ jobs: working-directory: ./doc run: pandoc -f gfm -t pdf --pdf-engine weasyprint -c style.css -o documentation.pdf documentation.md - name: Upload docs - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: docs path: doc/documentation.pdf From 172db5674ef29f8629fee5fd8ffe59f99ed6eefb Mon Sep 17 00:00:00 2001 From: Norbert Takacs Date: Thu, 3 Jul 2025 12:44:30 +0200 Subject: [PATCH 6/6] Fix Windows build error: add missing chrono include in Logger.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add missing #include to fix Windows compilation error: 'system_clock': the symbol to the left of a '::' must be a type The code uses std::chrono::system_clock but was missing the required chrono header include. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/core/Logger.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/Logger.h b/src/core/Logger.h index df1c5d4..8137b19 100644 --- a/src/core/Logger.h +++ b/src/core/Logger.h @@ -10,6 +10,7 @@ #include #include #include +#include #include "XPLMUtilities.h" enum TLogLevel