Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -50,20 +50,25 @@ 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 }}

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: |
Expand All @@ -78,11 +83,18 @@ 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@v4
with:
name: built-plugin-macos
path: ${{ github.workspace }}/install/XPanel/64/*

docs:
name: Docs
runs-on: ubuntu-latest
Expand All @@ -94,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
16 changes: 16 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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: |
Expand All @@ -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
Expand All @@ -92,4 +107,5 @@ jobs:
${TAG} \
${WINDOWS_RELEASE_PLUGIN_ZIP} \
${LINUX_RELEASE_PLUGIN_ZIP} \
${MACOS_RELEASE_PLUGIN_ZIP} \
${SAMPLE_CONFIG_ZIP}
33 changes: 30 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
42 changes: 42 additions & 0 deletions build-macos.sh
Original file line number Diff line number Diff line change
@@ -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/"
8 changes: 6 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
1 change: 1 addition & 0 deletions src/core/Logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <list>
#include <mutex>
#include <ctime>
#include <chrono>
#include "XPLMUtilities.h"

enum TLogLevel
Expand Down
Loading