Skip to content

Commit

Permalink
Merge pull request #305 from GLVis/mac-app-fix
Browse files Browse the repository at this point in the history
Fix the CMake 'install' target on macOS to sign bundled dependencies.
  • Loading branch information
tzanio authored Aug 7, 2024
2 parents da0d756 + 99f255e commit c8223df
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,15 @@ jobs:
- name: package binary (Windows)
if: matrix.os == 'windows-latest'
env:
GLVIS_EXPORT_NAME: glvis-${{ github.ref_name }}-${{ runner.os }}-amd64
GLVIS_EXPORT_NAME: glvis-${{ github.ref_name }}-${{ runner.os }}-${{ runner.arch }}
run: |
cd glvis/build
Copy-Item -Path "Release" -Destination "${Env:GLVIS_EXPORT_NAME}" -Recurse
- name: package binary (Mac)
if: matrix.os == 'macos-latest'
env:
GLVIS_EXPORT_NAME: glvis-${{ github.ref_name }}-${{ runner.os }}-amd64
GLVIS_EXPORT_NAME: glvis-${{ github.ref_name }}-${{ runner.os }}-${{ runner.arch }}
run: |
cd glvis/build
make app
Expand All @@ -222,12 +222,14 @@ jobs:
mkdir dmg_tmp
cp -a ../install-${{ matrix.os }}/GLVis.app dmg_tmp/GLVis.app
# Create DMG since actions/upload-artifact will clobber Unix permissions
hdiutil create -volname "GLVis macOS x86_64" -srcfolder dmg_tmp -ov -format UDZO GLVis.dmg
hdiutil create -volname "GLVis macOS arm64" -srcfolder dmg_tmp -ov -format UDZO GLVis.dmg
mkdir ${GLVIS_EXPORT_NAME}
cp GLVis.dmg ${GLVIS_EXPORT_NAME}
- name: upload binary
uses: actions/upload-artifact@v4
env:
GLVIS_EXPORT_NAME: glvis-${{ github.ref_name }}-${{ runner.os }}-${{ runner.arch }}
with:
name: glvis-${{ github.ref_name }}-${{ runner.os }}-amd64
path: glvis/build/glvis-${{ github.ref_name }}-${{ runner.os }}-amd64
name: ${{ env.GLVIS_EXPORT_NAME }}
path: glvis/build/${{ env.GLVIS_EXPORT_NAME }}
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
https://glvis.org


Version 4.3.1 (development)
===========================

- Fix the Mac binary build in GitHub CI.


Version 4.3 released on Aug 7, 2024
===================================

Expand Down
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,14 @@ if(NOT EMSCRIPTEN)
install(CODE [[
include (BundleUtilities)
fixup_bundle("${CMAKE_INSTALL_PREFIX}/GLVis.app" "" "")
file(GLOB LIBS_TO_SIGN
"${CMAKE_INSTALL_PREFIX}/GLVis.app/Contents/Frameworks/*.dylib")
foreach(LIB ${LIBS_TO_SIGN})
if (NOT IS_SYMLINK ${LIB})
execute_process(COMMAND codesign --force --sign - ${LIB})
endif()
endforeach()
execute_process(COMMAND codesign --force --sign - ${CMAKE_INSTALL_PREFIX}/GLVis.app)
]] COMPONENT RUNTIME)
endif(APPLE)

Expand Down

0 comments on commit c8223df

Please sign in to comment.