An open API service indexing awesome lists of open source software.

https://github.com/openmw/openmw-deps-build


https://github.com/openmw/openmw-deps-build

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

          

# openmw-deps-build

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.

[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. `git@gitlab.com: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 --host-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"
```

You will also need to change this:

```bash
if [[ "${MACOS_AMD64}" ]]; then
CMAKE_CONF_OPTS+=(
-D CMAKE_OSX_ARCHITECTURES="x86_64"
)
fi
```

to:

```bash
if [[ "${MACOS_AMD64}" ]]; then
VCPKG_TARGET_TRIPLET="x64-osx-dynamic"
CMAKE_CONF_OPTS+=(
-D CMAKE_OSX_ARCHITECTURES="x86_64"
)
else
VCPKG_TARGET_TRIPLET="arm64-osx-dynamic"
fi

DEPENDENCIES_INSTALLED_PATH="$DEPENDENCIES_ROOT_PATH/installed/$VCPKG_TARGET_TRIPLET"

CMAKE_CONF_OPTS+=(
-D CMAKE_PREFIX_PATH="$DEPENDENCIES_INSTALLED_PATH;$QT_PATH"
-D collada_dom_DIR="$DEPENDENCIES_INSTALLED_PATH/share/collada-dom"
-DVCPKG_HOST_TRIPLET="$VCPKG_TARGET_TRIPLET"
-DVCPKG_TARGET_TRIPLET="$VCPKG_TARGET_TRIPLET"
-DCMAKE_TOOLCHAIN_FILE="$DEPENDENCIES_ROOT_PATH/scripts/buildsystems/vcpkg.cmake"
)
```

And you can update the path setting to just:

```
if [[ "${MACOS_AMD64}" ]]; then
QT_PATH=$(arch -x86_64 /bin/bash -c "qmake -v | sed -rn -e 's/Using Qt version [.0-9]+ in //p'")
else
QT_PATH=$(qmake -v | sed -rn -e "s/Using Qt version [.0-9]+ in //p")
fi
```