Skip to content

Commit

Permalink
Merge pull request #36 from TytanRock/macos-build
Browse files Browse the repository at this point in the history
Macos build. Tested this with actual hardware communicating with a raspberry pi. All basic actions work, including:
 - Change ID
 - Change Name
 - Firmware Update
 - Blink
 - Self-test Snapshot
  • Loading branch information
TytanRock committed Jul 20, 2021
2 parents ca72fe0 + 4f925d2 commit 656962e
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 11 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,27 @@ jobs:
name: PenguinTuner_Packages
path: penguintuner*.deb

build-macos:
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
- name: 'Prepare Runner'
run: |
brew install pkgconfig cmake python3 curl libssh gtk+3
pip3 install meson ninja
- name: 'build'
run: ./build.sh
- name: Create upload folder
run: |
mkdir macos-bins
cp build/penguintuner macos-bins/
cp backend/lib/macos/libpenguinbackend.dylib macos-bins/
- name: 'upload'
uses: actions/upload-artifact@v2
with:
name: Mac Binaries
path: macos-bins/*

verify-install:
runs-on: ubuntu-20.04
needs: [build]
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/checkout-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ on:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-20.04
build-native:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
- os: macos-10.15
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: configure
Expand Down
Binary file added backend/lib/macos/libpenguinbackend.dylib
Binary file not shown.
9 changes: 7 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/sh

case "$(uname -s)" in
Darwin*) arch=macos;;
Linux*) arch="$(dpkg --print-architecture)"
esac

rm -rf build
meson setup -Darchitecture=$(dpkg --print-architecture) build
meson setup -Darchitecture=${arch} build
cd build
ninja
ninja $1
21 changes: 15 additions & 6 deletions configure.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
#!/bin/sh

# If we're not root, prompt for root to install everything
[ "$(whoami)" != "root" ] && exec sudo -- "$0" "$@"

apt-get update
apt-get install -y libcurl4-openssl-dev libgtk-3-dev libssh-dev build-essential meson ninja-build

case "$(uname -s)" in
Darwin*)
brew update
brew install pkgconfig cmake python3 curl libssh gtk+3
pip3 install meson ninja
;;
Linux*)
# If we're not root, prompt for root to install everything
[ "$(whoami)" != "root" ] && exec sudo -- "$0" "$@"
apt-get update
apt-get install -y libcurl4-openssl-dev libgtk-3-dev libssh-dev build-essential meson ninja-build
;;
*)
echo "Unknown Architecture, cannot configure"
esac
6 changes: 5 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ src = [ 'src/application.c',
inc = include_directories(['include',
'backend/headers'])

backend = 'backend/lib/' + architecture + '/libpenguinbackend.so'
if architecture == 'macos'
backend = 'backend/lib/macos/libpenguinbackend.dylib'
else
backend = 'backend/lib/' + architecture + '/libpenguinbackend.so'
endif

gresources = gnome.compile_resources( 'app_resources_ui',
'src/app_resources_ui.gresource.xml',
Expand Down

0 comments on commit 656962e

Please sign in to comment.