Skip to content

Commit

Permalink
Add support for building vsg and vsgXchange when system dep is not av…
Browse files Browse the repository at this point in the history
…ailable (#8)

* get vsg and vsgXchange building via extern until it is available downstream

* temporarily disable unit tests until we have building vsgopenmw

* for macos, add vulkan deps via brew

* flip OPENMW_USE_SYSTEM_VSG flag to ON by default, refactor before_scripts*, add missing dither.glsl script

* add flatpak support

* fixes from upstream openmw

* workaround

* do not build any Qt stuff yet

* fixes to build on Ubuntu mantic

* comment out openmw-cs until it is ready

* remove building with osg; added necessary osg headers; enable building of launcher

* update deps; get archives

* fix macos package signing

* all this bits necessary to build on flatpak

* rename flatpak file

* make the launcher work
  • Loading branch information
psi29a authored Nov 24, 2023
1 parent 7d57d3c commit 0aceacd
Show file tree
Hide file tree
Showing 71 changed files with 8,843 additions and 509 deletions.
66 changes: 41 additions & 25 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Add OpenMW PPA Dependencies
run: sudo add-apt-repository ppa:openmw/openmw; sudo apt-get update
Expand All @@ -24,48 +24,41 @@ jobs:
run: sudo CI/install_debian_deps.sh gcc openmw-deps openmw-deps-dynamic

- name: Prime ccache
uses: hendrikmuhs/ccache-action@v1
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ matrix.os }}-${{ env.BUILD_TYPE }}
max-size: 1000M

- name: Configure
run: cmake . -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DOPENMW_USE_SYSTEM_RECASTNAVIGATION=1 -DUSE_SYSTEM_TINYXML=1 -DBUILD_UNITTESTS=1 -DCMAKE_INSTALL_PREFIX=install
run: |
cmake . -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \
-DUSE_SYSTEM_TINYXML=TRUE \
-DOPENMW_USE_SYSTEM_RECASTNAVIGATION=TRUE \
-DOPENMW_USE_SYSTEM_VSG=FALSE \
-DOPENMW_USE_SYSTEM_VSGXCHANGE=FALSE \
-DCMAKE_INSTALL_PREFIX=install \
-DBUILD_OPENCS=FALSE \
-DBUILD_BSATOOL=FALSE \
-DBUILD_LAUNCHER=FALSE \
-DBUILD_WIZARD=FALSE \
-DBUILD_ESMTOOL=FALSE \
-DBUILD_NAVMESHTOOL=FALSE \
-DBUILD_BULLETOBJECTTOOL=FALSE
- name: Build
run: make -j3

- name: Test
run: ./openmw_test_suite

# - name: Install
# shell: bash
# run: cmake --install .

# - name: Create Artifact
# shell: bash
# working-directory: install
# run: |
# ls -laR
# 7z a ../build_artifact.7z .

# - name: Upload Artifact
# uses: actions/upload-artifact@v1
# with:
# path: ./build_artifact.7z
# name: build_artifact.7z

MacOS:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install Building Dependencies
run: CI/before_install.osx.sh

- name: Prime ccache
uses: hendrikmuhs/ccache-action@v1
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ matrix.os }}-${{ env.BUILD_TYPE }}
max-size: 1000M
Expand All @@ -74,7 +67,30 @@ jobs:
run: |
rm -fr build # remove the build directory
CI/before_script.osx.sh
- name: Build
run: |
cd build
make -j $(sysctl -n hw.logicalcpu) package
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: OpenMW.dmg
path: build/OpenMW-*.dmg

Flatpak:
name: "Flatpak"
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:kde-5.15-23.08
options: --privileged

steps:
- uses: actions/checkout@v4

- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: openmw.flatpak
manifest-path: CI/org.openmw.OpenMW.devel.yaml
cache-key: flatpak-builder-${{ github.sha }}
1 change: 1 addition & 0 deletions CI/before_install.osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ command -v qmake >/dev/null 2>&1 || brew install qt@5

# Install deps
brew install icu4c yaml-cpp sqlite
brew install vulkan-headers vulkan-loader vulkan-tools vulkan-extensionlayer vulkan-validationlayers
export PATH="/usr/local/opt/qt@5/bin:$PATH" # needed to use qmake in none default path as qt now points to qt6

ccache --version
Expand Down
2 changes: 1 addition & 1 deletion CI/before_script.linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fi
if [[ $CI_OPENMW_USE_STATIC_DEPS ]]; then
CMAKE_CONF_OPTS+=(
-DOPENMW_USE_SYSTEM_MYGUI=OFF
-DOPENMW_USE_SYSTEM_OSG=OFF
-DOPENMW_USE_SYSTEM_VSG=OFF
-DOPENMW_USE_SYSTEM_BULLET=OFF
-DOPENMW_USE_SYSTEM_SQLITE3=OFF
-DOPENMW_USE_SYSTEM_RECASTNAVIGATION=OFF
Expand Down
93 changes: 0 additions & 93 deletions CI/before_script.msvc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ TEST_FRAMEWORK=""
GOOGLE_INSTALL_ROOT=""
INSTALL_PREFIX="."
BUILD_BENCHMARKS=""
OSG_MULTIVIEW_BUILD=""
USE_WERROR=""
USE_CLANG_TIDY=""

Expand Down Expand Up @@ -144,9 +143,6 @@ while [ $# -gt 0 ]; do
b )
BUILD_BENCHMARKS=true ;;

M )
OSG_MULTIVIEW_BUILD=true ;;

E )
USE_WERROR=true ;;

Expand Down Expand Up @@ -191,8 +187,6 @@ Options:
CMake install prefix
-b
Build benchmarks
-M
Use a multiview build of OSG
-E
Use warnings as errors (/WX)
-T
Expand Down Expand Up @@ -327,16 +321,6 @@ add_runtime_dlls() {
RUNTIME_DLLS[$CONFIG]="${RUNTIME_DLLS[$CONFIG]} $@"
}

declare -A OSG_PLUGINS
OSG_PLUGINS["Release"]=""
OSG_PLUGINS["Debug"]=""
OSG_PLUGINS["RelWithDebInfo"]=""
add_osg_dlls() {
local CONFIG=$1
shift
OSG_PLUGINS[$CONFIG]="${OSG_PLUGINS[$CONFIG]} $@"
}

declare -A QT_PLATFORMS
QT_PLATFORMS["Release"]=""
QT_PLATFORMS["Debug"]=""
Expand Down Expand Up @@ -373,7 +357,6 @@ case $VS_VERSION in
MSVC_VER="14.3"
MSVC_DISPLAY_YEAR="2022"

OSG_MSVC_YEAR="2019"
MYGUI_MSVC_YEAR="2019"
LUA_MSVC_YEAR="2019"
QT_MSVC_YEAR="2019"
Expand All @@ -391,7 +374,6 @@ case $VS_VERSION in
MSVC_VER="14.2"
MSVC_DISPLAY_YEAR="2019"

OSG_MSVC_YEAR="2019"
MYGUI_MSVC_YEAR="2019"
LUA_MSVC_YEAR="2019"
QT_MSVC_YEAR="2019"
Expand Down Expand Up @@ -561,16 +543,6 @@ LZ4_VER="1.9.2"
OPENAL_VER="1.23.0"
QT_VER="5.15.2"

OSG_ARCHIVE_NAME="OSGoS 3.6.5"
OSG_ARCHIVE="OSGoS-3.6.5-dd803bc-msvc${OSG_MSVC_YEAR}-win${BITS}"
OSG_ARCHIVE_REPO_URL="https://gitlab.com/OpenMW/openmw-deps/-/raw/main"
if ! [ -z $OSG_MULTIVIEW_BUILD ]; then
OSG_ARCHIVE_NAME="OSG-3.6-multiview"
OSG_ARCHIVE="OSG-3.6-multiview-d2ee5aa8-msvc${OSG_MSVC_YEAR}-win${BITS}"
OSG_ARCHIVE_REPO_URL="https://gitlab.com/madsbuvi/openmw-deps/-/raw/openmw-vr-ovr_multiview"
fi


echo
echo "==================================="
echo "Starting prebuild on MSVC${MSVC_DISPLAY_YEAR} WIN${BITS}"
Expand Down Expand Up @@ -622,17 +594,6 @@ if [ -z $SKIP_DOWNLOAD ]; then
"https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/OpenAL-Soft-${OPENAL_VER}.zip" \
"OpenAL-Soft-${OPENAL_VER}.zip"

# OSGoS
download "${OSG_ARCHIVE_NAME}" \
"${OSG_ARCHIVE_REPO_URL}/windows/${OSG_ARCHIVE}.7z" \
"${OSG_ARCHIVE}.7z"

if [ -n "$PDBS" ]; then
download "${OSG_ARCHIVE_NAME} symbols" \
"${OSG_ARCHIVE_REPO_URL}/windows/${OSG_ARCHIVE}-sym.7z" \
"${OSG_ARCHIVE}-sym.7z"
fi

# SDL2
download "SDL 2.24.0" \
"https://gitlab.com/OpenMW/openmw-deps/-/raw/main/windows/SDL2-devel-2.24.0-VC.zip" \
Expand Down Expand Up @@ -822,53 +783,6 @@ printf "OpenAL-Soft ${OPENAL_VER}... "
}
cd $DEPS
echo
printf "${OSG_ARCHIVE_NAME}... "
{
cd $DEPS_INSTALL
if [ -d OSG ] && \
grep "OPENSCENEGRAPH_MAJOR_VERSION 3" OSG/include/osg/Version > /dev/null && \
grep "OPENSCENEGRAPH_MINOR_VERSION 6" OSG/include/osg/Version > /dev/null && \
grep "OPENSCENEGRAPH_PATCH_VERSION 5" OSG/include/osg/Version > /dev/null
then
printf "Exists. "
elif [ -z $SKIP_EXTRACT ]; then
rm -rf OSG
eval 7z x -y "${DEPS}/${OSG_ARCHIVE}.7z" $STRIP
[ -n "$PDBS" ] && eval 7z x -y "${DEPS}/${OSG_ARCHIVE}-sym.7z" $STRIP
mv "${OSG_ARCHIVE}" OSG
fi
OSG_SDK="$(real_pwd)/OSG"
add_cmake_opts -DOSG_DIR="$OSG_SDK"
for CONFIGURATION in ${CONFIGURATIONS[@]}; do
if [ $CONFIGURATION == "Debug" ]; then
SUFFIX="d"
SUFFIX_UPCASE="D"
else
SUFFIX=""
SUFFIX_UPCASE=""
fi

if ! [ -z $OSG_MULTIVIEW_BUILD ]; then
add_runtime_dlls $CONFIGURATION "$(pwd)/OSG/bin/"{ot21-OpenThreads,zlib,libpng16}${SUFFIX}.dll \
"$(pwd)/OSG/bin/osg162-osg"{,Animation,DB,FX,GA,Particle,Text,Util,Viewer,Shadow,Sim}${SUFFIX}.dll
else
add_runtime_dlls $CONFIGURATION "$(pwd)/OSG/bin/"{OpenThreads,icuuc58,libpng16,zlib}${SUFFIX}.dll \
"$(pwd)/OSG/bin/libxml2"${SUFFIX_UPCASE}.dll \
"$(pwd)/OSG/bin/osg"{,Animation,DB,FX,GA,Particle,Text,Util,Viewer,Shadow,Sim}${SUFFIX}.dll
add_runtime_dlls $CONFIGURATION "$(pwd)/OSG/bin/icudt58.dll"
if [ $CONFIGURATION == "Debug" ]; then
add_runtime_dlls $CONFIGURATION "$(pwd)/OSG/bin/"{boost_filesystem-vc141-mt-gd-1_63,boost_system-vc141-mt-gd-1_63,collada-dom2.4-dp-vc141-mt-d}.dll
else
add_runtime_dlls $CONFIGURATION "$(pwd)/OSG/bin/"{boost_filesystem-vc141-mt-1_63,boost_system-vc141-mt-1_63,collada-dom2.4-dp-vc141-mt}.dll
fi
fi
add_osg_dlls $CONFIGURATION "$(pwd)/OSG/bin/osgPlugins-3.6.5/osgdb_"{bmp,dae,dds,freetype,jpeg,osg,png,tga}${SUFFIX}.dll
add_osg_dlls $CONFIGURATION "$(pwd)/OSG/bin/osgPlugins-3.6.5/osgdb_serializers_osg"{,animation,fx,ga,particle,text,util,viewer,shadow}${SUFFIX}.dll
done
echo Done.
}
cd $DEPS
echo
printf "Qt ${QT_VER}... "
{
if [ $BITS -eq 64 ]; then
Expand Down Expand Up @@ -1087,13 +1001,6 @@ fi
cp "$DLL" "${DLL_PREFIX}$TARGET"
done
echo
echo "- OSG Plugin DLLs..."
mkdir -p ${DLL_PREFIX}osgPlugins-3.6.5
for DLL in ${OSG_PLUGINS[$CONFIGURATION]}; do
echo " $(basename $DLL)."
cp "$DLL" ${DLL_PREFIX}osgPlugins-3.6.5
done
echo
echo "- Qt Platform DLLs..."
mkdir -p ${DLL_PREFIX}platforms
for DLL in ${QT_PLATFORMS[$CONFIGURATION]}; do
Expand Down
16 changes: 9 additions & 7 deletions CI/before_script.osx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ cmake \
-D CMAKE_BUILD_TYPE=RELEASE \
-D OPENMW_OSX_DEPLOYMENT=TRUE \
-D OPENMW_USE_SYSTEM_RECASTNAVIGATION=TRUE \
-D OPENMW_USE_SYSTEM_VSG=FALSE \
-D OPENMW_USE_SYSTEM_VSGXCHANGE=FALSE \
-D BUILD_OPENMW=TRUE \
-D BUILD_OPENCS=TRUE \
-D BUILD_ESMTOOL=TRUE \
-D BUILD_BSATOOL=TRUE \
-D BUILD_ESSIMPORTER=TRUE \
-D BUILD_NIFTEST=TRUE \
-D BUILD_NAVMESHTOOL=TRUE \
-D BUILD_BULLETOBJECTTOOL=TRUE \
-D BUILD_OPENCS=FALSE \
-D BUILD_ESMTOOL=FALSE \
-D BUILD_BSATOOL=FALSE \
-D BUILD_ESSIMPORTER=FALSE \
-D BUILD_NIFTEST=FALSE \
-D BUILD_NAVMESHTOOL=FALSE \
-D BUILD_BULLETOBJECTTOOL=FALSE \
-D ICU_ROOT="/usr/local/opt/icu4c" \
-G"Unix Makefiles" \
..
12 changes: 1 addition & 11 deletions CI/install_debian_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,9 @@ declare -rA GROUPED_DEPS=(
"

# These dependencies can alternatively be built and linked statically.
[openmw-deps-dynamic]="libmygui-dev libopenscenegraph-dev libsqlite3-dev libcollada-dom-dev"
[openmw-deps-dynamic]="libmygui-dev libsqlite3-dev libcollada-dom-dev"
[clang-tidy]="clang-tidy"

# Pre-requisites for building MyGUI and OSG for static linking.
#
# * MyGUI and OSG: libsdl2-dev liblz4-dev libfreetype6-dev
# * OSG: libgl-dev
#
# Plugins:
# * DAE: libcollada-dom-dev libboost-system-dev libboost-filesystem-dev
# * JPEG: libjpeg-dev
# * PNG: libpng-dev
[openmw-deps-static]="
libcollada-dom-dev libfreetype6-dev libjpeg-dev libpng-dev
libsdl2-dev libboost-system-dev libboost-filesystem-dev libgl-dev
Expand Down Expand Up @@ -64,7 +55,6 @@ declare -rA GROUPED_DEPS=(
liblz4-1
libmyguiengine3debian1v5
libopenal1
libopenscenegraph161
libpng16-16
libqt5opengl5
librecast1
Expand Down
Loading

0 comments on commit 0aceacd

Please sign in to comment.