1
0
mirror of synced 2024-11-23 23:31:02 +01:00

git: Added NoGPU dmg for MacOS (#708)

This commit is contained in:
iTrooz_ 2022-08-30 09:47:39 +02:00 committed by GitHub
parent 6689b8ebfa
commit 0569770239
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 75 additions and 6 deletions

View File

@ -118,20 +118,33 @@ jobs:
# MacOS build
macos:
runs-on: macos-11
name: 🍎 macOS 11.0
steps:
strategy:
matrix:
include:
- suffix: "-NoGPU"
custom_glfw: true
- suffix: ""
custom_glfw: false
name: 🍎 macOS 11.0${{matrix.suffix}}
steps:
- name: 🧰 Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: 📜 Set version variable
run: |
echo "IMHEX_VERSION=`cat VERSION`" >> $GITHUB_ENV
- name: 📜 Restore ccache
uses: actions/cache@v3
with:
path: |
~/Library/Caches/ccache
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
key: ${{ runner.os }}-${{ matrix.suffix }}-${{ secrets.CACHE_VERSION }}-build-${{ github.run_id }}
restore-keys: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build
@ -140,12 +153,43 @@ jobs:
with:
path: |
build/CMakeCache.txt
key: ${{ runner.os }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
key: ${{ runner.os }}-${{ matrix.suffix }}-${{ secrets.CACHE_VERSION }}-build-${{ hashFiles('**/CMakeLists.txt') }}
- name: ⬇️ Install dependencies
run: |
brew bundle --no-lock --file dist/Brewfile
- name: ⬇️ Install classic glfw
if: ${{! matrix.custom_glfw}}
run: |
brew install glfw
- name: 🧰 Checkout glfw
if: ${{matrix.custom_glfw}}
uses: actions/checkout@v3
with:
repository: glfw/glfw
path: glfw
- name: ⬇️ Patch and install custom glfw
if: ${{matrix.custom_glfw}}
run: |
cd glfw
git apply ../dist/macOS/0001-glfw-SW.patch
mkdir build
cd build
cmake \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_OBJC_COMPILER_LAUNCHER=ccache \
-DCMAKE_OBJCXX_COMPILER_LAUNCHER=ccache \
..
make -j 4 install
# MacOS cmake build
- name: 🛠️ Build
run: |
@ -167,13 +211,14 @@ jobs:
-DCMAKE_OBJCXX_COMPILER_LAUNCHER=ccache \
-DIMHEX_PATTERNS_PULL_MASTER=ON \
-DCMAKE_OSX_DEPLOYMENT_TARGET="10.10" \
-DCPACK_PACKAGE_FILE_NAME="imhex-${{env.IMHEX_VERSION}}-macOS${{matrix.suffix}}" \
..
make -j4 package
- name: ⬆️ Upload DMG
uses: actions/upload-artifact@v3
with:
name: macOS DMG
name: macOS DMG${{matrix.suffix}}
path: build/*.dmg
# Ubuntu build

1
dist/Brewfile vendored
View File

@ -1,4 +1,3 @@
brew "glfw"
brew "mbedtls"
brew "nlohmann-json"
brew "cmake"

25
dist/macOS/0001-glfw-SW.patch vendored Normal file
View File

@ -0,0 +1,25 @@
From 9c8665af4c2e2ce66555c15c05c72027bfdf0cb6 Mon Sep 17 00:00:00 2001
From: iTrooz <itrooz@protonmail.com>
Date: Mon, 29 Aug 2022 17:29:38 +0200
Subject: [PATCH] Use software rendering on MacOS
---
src/nsgl_context.m | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/nsgl_context.m b/src/nsgl_context.m
index fc1f7521..e5906575 100644
--- a/src/nsgl_context.m
+++ b/src/nsgl_context.m
@@ -198,7 +198,7 @@ GLFWbool _glfwCreateContextNSGL(_GLFWwindow* window,
NSOpenGLPixelFormatAttribute attribs[40];
int index = 0;
- ADD_ATTRIB(NSOpenGLPFAAccelerated);
+ ADD_ATTRIB(NSOpenGLPFARendererID);ADD_ATTRIB(kCGLRendererGenericFloatID);
ADD_ATTRIB(NSOpenGLPFAClosestPolicy);
if (ctxconfig->nsgl.offline)
--
2.37.2