Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macos build #36

Merged
merged 6 commits into from
Jul 20, 2021
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
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