-
Notifications
You must be signed in to change notification settings - Fork 8
Use Vcpkg manifest mode and add arm64 mac support #29
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
base: master
Are you sure you want to change the base?
Changes from all commits
fd90c18
af6d823
2a34825
fa6b547
ccb90b5
d0ada23
4fd9ce9
3df2ea1
cb87eb4
823c509
11621ab
6bb0105
59ba167
d4d3d48
a2ca84a
fd6a5ae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| name: vcpkg-export | ||
| inputs: | ||
| export-type: | ||
| description: 'Either raw or 7zip' | ||
| required: true | ||
| output-name: | ||
| required: true | ||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Export installed vcpkg packages | ||
| run: > | ||
| vcpkg export | ||
| --x-all-installed | ||
| --raw | ||
| --output-dir ./ | ||
| --output ${{ inputs.output-name }} | ||
| if: ${{ inputs.export-type == 'raw' }} | ||
| shell: bash | ||
| - name: Export installed vcpkg packages | ||
| run: > | ||
| vcpkg export | ||
| --x-all-installed | ||
| --7zip | ||
| --output-dir ./ | ||
| --output ${{ inputs.output-name }} | ||
| if: ${{ inputs.export-type == '7zip' }} | ||
| shell: bash | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,33 @@ env: | |
| VCPKG_REVISION: 137197a8f85e6c6cf1843ef024af7d9c28bb0bde | ||
|
|
||
| jobs: | ||
| macos: | ||
| runs-on: macos-latest | ||
| env: | ||
| triplet: arm64-osx-dynamic | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Export GitHub Actions cache environment variables | ||
| uses: actions/github-script@v6 | ||
| with: | ||
| script: | | ||
| core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | ||
| core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | ||
| - run: brew install autoconf autoconf-archive automake | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't a review comment, just a note so I'll see it if this line looks weird to me later. Unlike on Windows, where vcpkg will install its own local isolated versions of tools like these, it explicitly recommends you install these yourself via Homebrew for MacOS. |
||
| - uses: ./.github/actions/vcpkg-setup | ||
| - name: Install vcpkg packages | ||
| run: vcpkg install --overlay-ports=ports --overlay-triplets=triplets --triplet ${{ env.triplet }} | ||
| - uses: ./.github/actions/vcpkg-export | ||
| with: | ||
| output-name: vcpkg-${{ env.triplet }}-${{ github.sha }} | ||
| export-type: 7zip | ||
|
|
||
| - name: Store exported vcpkg packages | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: vcpkg-${{ env.triplet }}-${{ github.sha }} | ||
| path: ${{ github.workspace }}/vcpkg-${{ env.triplet }}-${{ github.sha }}.7z | ||
|
|
||
| static-windows: | ||
| strategy: | ||
| fail-fast: true | ||
|
|
@@ -38,27 +65,11 @@ jobs: | |
| - name: Install vcpkg packages | ||
| run: > | ||
| vcpkg install --overlay-ports=ports --overlay-triplets=triplets --host-triplet ${{ matrix.msvc_version.triplet }} --triplet ${{ matrix.msvc_version.triplet }} | ||
| boost-geometry | ||
| boost-iostreams | ||
| boost-program-options | ||
| bullet3[double-precision,multithreading] | ||
| ffmpeg | ||
| freetype | ||
| icu | ||
| luajit | ||
| lz4 | ||
| mygui | ||
| openal-soft | ||
| openmw-osg | ||
| sdl2 | ||
|
|
||
| - name: Export installed vcpkg packages | ||
| run: > | ||
| vcpkg export | ||
| --x-all-installed | ||
| --raw | ||
| --output-dir ${{ github.workspace }} | ||
| --output intermediate | ||
|
|
||
| - uses: ./.github/actions/vcpkg-export | ||
| with: | ||
| output-name: intermediate | ||
| export-type: raw | ||
|
|
||
| - name: Move pdb files | ||
| working-directory: '${{ github.workspace }}/intermediate' | ||
|
|
@@ -117,27 +128,11 @@ jobs: | |
| - name: Install vcpkg packages | ||
| run: > | ||
| vcpkg install --overlay-ports=ports --overlay-triplets=triplets --host-triplet ${{ matrix.msvc_version.triplet }} --triplet ${{ matrix.msvc_version.triplet }} | ||
| boost-geometry | ||
| boost-iostreams | ||
| boost-program-options | ||
| bullet3[double-precision,multithreading] | ||
| ffmpeg | ||
| freetype | ||
| icu | ||
| luajit | ||
| lz4 | ||
| mygui | ||
| openal-soft | ||
| openmw-osg | ||
| sdl2 | ||
|
|
||
| - name: Export installed vcpkg packages | ||
| run: > | ||
| vcpkg export | ||
| --x-all-installed | ||
| --raw | ||
| --output-dir ${{ github.workspace }} | ||
| --output intermediate | ||
|
|
||
| - uses: ./.github/actions/vcpkg-export | ||
| with: | ||
| output-name: intermediate | ||
| export-type: raw | ||
|
|
||
| - name: Move pdb files | ||
| working-directory: '${{ github.workspace }}/intermediate' | ||
|
|
@@ -186,6 +181,7 @@ jobs: | |
| upload-deps: | ||
| needs: | ||
| - dynamic-windows | ||
| - macos | ||
|
|
||
| runs-on: ubuntu-latest | ||
|
|
||
|
|
@@ -214,6 +210,7 @@ jobs: | |
| mv vcpkg-x64-*-${{ github.sha }}/vcpkg-x64-windows-2022-${{ github.sha }}.7z vcpkg-x64-windows-2022-${{ env.file }}.7z | ||
| mv vcpkg-x64-*-${{ github.sha }}/vcpkg-x64-windows-2019-pdb-${{ github.sha }}.7z vcpkg-x64-windows-2019-pdb-${{ env.file }}.7z | ||
| mv vcpkg-x64-*-${{ github.sha }}/vcpkg-x64-windows-2022-pdb-${{ github.sha }}.7z vcpkg-x64-windows-2022-pdb-${{ env.file }}.7z | ||
| mv vcpkg-arm64-osx-dynamic-${{ github.sha }}/vcpkg-arm64-osx-dynamic-${{ github.sha }}.7z vcpkg-arm64-osx-dynamic-${{ env.file }}.7z | ||
|
|
||
| - name: Release | ||
| if: startsWith(github.ref, 'refs/tags/') | ||
|
|
@@ -280,6 +277,11 @@ jobs: | |
| file-pattern: vcpkg-x64-windows-*-${{ env.file }} | ||
| subdirectory: windows | ||
|
|
||
| - uses: ./.github/actions/manifest-setup | ||
| with: | ||
| file-pattern: vcpkg-*-osx-dynamic-${{ env.file }} | ||
| subdirectory: macos | ||
|
|
||
| - name: Generate commit message | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
|
|
@@ -297,6 +299,7 @@ jobs: | |
| run: | | ||
| git checkout -b vcpkg-${{ github.sha }} | ||
| git add windows/vcpkg-*-manifest.txt | ||
| git add macos/vcpkg-*-manifest.txt | ||
| git commit -F commit_message.txt | ||
|
|
||
| - name: Verify commit to openmw-deps repository | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| vcpkg_installed | ||
| vcpkg-*-test |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,56 @@ | ||
| # openmw-deps-build | ||
|
|
||
| This is a repository to host CI jobs to build dependencies for OpenMW to be cached as binary artifacts at https://gitlab.com/OpenMW/openmw-deps. | ||
| This is a repository to host CI jobs to build dependencies for OpenMW via vcpkg to be cached as binary artifacts at [https://gitlab.com/OpenMW/openmw-deps](https://gitlab.com/OpenMW/openmw-deps). | ||
|
|
||
| Jobs start automatically on push to master and automatically push archived artifacts to another git repository. | ||
|
|
||
| To make this work properly multiple [secrets](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions) have to be configured: | ||
| [Vcpkg has system requirements](https://learn.microsoft.com/en-us/vcpkg/concepts/supported-hosts) | ||
|
|
||
| ## Secret Setup in CI for Testing | ||
|
|
||
| You can test the repo is working on your own fork using a deploy key and a gpg key you generate. | ||
|
|
||
| To make this work properly multiple [**secrets**](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions) have to be configured: | ||
|
|
||
| * `SSH_PRIVATE_KEY` with private SSH key allowed to push changes to repository specified via `PUSH_URL` variable (e.g. generated by `ssh-keygen`). | ||
| * You should use a deploy key setup on your fork of [https://gitlab.com/OpenMW/openmw-dep](https://gitlab.com/OpenMW/openmw-dep) | ||
| * `GPG_PRIVATE_KEY` with private GPG key to sign commits with GPG signature (e.g. generated with `gpg --full-generate-key`). | ||
| * `GPG_PRIVATE_KEY_PASSPHRASE` a passphrase for the `GPG_PRIVATE_KEY` to make it possible to use the GPG key (e.g. the value used during `gpg --full-generate-key`). | ||
| * You can generate a gpg key with the git author information used in CI. It does not need to be associated with any account. | ||
|
|
||
| Also the following [**variable**](https://docs.github.com/en/actions/learn-github-actions/variables) has to be set: | ||
|
|
||
| * `PUSH_URL` with target SSH-based URL for `git push` command (e.g. `[email protected]:OpenMW/openmw-deps.git` or your fork). | ||
|
|
||
| Any pushes should create a branch/commit on the openmw-dep repo. However, the manifest file links will not work. You will need to create a tag/release for that to work. | ||
|
|
||
| ## Testing OpenMW with MacOS (for building on arm64 for arm64) | ||
|
|
||
| You need to install the following: `brew install autoconf autoconf-archive automake` | ||
|
|
||
| 1. `vcpkg install --overlay-ports=ports --overlay-triplets=triplets --triplet arm64-osx-dynamic` | ||
| 1. `vcpkg export --x-all-installed --raw --output vcpkg-macos-test --output-dir DIRECTORY` | ||
|
|
||
| You will need to change the variables towards the top of the OpenMW `before_script.macos.sh` file to: | ||
|
|
||
| ``` | ||
| DEPENDENCIES_ROOT_PATH="/DIRECTORY/vcpkg-macos-test" | ||
| DEPENDENCIES_INSTALLED_PATH="$DEPENDENCIES_ROOT_PATH/installed/arm64-osx-dynamic" | ||
| ``` | ||
|
|
||
| Also following [variables](https://docs.github.com/en/actions/learn-github-actions/variables) have to be set: | ||
| You will also need to change the options to: | ||
|
|
||
| * `PUSH_URL` with target SSH-based URL for `git push` command (e.g. `[email protected]:OpenMW/openmw-deps.git`). | ||
| ``` | ||
| declare -a CMAKE_CONF_OPTS=( | ||
| -D CMAKE_PREFIX_PATH="$DEPENDENCIES_INSTALLED_PATH;$QT_PATH" | ||
| -D CMAKE_C_COMPILER_LAUNCHER="ccache" | ||
| -D CMAKE_CXX_COMPILER_LAUNCHER="ccache" | ||
| -D CMAKE_CXX_FLAGS="-stdlib=libc++" | ||
| -D CMAKE_C_COMPILER="clang" | ||
| -D CMAKE_CXX_COMPILER="clang++" | ||
| -D CMAKE_OSX_DEPLOYMENT_TARGET="15.6" | ||
| -D OPENMW_USE_SYSTEM_RECASTNAVIGATION=TRUE | ||
| -D OPENMW_OSX_DEPLOYMENT=TRUE | ||
| -D collada_dom_DIR="$DEPENDENCIES_INSTALLED_PATH/share/collada-dom" | ||
| ) | ||
| ``` |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| --- myguin/CMake/Utils/MyGUIConfigTargets.bak 2023-08-07 11:39:13 | ||
| +++ myguin/CMake/Utils/MyGUIConfigTargets.cmake 2023-08-07 11:39:26 | ||
| @@ -421,15 +421,6 @@ | ||
| # add GCC visibility flags to shared library build | ||
| target_compile_options(${PROJECTNAME} PRIVATE ${MYGUI_GCC_VISIBILITY_OPTIONS}) | ||
| target_compile_definitions(${PROJECTNAME} PRIVATE ${MYGUI_GCC_VISIBILITY_DEFINITIONS}) | ||
| - if (APPLE) | ||
| - # deal with Mac OS X's framework system | ||
| - set_target_properties(${PROJECTNAME} PROPERTIES FRAMEWORK TRUE) | ||
| - set_target_properties(${PROJECTNAME} PROPERTIES PUBLIC_HEADER "${${PROJECTNAME}_HEADERS}") | ||
| - set_target_properties(${PROJECTNAME} PROPERTIES OUTPUT_NAME ${PROJECTNAME}) | ||
| - set_target_properties(${PROJECTNAME} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE) | ||
| - set_target_properties(${PROJECTNAME} PROPERTIES BUILD_WITH_INSTALL_NAME_DIR TRUE) | ||
| - set_target_properties(${PROJECTNAME} PROPERTIES INSTALL_NAME_DIR "@executable_path/../lib") | ||
| - endif (APPLE) | ||
| endif () | ||
| endif (MYGUI_STATIC) | ||
| mygui_install_target(${PROJECTNAME} "") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| vcpkg_from_github( | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One day will test if this is even needed for mac
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the patch just makes it so that MyGUI gets built as a regular library in a regular directory rather than a framework. In general, we want to upstream as many of our ports to mainline vcpkg (it's just openmw-osg being an application-specific fork that means it survived the last round of upstreaming), so if not being a framework is a good thing, we'll probably want to upstream this eventually. |
||
| OUT_SOURCE_PATH SOURCE_PATH | ||
| REPO MyGUI/mygui | ||
| REF MyGUI3.4.3 | ||
| SHA512 88c69ca2e706af364b72d425f95013eb285501881d8094f8d67e31a54c45ca11b0eb5b62c382af0d4c43f69aa8197648259ac306b72efa7ef3e25eecb9b039cb | ||
| PATCHES | ||
| "mygui.patch" | ||
| ) | ||
|
|
||
| set(CMAKE_BUILD_TYPE "Release") | ||
|
|
||
| vcpkg_cmake_configure( | ||
| SOURCE_PATH "${SOURCE_PATH}" | ||
| OPTIONS | ||
| -DMYGUI_RENDERSYSTEM=1 | ||
| -DMYGUI_BUILD_DEMOS=OFF | ||
| -DMYGUI_BUILD_TOOLS=OFF | ||
| -DMYGUI_BUILD_PLUGINS=OFF | ||
| -DMYGUI_DONT_USE_OBSOLETE=ON | ||
| ) | ||
|
|
||
| vcpkg_cmake_install() | ||
| vcpkg_fixup_pkgconfig() | ||
| file(REMOVE_RECURSE | ||
| "${CURRENT_PACKAGES_DIR}/debug/include" | ||
| "${CURRENT_PACKAGES_DIR}/debug/share" | ||
| ) | ||
| vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING.MIT") | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| { | ||
| "name": "openmw-mygui-osx", | ||
| "version": "3.4.3", | ||
| "description": "MyGUI patched/setup for Openmw on OSX", | ||
| "port-version": 1, | ||
| "homepage": "https://github.com/MyGUI/mygui", | ||
| "dependencies": [ | ||
| { | ||
| "name": "vcpkg-cmake", | ||
| "host": true | ||
| } | ||
| ] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| index b44ef8b..85c29cd 100644 | ||
| --- a/CMakeLists.txt | ||
| +++ b/CMakeLists.txt | ||
| @@ -799,6 +799,8 @@ IF(NOT ANDROID) | ||
| ENDIF() | ||
|
|
||
| ELSE() | ||
| + FIND_PACKAGE(JPEG) | ||
| + FIND_PACKAGE(PNG) | ||
| FIND_PACKAGE(TIFF) | ||
| FIND_PACKAGE(QuickTime) | ||
| FIND_PACKAGE(QTKit) | ||
| diff --git a/src/osgDB/Registry.cpp b/src/osgDB/Registry.cpp | ||
| index 14a8d04..83bacf2 100644 | ||
| --- a/src/osgDB/Registry.cpp | ||
| +++ b/src/osgDB/Registry.cpp | ||
| @@ -308,18 +308,6 @@ Registry::Registry() | ||
|
|
||
| addFileExtensionAlias("js", "V8"); | ||
|
|
||
| -#if defined(DARWIN_IMAGEIO) | ||
| - addFileExtensionAlias("jpg", "imageio"); | ||
| - addFileExtensionAlias("jpe", "imageio"); | ||
| - addFileExtensionAlias("jpeg", "imageio"); | ||
| - addFileExtensionAlias("tif", "imageio"); | ||
| - addFileExtensionAlias("tiff", "imageio"); | ||
| - addFileExtensionAlias("gif", "imageio"); | ||
| - addFileExtensionAlias("png", "imageio"); | ||
| - addFileExtensionAlias("psd", "imageio"); | ||
| - addFileExtensionAlias("tga", "imageio"); | ||
| - | ||
| -#endif | ||
|
|
||
| #if defined(USE_QTKIT) | ||
| addFileExtensionAlias("mov", "QTKit"); | ||
| diff --git a/src/osgPlugins/CMakeLists.txt b/src/osgPlugins/CMakeLists.txt | ||
| index f2ca656..dbeb39c 100644 | ||
| --- a/src/osgPlugins/CMakeLists.txt | ||
| +++ b/src/osgPlugins/CMakeLists.txt | ||
| @@ -239,8 +239,5 @@ ENDIF() | ||
| # ADD_SUBDIRECTORY(OpenAL) | ||
| # ENDIF() | ||
|
|
||
| -IF(APPLE AND NOT ANDROID) | ||
| - ADD_PLUGIN_DIRECTORY(imageio) | ||
| -ENDIF() | ||
|
|
||
| IF(AV_FOUNDATION_FOUND) | ||
| ADD_PLUGIN_DIRECTORY(avfoundation) |
Uh oh!
There was an error while loading. Please reload this page.