Skip to content

Commit 0d8e8d4

Browse files
authored
Merge pull request #154 from laamaa/macos_builds
Tweak Macos builds
2 parents 254280d + 7d92ef9 commit 0d8e8d4

File tree

3 files changed

+113
-99
lines changed

3 files changed

+113
-99
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: m8c macos arm64 build
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
jobs:
9+
10+
build-macos:
11+
runs-on: macos-latest
12+
13+
steps:
14+
- name: 'Environment info'
15+
run: |
16+
uname -m
17+
18+
- name: 'Install dependencies'
19+
run: brew install cmake pkg-config sdl2 libserialport
20+
21+
- name: 'Checkout'
22+
uses: actions/checkout@v4
23+
24+
- name: Set current date as env variable
25+
run: echo "NOW=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
26+
27+
- name: 'Build m8c'
28+
run: |
29+
mkdir -p build_arm64 && cd build_arm64 && cmake .. && cpack -V
30+
31+
- name: 'Build package'
32+
run: |
33+
mv build_arm64/m8c-0.1.1-Darwin.dmg m8c-${{ env.NOW }}-macos-applesilicon.dmg
34+
- name: 'Upload artifact'
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: m8c-${{ env.NOW }}-macos-applesilicon
38+
path: |
39+
m8c-${{ env.NOW }}-macos-applesilicon.dmg
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: m8c macos intel build
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
jobs:
9+
10+
build-macos:
11+
runs-on: macos-12
12+
env:
13+
SDL_VERSION: 2.30.4
14+
15+
steps:
16+
- name: 'Install dependencies'
17+
run: brew install cmake pkg-config autoconf automake libtool
18+
19+
- name: 'Cache x86_64 files'
20+
id: cache-x86_64-files
21+
uses: actions/cache@v4
22+
with:
23+
path: '/Users/runner/x86_64'
24+
key: mac-x86_64-files
25+
26+
- name: 'Download 10.9 SDK for x86_64'
27+
if: steps.cache-x86_64-files.outputs.cache-hit != 'true'
28+
run: |
29+
mkdir -p "$HOME/x86_64"
30+
pushd "$HOME/x86_64"
31+
mkdir SDKs
32+
cd SDKs
33+
curl -L "https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.9.sdk.tar.xz" | tar -xvf -
34+
popd
35+
36+
- name: 'Checkout'
37+
uses: actions/checkout@v4
38+
39+
- name: Set current date as env variable
40+
run: echo "NOW=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
41+
42+
- name: 'Download SDL2 sources'
43+
run: |
44+
(curl https://www.libsdl.org/release/SDL2-$SDL_VERSION.tar.gz || curl -L https://github.com/libsdl-org/SDL/releases/download/release-$SDL_VERSION/SDL2-$SDL_VERSION.tar.gz) | tar xvf -
45+
46+
- name: 'Build SDL2'
47+
run: |
48+
export MACOSX_DEPLOYMENT_TARGET="10.9" && cd SDL2-$SDL_VERSION && mkdir build_x86_64 && cd build_x86_64 && ../configure CPPFLAGS="-mmacosx-version-min=10.7 -DMAC_OS_X_VERSION_MIN_REQUIRED=1070 -isysroot $HOME/x86_64/SDKs/MacOSX10.9.sdk" --prefix="$HOME/x86_64prefix" && make && make install
49+
50+
- name: 'Download libserialport sources'
51+
run: |
52+
curl -L -O https://github.com/sigrokproject/libserialport/archive/refs/heads/master.zip && unzip master.zip && rm master.zip
53+
54+
- name: 'Build libserialport'
55+
run: |
56+
pushd libserialport-master
57+
mkdir autostuff
58+
autoreconf -I"$HOME/x86_64prefix/share/aclocal" -i
59+
export MACOSX_DEPLOYMENT_TARGET="10.9" && mkdir build_x86_64 && cd build_x86_64 && ../configure CFLAGS="-mmacosx-version-min=10.7 -DMAC_OS_X_VERSION_MIN_REQUIRED=1070 -isysroot $HOME/x86_64/SDKs/MacOSX10.9.sdk" --prefix="$HOME/x86_64prefix" && make && make install
60+
popd
61+
62+
- name: 'Build m8c'
63+
run: |
64+
export MACOSX_DEPLOYMENT_TARGET="10.9" && export PKG_CONFIG_PATH="$HOME/x86_64prefix/lib/pkgconfig" && export CFLAGS="-mmacosx-version-min=10.7 -DMAC_OS_X_VERSION_MIN_REQUIRED=1070 -isysroot $HOME/x86_64/SDKs/MacOSX10.9.sdk" && mkdir build_x86_64 && cd build_x86_64 && cmake .. && cpack -V
65+
66+
- name: 'Build package'
67+
run: |
68+
mv build_x86_64/m8c-0.1.1-Darwin.dmg m8c-${{ env.NOW }}-macos-intel.dmg
69+
- name: 'Upload artifact'
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: m8c-${{ env.NOW }}-macos-intel
73+
path: |
74+
m8c-${{ env.NOW }}-macos-intel.dmg

.github/workflows/build-macos.yml

Lines changed: 0 additions & 99 deletions
This file was deleted.

0 commit comments

Comments
 (0)