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

Fix the CMake 'install' target on macOS to sign bundled dependencies. #305

Merged
merged 2 commits into from
Aug 7, 2024
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
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
Loading