Skip to content
Open
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
28 changes: 28 additions & 0 deletions .github/actions/vcpkg-export/action.yml
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
87 changes: 45 additions & 42 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The 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
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -186,6 +181,7 @@ jobs:
upload-deps:
needs:
- dynamic-windows
- macos

runs-on: ubuntu-latest

Expand Down Expand Up @@ -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/')
Expand Down Expand Up @@ -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 }}
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vcpkg_installed
vcpkg-*-test
50 changes: 46 additions & 4 deletions README.md
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"
)
```
18 changes: 18 additions & 0 deletions ports/openmw-mygui-osx/mygui.patch
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} "")
28 changes: 28 additions & 0 deletions ports/openmw-mygui-osx/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
vcpkg_from_github(
Copy link
Contributor Author

@ssunday ssunday Aug 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One day will test if this is even needed for mac

Copy link
Member

Choose a reason for hiding this comment

The 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")
13 changes: 13 additions & 0 deletions ports/openmw-mygui-osx/vcpkg.json
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
}
]
}
50 changes: 50 additions & 0 deletions ports/openmw-osg/macos-dedicated-image-plugin.patch
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)
24 changes: 20 additions & 4 deletions ports/openmw-osg/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,22 @@ set(VCPKG_POLICY_DLLS_WITHOUT_EXPORTS enabled)

set(OSG_VER 3.6.5)

set(PATCHES "")

if(VCPKG_TARGET_IS_OSX)
list(
APPEND PATCHES
"macos-dedicated-image-plugin.patch"
)
endif()

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO openmw/osg
REF 673f30ad3820faf2a5e901ffe403b5246b8918fe
SHA512 a75c5092f653d56ef216fd38eb84793816654bb16423bbb3b82c97d9ece98c72fcd8e30f109e5fa4563423c1b113ca1d790c5ab30803f6bfee48662d1e6ac9e8
HEAD_REF 3.6
PATCHES ${PATCHES}
)

file(REMOVE
Expand All @@ -26,9 +36,16 @@ set(OPTIONS "")
if(VCPKG_TARGET_IS_MINGW)
list(APPEND OPTIONS -D_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED=0 -D_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS=1)
elseif(VCPKG_TARGET_IS_WINDOWS)
list(APPEND OPTIONS -D_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED=1 -D_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS=0)
elseif(VCPKG_TARGET_IS_IOS)
# handled by osg
list(APPEND OPTIONS
-D_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED=1
-D_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS=0
-DPKG_CONFIG_USE_CMAKE_PREFIX_PATH=ON
)
elseif(VCPKG_TARGET_IS_OSX)
list(
APPEND OPTIONS
-DOSG_WINDOWING_SYSTEM=Cocoa
)
elseif(VCPKG_CROSSCOMPILING)
message(WARNING "Atomics detection may fail for cross builds. You can set osg cmake variables in a custom triplet.")
endif()
Expand All @@ -51,7 +68,6 @@ vcpkg_cmake_configure(
-DOPENGL_PROFILE=${osg_OPENGL_PROFILE}
-DBUILD_DASHBOARD_REPORTS=OFF
-DCMAKE_CXX_STANDARD=11
-DPKG_CONFIG_USE_CMAKE_PREFIX_PATH=ON
-DBUILD_OSG_PLUGINS_BY_DEFAULT=OFF
-DBUILD_OSG_PLUGIN_OSG=ON
-DBUILD_OSG_PLUGIN_DDS=ON
Expand Down
Loading