Magnum Tools #310
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Magnum Tools | |
on: [push, pull_request, workflow_dispatch] | |
# Cancel in-progress builds on push to same branch / PR | |
# https://stackoverflow.com/a/72408109 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
BASIS_VERSION: 1_15_update2 | |
ASSIMP_VERSION: 5.3.1 | |
# FFS, BEWARE, 0.20 etc without quotes gets interpreted as 0.2. Who asked for | |
# numeric support in a config language?! | |
MESHOPTIMIZER_VERSION: "0.21" | |
SDL_VERSION: 2.28.5 | |
PYBIND_VERSION: 2.11.1 | |
ZLIB_VERSION: 1.3.1 | |
ZLIBNG_VERSION: 2.1.6 | |
PNG_VERSION: 1.6.42 | |
JPEG_VERSION: 3.0.2 | |
OPENEXR_VERSION: 3.2.1 | |
SPNG_VERSION: 0.7.4 | |
WEBP_VERSION: 1.3.2 | |
GLSLANG_VERSION: 8.13.3743 | |
SPIRVTOOLS_VERSION: 2020.4 | |
ZSTD_VERSION: 1.5.5 | |
jobs: | |
ubuntu: | |
name: ${{ matrix.os }} | |
runs-on: ${{ matrix.runs-on }} | |
container: ${{ matrix.container }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-18.04 | |
runs-on: ubuntu-latest | |
container: ubuntu:bionic-20220427 | |
steps: | |
- name: Install base build tools, OpenGL and Vulkan | |
# apt update is needed to fetch package lists; software-properties-common | |
# is the add-apt-repository command (why that isn't included by | |
# default?!); libexpat1-dev and tzdata is then needed by the python debs | |
run: | | |
apt update | |
apt install -y libgl1-mesa-dev libvulkan-dev wget unzip chrpath ninja-build cmake g++ software-properties-common libexpat1-dev | |
# Installing the tzdata package ASKS FOR TIMEZONE IN THE CONSOLE?! WHO | |
# DESIGNED THIS CRAP?! https://stackoverflow.com/a/58264927 | |
DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata | |
mkdir -p deps | |
- name: Install a newer Git version from a PPA | |
# The actions/checkout FOR SOME REASON requires Git 2.18+, while 18.04 | |
# ships only with 2.17. Ultimately that means the "clones" are not | |
# actually clones, so I can't fetch version info. | |
run: | | |
add-apt-repository ppa:git-core/ppa | |
apt update | |
apt install -y git | |
- name: Fetch Python debs from the no-longer-supported deadsnakes PPA | |
# The deadsnakes PPA dropped 18.04 support in June 2023, the last 18.04 | |
# debs are downloaded from the archive and hosted | |
# https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa/+builds?build_text=&build_state=built | |
# https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa/+build/24906232 (3.9) | |
# https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa/+build/25962597 (3.10) | |
# https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa/+build/26277625 (3.11, in case it gets ever build) | |
run: | | |
mkdir python-deb && cd python-deb | |
for i in libpython3.9 libpython3.9-dev libpython3.9-minimal libpython3.9-stdlib python3.9 python3.9-dev python3.9-minimal python3.9-venv; do | |
wget https://ci.magnum.graphics/py39/${i}_3.9.16-1+bionic1_amd64.deb | |
done | |
for i in python3.9-distutils python3.9-lib2to3; do | |
wget https://ci.magnum.graphics/py39/${i}_3.9.16-1+bionic1_all.deb | |
done | |
for i in libpython3.10 libpython3.10-dev libpython3.10-minimal libpython3.10-stdlib python3.10 python3.10-dev python3.10-minimal python3.10-venv; do | |
wget https://ci.magnum.graphics/py310/${i}_3.10.11-1+bionic1_amd64.deb | |
done | |
for i in python3.10-distutils python3.10-lib2to3; do | |
wget https://ci.magnum.graphics/py310/${i}_3.10.11-1+bionic1_all.deb | |
done | |
# for i in libpython3.11 libpython3.11-dev libpython3.11-minimal libpython3.11-stdlib python3.11 python3.11-dev python3.11-minimal python3.11-venv; do | |
# wget https://ci.magnum.graphics/py311/${i}_3.11.3-1+bionic2_amd64.deb | |
# done | |
# for i in python3.11-distutils python3.11-lib2to3; do | |
# wget https://ci.magnum.graphics/py311/${i}_3.11.3-1+bionic2_all.deb | |
# done | |
dpkg -i *.deb | |
python3.9 -m ensurepip --altinstall | |
python3.10 -m ensurepip --altinstall | |
- name: Clone Corrade | |
# checkout v4 uses Node 20 which doesn't work on Ubuntu 18.04 | |
uses: actions/[email protected] | |
with: | |
repository: mosra/corrade | |
path: corrade | |
# Needed for tags :( | |
fetch-depth: 0 | |
- name: Clone Magnum | |
# checkout v4 uses Node 20 which doesn't work on Ubuntu 18.04 | |
uses: actions/[email protected] | |
with: | |
repository: mosra/magnum | |
path: magnum | |
# Needed for tags :( | |
fetch-depth: 0 | |
- name: Clone Magnum Plugins | |
# checkout v4 uses Node 20 which doesn't work on Ubuntu 18.04 | |
uses: actions/[email protected] | |
with: | |
repository: mosra/magnum-plugins | |
path: magnum-plugins | |
# Needed for tags :( | |
fetch-depth: 0 | |
- name: Clone Magnum Extras | |
# checkout v4 uses Node 20 which doesn't work on Ubuntu 18.04 | |
uses: actions/[email protected] | |
with: | |
repository: mosra/magnum-extras | |
path: magnum-extras | |
# Needed for tags :( | |
fetch-depth: 0 | |
- name: Clone Magnum Bindings | |
# checkout v4 uses Node 20 which doesn't work on Ubuntu 18.04 | |
uses: actions/[email protected] | |
with: | |
repository: mosra/magnum-bindings | |
path: magnum-bindings | |
# Needed for tags :( | |
fetch-depth: 0 | |
- name: Fetch Pybind11 | |
run: | | |
wget --no-clobber https://github.com/pybind/pybind11/archive/v${{ env.PYBIND_VERSION }}.tar.gz | |
tar -xzf v${{ env.PYBIND_VERSION }}.tar.gz | |
- name: Fetch prebuilt SDL | |
run: | | |
cd deps | |
wget https://ci.magnum.graphics/sdl-${{ env.SDL_VERSION }}-${{ matrix.os }}.zip | |
unzip sdl-${{ env.SDL_VERSION }}-${{ matrix.os }}.zip | |
- name: Fetch prebuilt meshoptimizer | |
run: | | |
cd deps | |
wget https://ci.magnum.graphics/meshoptimizer-${{ env.MESHOPTIMIZER_VERSION }}-${{ matrix.os }}.zip | |
unzip meshoptimizer-${{ env.MESHOPTIMIZER_VERSION }}-${{ matrix.os }}.zip | |
- name: Fetch prebuilt Assimp | |
run: | | |
cd deps | |
wget https://ci.magnum.graphics/assimp-${{ env.ASSIMP_VERSION }}-${{ matrix.os }}.zip | |
unzip assimp-${{ env.ASSIMP_VERSION }}-${{ matrix.os }}.zip | |
- name: Fetch prebuilt zlib | |
run: | | |
cd deps | |
wget https://ci.magnum.graphics/zlib-${{ env.ZLIB_VERSION }}-${{ matrix.os }}.zip | |
unzip zlib-${{ env.ZLIB_VERSION }}-${{ matrix.os }}.zip | |
- name: Fetch prebuilt libpng | |
run: | | |
cd deps | |
wget https://ci.magnum.graphics/libpng-${{ env.PNG_VERSION }}-${{ matrix.os }}.zip | |
unzip libpng-${{ env.PNG_VERSION }}-${{ matrix.os }}.zip | |
- name: Fetch prebuilt libjpeg-turbo | |
run: | | |
cd deps | |
wget https://ci.magnum.graphics/libjpeg-turbo-${{ env.JPEG_VERSION }}-${{ matrix.os }}.zip | |
unzip libjpeg-turbo-${{ env.JPEG_VERSION }}-${{ matrix.os }}.zip | |
- name: Fetch prebuilt openexr | |
run: | | |
cd deps | |
wget https://ci.magnum.graphics/openexr-${{ env.OPENEXR_VERSION }}-${{ matrix.os }}.zip | |
unzip openexr-${{ env.OPENEXR_VERSION }}-${{ matrix.os }}.zip | |
- name: Fetch prebuilt libwebp | |
run: | | |
cd deps | |
wget https://ci.magnum.graphics/libwebp-${{ env.WEBP_VERSION }}-${{ matrix.os }}.zip | |
unzip libwebp-${{ env.WEBP_VERSION }}-${{ matrix.os }}.zip | |
- name: Fetch prebuilt zlib-ng | |
# This is extracted ínto a subdirectory as it conflicts with zlib and is | |
# nastily patched into FindSpng | |
# TODO handle better (needs patches in libspng itself to remember if | |
# zlib-ng got used) | |
run: | | |
mkdir deps/zng && cd deps/zng | |
wget https://ci.magnum.graphics/zlib-ng-${{ env.ZLIBNG_VERSION }}-${{ matrix.os }}.zip | |
unzip zlib-ng-${{ env.ZLIBNG_VERSION }}-${{ matrix.os }}.zip | |
cd ../.. | |
sed -i "s^INTERFACE_LINK_LIBRARIES ZLIB::ZLIB)^INTERFACE_LINK_LIBRARIES $(pwd)/deps/zng/lib/libz.a)^" magnum-plugins/modules/FindSpng.cmake | |
- name: Fetch prebuilt libspng | |
run: | | |
cd deps | |
wget https://ci.magnum.graphics/libspng-${{ env.SPNG_VERSION }}-${{ matrix.os }}-zng.zip | |
unzip libspng-${{ env.SPNG_VERSION }}-${{ matrix.os }}-zng.zip | |
- name: Fetch prebuilt glslang | |
run: | | |
cd deps | |
wget https://ci.magnum.graphics/glslang-${{ env.GLSLANG_VERSION }}-${{ matrix.os }}-gcc7.zip | |
unzip glslang-${{ env.GLSLANG_VERSION }}-${{ matrix.os }}-gcc7.zip | |
- name: Fetch prebuilt SPIRV-Tools | |
run: | | |
cd deps | |
wget https://ci.magnum.graphics/spirv-tools-${{ env.SPIRVTOOLS_VERSION }}-${{ matrix.os }}-gcc7.zip | |
unzip spirv-tools-${{ env.SPIRVTOOLS_VERSION }}-${{ matrix.os }}-gcc7.zip | |
- name: Fetch prebuilt zstd | |
run: | | |
cd deps | |
wget https://ci.magnum.graphics/zstd-${{ env.ZSTD_VERSION }}-${{ matrix.os }}.zip | |
unzip zstd-${{ env.ZSTD_VERSION }}-${{ matrix.os }}.zip | |
- name: Fetch Basis Universal sources | |
run: | | |
mkdir basis-universal && cd basis-universal | |
wget https://github.com/BinomialLLC/basis_universal/archive/v${{ env.BASIS_VERSION }}.tar.gz | |
tar --strip-components 1 -xzf v${{ env.BASIS_VERSION }}.tar.gz | |
# We want to use the external Zstd instead of this | |
rm -r zstd | |
- name: Build & install Corrade | |
run: | | |
mkdir corrade-build && cd corrade-build | |
cmake ../corrade \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_INSTALL_PREFIX=$(pwd)/../install \ | |
`# https://cmake.org/cmake/help/latest/policy/CMP0095.html` \ | |
`# -DCMAKE_INSTALL_RPATH="\${ORIGIN}/../lib" -DCMAKE_POLICY_DEFAULT_CMP0095=NEW, needs 3.16` \ | |
-DCMAKE_INSTALL_RPATH="\\\${ORIGIN}/../lib" \ | |
-DCORRADE_BUILD_DEPRECATED=OFF \ | |
-DCORRADE_WITH_TESTSUITE=OFF \ | |
-DCORRADE_WITH_INTERCONNECT=ON \ | |
-G Ninja | |
ninja install/strip | |
- name: Build & install Magnum | |
run: | | |
mkdir magnum-build && cd magnum-build | |
cmake ../magnum \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_INSTALL_PREFIX=$(pwd)/../install \ | |
-DCMAKE_PREFIX_PATH=$(pwd)/../deps \ | |
`# https://cmake.org/cmake/help/latest/policy/CMP0095.html` \ | |
-DCMAKE_INSTALL_RPATH="\\\${ORIGIN}/../lib" \ | |
-DMAGNUM_BUILD_DEPRECATED=OFF \ | |
-DMAGNUM_WITH_AUDIO=OFF \ | |
-DMAGNUM_WITH_GL=ON \ | |
-DMAGNUM_WITH_DEBUGTOOLS=ON \ | |
-DMAGNUM_WITH_MESHTOOLS=ON \ | |
-DMAGNUM_WITH_PRIMITIVES=ON \ | |
-DMAGNUM_WITH_SCENEGRAPH=ON \ | |
-DMAGNUM_WITH_SCENETOOLS=ON \ | |
-DMAGNUM_WITH_SHADERS=ON \ | |
-DMAGNUM_WITH_SHADERTOOLS=ON \ | |
-DMAGNUM_WITH_TEXT=ON \ | |
-DMAGNUM_WITH_TEXTURETOOLS=ON \ | |
-DMAGNUM_WITH_TRADE=ON \ | |
-DMAGNUM_WITH_VK=ON \ | |
-DMAGNUM_WITH_SDL2APPLICATION=ON \ | |
-DMAGNUM_WITH_GL_INFO=ON \ | |
-DMAGNUM_WITH_VK_INFO=ON \ | |
-DMAGNUM_WITH_IMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_SCENECONVERTER=ON \ | |
-DMAGNUM_WITH_SHADERCONVERTER=ON \ | |
-DMAGNUM_WITH_ANYIMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_ANYIMAGEIMPORTER=ON \ | |
-DMAGNUM_WITH_ANYSCENECONVERTER=ON \ | |
-DMAGNUM_WITH_ANYSCENEIMPORTER=ON \ | |
-DMAGNUM_WITH_ANYSHADERCONVERTER=ON \ | |
-DMAGNUM_WITH_OBJIMPORTER=OFF \ | |
-DMAGNUM_WITH_TGAIMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_TGAIMPORTER=ON \ | |
-G Ninja | |
ninja install/strip | |
- name: Build & install Magnum Plugins | |
run: | | |
mkdir magnum-plugins-build && cd magnum-plugins-build | |
cmake ../magnum-plugins \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_INSTALL_PREFIX=$(pwd)/../install \ | |
-DCMAKE_PREFIX_PATH=$(pwd)/../deps \ | |
`# https://cmake.org/cmake/help/latest/policy/CMP0095.html` \ | |
`# plugins also need to look up to lib/ from lib/magnum/<interface>/` \ | |
-DCMAKE_INSTALL_RPATH="\\\${ORIGIN}/../lib;\\\${ORIGIN}/../.." \ | |
-DBASIS_UNIVERSAL_DIR=$(pwd)/../basis-universal \ | |
-DMAGNUM_WITH_ASSIMPIMPORTER=ON \ | |
-DMAGNUM_WITH_ASTCIMPORTER=ON \ | |
-DMAGNUM_WITH_BASISIMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_BASISIMPORTER=ON \ | |
-DMAGNUM_WITH_BCDECIMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_DDSIMPORTER=ON \ | |
-DMAGNUM_WITH_DEVILIMAGEIMPORTER=OFF \ | |
-DMAGNUM_WITH_ETCDECIMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_GLSLANGSHADERCONVERTER=ON \ | |
-DMAGNUM_WITH_GLTFIMPORTER=ON \ | |
-DMAGNUM_WITH_GLTFSCENECONVERTER=ON \ | |
-DMAGNUM_WITH_ICOIMPORTER=ON \ | |
-DMAGNUM_WITH_JPEGIMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_JPEGIMPORTER=ON \ | |
-DMAGNUM_WITH_KTXIMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_KTXIMPORTER=ON \ | |
-DMAGNUM_WITH_MESHOPTIMIZERSCENECONVERTER=ON \ | |
-DMAGNUM_WITH_MINIEXRIMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_OPENEXRIMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_OPENEXRIMPORTER=ON \ | |
-DMAGNUM_WITH_PNGIMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_PNGIMPORTER=ON \ | |
-DMAGNUM_WITH_PRIMITIVEIMPORTER=ON \ | |
-DMAGNUM_WITH_SPIRVTOOLSSHADERCONVERTER=ON \ | |
-DMAGNUM_WITH_SPNGIMPORTER=ON \ | |
-DMAGNUM_WITH_STANFORDIMPORTER=ON \ | |
-DMAGNUM_WITH_STANFORDSCENECONVERTER=ON \ | |
-DMAGNUM_WITH_STBDXTIMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_STBIMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_STBIMAGEIMPORTER=ON \ | |
-DMAGNUM_WITH_STBRESIZEIMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_STBTRUETYPEFONT=ON \ | |
-DMAGNUM_WITH_STLIMPORTER=ON \ | |
-DMAGNUM_WITH_UFBXIMPORTER=ON \ | |
-DMAGNUM_WITH_WEBPIMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_WEBPIMPORTER=ON \ | |
-G Ninja | |
ninja install/strip | |
# Copy also the useful gltf<->glb Python scripts | |
install ../magnum-plugins/src/MagnumPlugins/GltfImporter/Test/glb2gltf.py $(pwd)/../install/bin | |
install ../magnum-plugins/src/MagnumPlugins/GltfImporter/Test/gltf2glb.py $(pwd)/../install/bin | |
- name: Build & install Magnum Extras | |
run: | | |
mkdir magnum-extras-build && cd magnum-extras-build | |
cmake ../magnum-extras \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_INSTALL_PREFIX=$(pwd)/../install \ | |
-DCMAKE_PREFIX_PATH=$(pwd)/../deps \ | |
`# https://cmake.org/cmake/help/latest/policy/CMP0095.html` \ | |
-DCMAKE_INSTALL_RPATH="\\\${ORIGIN}/../lib" \ | |
-DMAGNUM_WITH_PLAYER=ON \ | |
-G Ninja | |
ninja install/strip | |
- name: Install Pybind11 for Python 3.10 | |
run: | | |
mkdir pybind-build-10 && cd pybind-build-10 | |
cmake ../pybind11-${{ env.PYBIND_VERSION }} \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_INSTALL_PREFIX=$(pwd)/../deps-10 \ | |
-DPYBIND11_PYTHON_VERSION=3.10 \ | |
-DPYBIND11_TEST=OFF \ | |
-G Ninja | |
ninja install/strip | |
- name: Build & install Magnum Bindings for Python 3.10 | |
run: | | |
mkdir magnum-bindings-build-10 && cd magnum-bindings-build-10 | |
cmake ../magnum-bindings \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_INSTALL_PREFIX=$(pwd)/../install \ | |
-DCMAKE_PREFIX_PATH="$(pwd)/../deps;$(pwd)/../deps-10" \ | |
`# https://cmake.org/cmake/help/latest/policy/CMP0095.html` \ | |
`# no install here (setuptools does), so no CMAKE_INSTALL_RPATH,` \ | |
`# which also means we don't need to over-escape anything` \ | |
-DCMAKE_BUILD_RPATH="\${ORIGIN}/../lib" \ | |
-DPYBIND11_PYTHON_VERSION=3.10 \ | |
-DMAGNUM_WITH_PYTHON=ON \ | |
-G Ninja | |
# We install just the version header here, the rest is done by setup.py | |
ninja install/strip | |
cd src/python | |
python3.10 setup.py install --install-lib=python --root="$(pwd)/../../../install" | |
- name: Install Pybind11 for Python 3.9 | |
run: | | |
mkdir pybind-build-9 && cd pybind-build-9 | |
cmake ../pybind11-${{ env.PYBIND_VERSION }} \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_INSTALL_PREFIX=$(pwd)/../deps-9 \ | |
-DPYBIND11_PYTHON_VERSION=3.9 \ | |
-DPYBIND11_TEST=OFF \ | |
-G Ninja | |
ninja install/strip | |
- name: Build & install Magnum Bindings for Python 3.9 | |
run: | | |
mkdir magnum-bindings-build-9 && cd magnum-bindings-build-9 | |
cmake ../magnum-bindings \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_INSTALL_PREFIX=$(pwd)/../install \ | |
-DCMAKE_PREFIX_PATH="$(pwd)/../deps;$(pwd)/../deps-9" \ | |
`# https://cmake.org/cmake/help/latest/policy/CMP0095.html` \ | |
`# no install here (setuptools does), so no CMAKE_INSTALL_RPATH,` \ | |
`# which also means we don't need to over-escape anything` \ | |
-DCMAKE_BUILD_RPATH="\${ORIGIN}/../lib" \ | |
-DPYBIND11_PYTHON_VERSION=3.9 \ | |
-DMAGNUM_WITH_PYTHON=ON \ | |
-G Ninja | |
# We install just the version header here, the rest is done by setup.py | |
ninja install/strip | |
cd src/python | |
python3.9 setup.py install --install-lib=python --root="$(pwd)/../../../install" | |
# - name: Install Pybind11 for Python 3.8 | |
# run: | | |
# mkdir pybind-build-8 && cd pybind-build-8 | |
# cmake ../pybind11-${{ env.PYBIND_VERSION }} \ | |
# -DCMAKE_BUILD_TYPE=Release \ | |
# -DCMAKE_INSTALL_PREFIX=$(pwd)/../deps-8 \ | |
# -DPYBIND11_PYTHON_VERSION=3.8 \ | |
# -DPYBIND11_TEST=OFF \ | |
# -G Ninja | |
# ninja install/strip | |
# - name: Build & install Magnum Bindings for Python 3.8 | |
# run: | | |
# mkdir magnum-bindings-build-8 && cd magnum-bindings-build-8 | |
# cmake ../magnum-bindings \ | |
# -DCMAKE_BUILD_TYPE=Release \ | |
# -DCMAKE_INSTALL_PREFIX=$(pwd)/install \ | |
# -DCMAKE_PREFIX_PATH="$(pwd)/../deps;$(pwd)/../deps-8" \ | |
# `# https://cmake.org/cmake/help/latest/policy/CMP0095.html` \ | |
# `# no install here (setuptools does), so no CMAKE_INSTALL_RPATH,` \ | |
# `# which also means we don't need to over-escape anything` \ | |
# -DCMAKE_BUILD_RPATH="\${ORIGIN}/../lib" \ | |
# -DPYBIND11_PYTHON_VERSION=3.8 \ | |
# -DMAGNUM_WITH_PYTHON=ON \ | |
# -G Ninja | |
# # We install just the version header here, the rest is done by setup.py | |
# ninja -C install/strip | |
# cd src/python | |
# python3.8 setup.py install --install-lib=python --root="$(pwd)/../../../install" | |
- name: Patch RPATH in nested Magnum Bindings modules | |
run: | | |
# https://stackoverflow.com/a/20333550 | |
# Not using patchelf as the expectation is that CMAKE_BUILD_RPATH | |
# above worked and used '$ORIGIN/../lib' for root _corrade and _magnum | |
# *.so files. | |
# TODO CMake implicitly puts the build tree into the RPATH for _corrade | |
# and _magnum, any way to remove that without patching with chrpath? | |
# CMAKE_SKIP_BUILD_RPATH together with CMAKE_BUILD_RPATH doesn't work | |
# as that skips even the explicit one. | |
chrpath -r '$ORIGIN/../../lib' install/python/corrade/*.so | |
chrpath -r '$ORIGIN/../../lib' install/python/magnum/*.so | |
chrpath -r '$ORIGIN/../../../lib' install/python/magnum/platform/*.so | |
- name: Remove includes, CMake modules, static libraries, corrade-rc, Python Egg Info | |
run: | | |
# Keep version info tho | |
mv install/include/Corrade/version.h install/versionCorrade.h | |
mv install/include/Magnum/version.h install/ | |
mv install/include/Magnum/versionPlugins.h install/ | |
mv install/include/Magnum/versionExtras.h install/ | |
mv install/include/Magnum/versionBindings.h install/ | |
rm -r install/include | |
mkdir -p install/include/Corrade | |
mv install/versionCorrade.h install/include/Corrade/version.h | |
mkdir -p install/include/Magnum | |
mv install/version*.h install/include/Magnum/ | |
rm -r install/share | |
# *.so symlinks are not needed either | |
rm -r install/lib/lib*.so | |
# everything is linked against .2 but the actual content is in .2.4, | |
# drop the symlink | |
for i in $(ls install/lib/lib*.so.2); do | |
rm $i | |
mv $i.4 $i | |
done | |
rm -r install/lib/*.a | |
rm install/bin/corrade-rc | |
# TODO can this be just not made at all? | |
rm -r install/python/*.egg-info | |
- name: Collect version info | |
# Without this it uses dash?! GITHUB ACTIONS WHY DO YOU SAY YOU PREFER | |
# BASH BY DEFAULT IF IT'S NOT TRUE?! | |
shell: bash | |
# the tag name is included only for Corrade, then the others have just N | |
# and a short hash (4 instead of 8 numbers, or at least as much to have | |
# the hash unique) | |
run: | | |
cd corrade | |
VERSION=$(git describe --match "v*" --abbrev=4) | |
echo "CORRADE_VERSION=$VERSION" >> $GITHUB_ENV | |
cd ../magnum | |
VERSION=$(git describe --match "v*" --abbrev=4) | |
echo "MAGNUM_VERSION=${VERSION:9}" >> $GITHUB_ENV | |
cd ../magnum-plugins | |
VERSION=$(git describe --match "v*" --abbrev=4) | |
echo "MAGNUM_PLUGINS_VERSION=${VERSION:9}" >> $GITHUB_ENV | |
cd ../magnum-extras | |
VERSION=$(git describe --match "v*" --abbrev=4) | |
echo "MAGNUM_EXTRAS_VERSION=${VERSION:9}" >> $GITHUB_ENV | |
cd ../magnum-bindings | |
VERSION=$(git describe --match "v*" --abbrev=4) | |
echo "MAGNUM_BINDINGS_VERSION=${VERSION:9}" >> $GITHUB_ENV | |
- name: Compress files because GitHub Actions artifact upload is beyond stupid | |
# https://github.com/actions/upload-artifact#maintaining-file-permissions-and-case-sensitive-files | |
# like, seriously, file permissions lost?! and one HTTP request *per one | |
# fucking file*?! | |
run: | | |
mv install magnum-tools-${{ env.CORRADE_VERSION }}-${{ env.MAGNUM_VERSION }}-${{ env.MAGNUM_PLUGINS_VERSION }}-${{ env.MAGNUM_EXTRAS_VERSION }}-${{ env.MAGNUM_BINDINGS_VERSION }}-linux-x64 | |
tar -cf magnum-tools-${{ env.CORRADE_VERSION }}-${{ env.MAGNUM_VERSION }}-${{ env.MAGNUM_PLUGINS_VERSION }}-${{ env.MAGNUM_EXTRAS_VERSION }}-${{ env.MAGNUM_BINDINGS_VERSION }}-linux-x64.tar magnum-tools-${{ env.CORRADE_VERSION }}-${{ env.MAGNUM_VERSION }}-${{ env.MAGNUM_PLUGINS_VERSION }}-${{ env.MAGNUM_EXTRAS_VERSION }}-${{ env.MAGNUM_BINDINGS_VERSION }}-linux-x64 | |
- name: Upload artifacts | |
# upload-artifact v4 uses Node 20 which doesn't work on Ubuntu 18.04 | |
uses: actions/[email protected] | |
with: | |
name: magnum-tools-${{ env.CORRADE_VERSION }}-${{ env.MAGNUM_VERSION }}-${{ env.MAGNUM_PLUGINS_VERSION }}-${{ env.MAGNUM_EXTRAS_VERSION }}-${{ env.MAGNUM_BINDINGS_VERSION }}-linux-x64 | |
path: magnum-tools-${{ env.CORRADE_VERSION }}-${{ env.MAGNUM_VERSION }}-${{ env.MAGNUM_PLUGINS_VERSION }}-${{ env.MAGNUM_EXTRAS_VERSION }}-${{ env.MAGNUM_BINDINGS_VERSION }}-linux-x64.tar | |
mac: | |
name: ${{ matrix.os }} | |
runs-on: ${{ matrix.runs-on }} | |
strategy: | |
matrix: | |
include: | |
- os: macos12-x64-arm64 | |
runs-on: macos-12 | |
steps: | |
- name: Install base build tools | |
run: | | |
brew install ninja | |
mkdir -p deps | |
- name: Clone Corrade | |
uses: actions/[email protected] | |
with: | |
repository: mosra/corrade | |
path: corrade | |
# Needed for tags :( | |
fetch-depth: 0 | |
- name: Clone Magnum | |
uses: actions/[email protected] | |
with: | |
repository: mosra/magnum | |
path: magnum | |
# Needed for tags :( | |
fetch-depth: 0 | |
- name: Clone Magnum Plugins | |
uses: actions/[email protected] | |
with: | |
repository: mosra/magnum-plugins | |
path: magnum-plugins | |
# Needed for tags :( | |
fetch-depth: 0 | |
- name: Fetch prebuilt meshoptimizer | |
run: | | |
cd deps | |
wget https://ci.magnum.graphics/meshoptimizer-${{ env.MESHOPTIMIZER_VERSION }}-${{ matrix.os }}.zip | |
unzip meshoptimizer-${{ env.MESHOPTIMIZER_VERSION }}-${{ matrix.os }}.zip | |
- name: Fetch Basis Universal sources | |
run: | | |
mkdir basis-universal && cd basis-universal | |
wget https://github.com/BinomialLLC/basis_universal/archive/v${{ env.BASIS_VERSION }}.tar.gz | |
tar --strip-components 1 -xzf v${{ env.BASIS_VERSION }}.tar.gz | |
- name: Build & install Corrade | |
run: | | |
mkdir corrade-build && cd corrade-build | |
cmake ../corrade \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_INSTALL_PREFIX=$(pwd)/../install \ | |
-DCMAKE_INSTALL_RPATH=@executable_path/../lib \ | |
-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \ | |
-DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" \ | |
-DCORRADE_BUILD_DEPRECATED=OFF \ | |
-DCORRADE_WITH_TESTSUITE=OFF \ | |
-DCORRADE_WITH_INTERCONNECT=OFF \ | |
-G Ninja | |
ninja install/strip | |
- name: Build & install Magnum | |
run: | | |
mkdir magnum-build && cd magnum-build | |
cmake ../magnum \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_INSTALL_PREFIX=$(pwd)/../install \ | |
-DCMAKE_PREFIX_PATH=$(pwd)/../deps \ | |
-DCMAKE_INSTALL_RPATH="@executable_path/../lib" \ | |
-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \ | |
-DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" \ | |
-DMAGNUM_BUILD_DEPRECATED=OFF \ | |
-DMAGNUM_WITH_AUDIO=OFF \ | |
-DMAGNUM_WITH_GL=ON \ | |
-DMAGNUM_WITH_DEBUGTOOLS=ON \ | |
-DMAGNUM_WITH_MESHTOOLS=ON \ | |
-DMAGNUM_WITH_PRIMITIVES=ON \ | |
-DMAGNUM_WITH_SCENEGRAPH=ON \ | |
-DMAGNUM_WITH_SCENETOOLS=ON \ | |
-DMAGNUM_WITH_SHADERS=ON \ | |
-DMAGNUM_WITH_SHADERTOOLS=ON \ | |
-DMAGNUM_WITH_TEXT=ON \ | |
-DMAGNUM_WITH_TEXTURETOOLS=ON \ | |
-DMAGNUM_WITH_TRADE=ON \ | |
-DMAGNUM_WITH_VK=OFF \ | |
-DMAGNUM_WITH_SDL2APPLICATION=OFF \ | |
-DMAGNUM_WITH_GL_INFO=ON \ | |
-DMAGNUM_WITH_VK_INFO=OFF \ | |
-DMAGNUM_WITH_IMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_SCENECONVERTER=ON \ | |
-DMAGNUM_WITH_SHADERCONVERTER=ON \ | |
-DMAGNUM_WITH_ANYIMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_ANYIMAGEIMPORTER=ON \ | |
-DMAGNUM_WITH_ANYSCENECONVERTER=ON \ | |
-DMAGNUM_WITH_ANYSCENEIMPORTER=ON \ | |
-DMAGNUM_WITH_ANYSHADERCONVERTER=ON \ | |
-DMAGNUM_WITH_OBJIMPORTER=OFF \ | |
-DMAGNUM_WITH_TGAIMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_TGAIMPORTER=ON \ | |
-G Ninja | |
ninja install/strip | |
- name: Build & install Magnum Plugins | |
run: | | |
mkdir magnum-plugins-build && cd magnum-plugins-build | |
cmake ../magnum-plugins \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_INSTALL_PREFIX=$(pwd)/../install \ | |
-DCMAKE_PREFIX_PATH=$(pwd)/../deps \ | |
`# plugins also need to look up to lib/ from lib/magnum/<interface>/` \ | |
-DCMAKE_INSTALL_RPATH="@executable_path/../lib;@executable_path/../.." \ | |
-DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" \ | |
-DCMAKE_OSX_DEPLOYMENT_TARGET="11.0" \ | |
`# otherwise x86-only zstd gets pulled in from the system, unwanted` \ | |
-DCMAKE_DISABLE_FIND_PACKAGE_Zstd=ON \ | |
-DBASIS_UNIVERSAL_DIR=$(pwd)/../basis-universal \ | |
-DMAGNUM_WITH_ASSIMPIMPORTER=OFF \ | |
-DMAGNUM_WITH_ASTCIMPORTER=ON \ | |
-DMAGNUM_WITH_BASISIMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_BASISIMPORTER=ON \ | |
-DMAGNUM_WITH_BCDECIMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_DDSIMPORTER=ON \ | |
-DMAGNUM_WITH_DEVILIMAGEIMPORTER=OFF \ | |
-DMAGNUM_WITH_ETCDECIMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_GLSLANGSHADERCONVERTER=OFF \ | |
-DMAGNUM_WITH_GLTFIMPORTER=ON \ | |
-DMAGNUM_WITH_GLTFSCENECONVERTER=ON \ | |
-DMAGNUM_WITH_ICOIMPORTER=ON \ | |
-DMAGNUM_WITH_JPEGIMAGECONVERTER=OFF \ | |
-DMAGNUM_WITH_JPEGIMPORTER=OFF \ | |
-DMAGNUM_WITH_KTXIMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_KTXIMPORTER=ON \ | |
-DMAGNUM_WITH_MESHOPTIMIZERSCENECONVERTER=ON \ | |
-DMAGNUM_WITH_MINIEXRIMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_OPENEXRIMAGECONVERTER=OFF \ | |
-DMAGNUM_WITH_OPENEXRIMPORTER=OFF \ | |
-DMAGNUM_WITH_PNGIMAGECONVERTER=OFF \ | |
-DMAGNUM_WITH_PNGIMPORTER=OFF \ | |
-DMAGNUM_WITH_PRIMITIVEIMPORTER=ON \ | |
-DMAGNUM_WITH_SPIRVTOOLSSHADERCONVERTER=OFF \ | |
-DMAGNUM_WITH_SPNGIMPORTER=OFF \ | |
-DMAGNUM_WITH_STANFORDIMPORTER=ON \ | |
-DMAGNUM_WITH_STANFORDSCENECONVERTER=ON \ | |
-DMAGNUM_WITH_STBDXTIMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_STBIMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_STBIMAGEIMPORTER=ON \ | |
-DMAGNUM_WITH_STBRESIZEIMAGECONVERTER=ON \ | |
-DMAGNUM_WITH_STBTRUETYPEFONT=ON \ | |
-DMAGNUM_WITH_STLIMPORTER=ON \ | |
-DMAGNUM_WITH_UFBXIMPORTER=ON \ | |
-DMAGNUM_WITH_WEBPIMAGECONVERTER=OFF \ | |
-DMAGNUM_WITH_WEBPIMPORTER=OFF \ | |
-G Ninja | |
ninja install/strip | |
# Copy also the useful gltf<->glb Python scripts | |
install ../magnum-plugins/src/MagnumPlugins/GltfImporter/Test/glb2gltf.py $(pwd)/../install/bin | |
install ../magnum-plugins/src/MagnumPlugins/GltfImporter/Test/gltf2glb.py $(pwd)/../install/bin | |
- name: Remove includes, CMake modules, static libraries, corrade-rc, Python Egg Info | |
run: | | |
# Keep version info tho | |
mv install/include/Corrade/version.h install/versionCorrade.h | |
mv install/include/Magnum/version.h install/ | |
mv install/include/Magnum/versionPlugins.h install/ | |
# mv install/include/Magnum/versionExtras.h install/ | |
# mv install/include/Magnum/versionBindings.h install/ | |
rm -r install/include | |
mkdir -p install/include/Corrade | |
mv install/versionCorrade.h install/include/Corrade/version.h | |
mkdir -p install/include/Magnum | |
mv install/version*.h install/include/Magnum/ | |
rm -r install/share | |
# rm -r install/lib/*.a | |
rm install/bin/corrade-rc | |
# TODO can this be just not made at all? | |
# rm -r install/python/*.egg-info | |
- name: Collect version info | |
# Without this it uses dash?! GITHUB ACTIONS WHY DO YOU SAY YOU PREFER | |
# BASH BY DEFAULT IF IT'S NOT TRUE?! | |
shell: bash | |
# the tag name is included only for Corrade, then the others have just N | |
# and a short hash (4 instead of 8 numbers, or at least as much to have | |
# the hash unique) | |
run: | | |
cd corrade | |
VERSION=$(git describe --match "v*" --abbrev=4) | |
echo "CORRADE_VERSION=$VERSION" >> $GITHUB_ENV | |
cd ../magnum | |
VERSION=$(git describe --match "v*" --abbrev=4) | |
echo "MAGNUM_VERSION=${VERSION:9}" >> $GITHUB_ENV | |
cd ../magnum-plugins | |
VERSION=$(git describe --match "v*" --abbrev=4) | |
echo "MAGNUM_PLUGINS_VERSION=${VERSION:9}" >> $GITHUB_ENV | |
# cd ../magnum-extras | |
# VERSION=$(git describe --match "v*" --abbrev=4) | |
# echo "MAGNUM_EXTRAS_VERSION=${VERSION:9}" >> $GITHUB_ENV | |
# cd ../magnum-bindings | |
# VERSION=$(git describe --match "v*" --abbrev=4) | |
# echo "MAGNUM_BINDINGS_VERSION=${VERSION:9}" >> $GITHUB_ENV | |
- name: Compress files because GitHub Actions artifact upload is beyond stupid | |
# https://github.com/actions/upload-artifact#maintaining-file-permissions-and-case-sensitive-files | |
# like, seriously, file permissions lost?! and one HTTP request *per one | |
# fucking file*?! | |
# TODO add extras + bindings version once built | |
run: | | |
mv install magnum-tools-${{ env.CORRADE_VERSION }}-${{ env.MAGNUM_VERSION }}-${{ env.MAGNUM_PLUGINS_VERSION }}-${{ matrix.os }} | |
tar -cf magnum-tools-${{ env.CORRADE_VERSION }}-${{ env.MAGNUM_VERSION }}-${{ env.MAGNUM_PLUGINS_VERSION }}-${{ matrix.os }}.tar magnum-tools-${{ env.CORRADE_VERSION }}-${{ env.MAGNUM_VERSION }}-${{ env.MAGNUM_PLUGINS_VERSION }}-${{ matrix.os }} | |
- name: Upload artifacts | |
uses: actions/[email protected] | |
# TODO add extras + bindings version once built | |
with: | |
name: magnum-tools-${{ env.CORRADE_VERSION }}-${{ env.MAGNUM_VERSION }}-${{ env.MAGNUM_PLUGINS_VERSION }}-${{ matrix.os }} | |
path: magnum-tools-${{ env.CORRADE_VERSION }}-${{ env.MAGNUM_VERSION }}-${{ env.MAGNUM_PLUGINS_VERSION }}-${{ matrix.os }}.tar | |
windows: | |
name: ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: windows-2019 | |
steps: | |
- name: Base setup | |
run: | | |
mkdir deps | |
- name: Install Ninja | |
uses: seanmiddleditch/gha-setup-ninja@v5 | |
- name: Set up Visual Studio environment | |
uses: compnerd/gha-setup-vsdevenv@v6 | |
- name: Clone Corrade | |
uses: actions/[email protected] | |
with: | |
repository: mosra/corrade | |
path: corrade | |
# Needed for tags :( | |
fetch-depth: 0 | |
- name: Clone Magnum | |
uses: actions/[email protected] | |
with: | |
repository: mosra/magnum | |
path: magnum | |
# Needed for tags :( | |
fetch-depth: 0 | |
- name: Clone Magnum Plugins | |
uses: actions/[email protected] | |
with: | |
repository: mosra/magnum-plugins | |
path: magnum-plugins | |
# Needed for tags :( | |
fetch-depth: 0 | |
- name: Clone Magnum Extras | |
uses: actions/[email protected] | |
with: | |
repository: mosra/magnum-extras | |
path: magnum-extras | |
# Needed for tags :( | |
fetch-depth: 0 | |
- name: Clone Magnum Bindings | |
uses: actions/[email protected] | |
with: | |
repository: mosra/magnum-bindings | |
path: magnum-bindings | |
# Needed for tags :( | |
fetch-depth: 0 | |
- name: Fetch Pybind11 | |
run: | | |
Invoke-WebRequest https://github.com/pybind/pybind11/archive/v${{ env.PYBIND_VERSION }}.zip -OutFile v${{ env.PYBIND_VERSION }}.zip | |
unzip v${{ env.PYBIND_VERSION }}.zip | |
- name: Fetch prebuilt SDL | |
run: | | |
Invoke-WebRequest http://www.libsdl.org/release/SDL2-devel-${{ env.SDL_VERSION }}-VC.zip -OutFile SDL2-devel-${{ env.SDL_VERSION }}-VC.zip | |
unzip SDL2-devel-${{ env.SDL_VERSION }}-VC.zip | |
ren SDL2-${{ env.SDL_VERSION }} SDL | |
- name: Fetch prebuilt meshoptimizer | |
run: | | |
cd deps | |
Invoke-WebRequest https://ci.magnum.graphics/meshoptimizer-${{ env.MESHOPTIMIZER_VERSION }}-${{ matrix.os }}.zip -OutFile meshoptimizer-${{ env.MESHOPTIMIZER_VERSION }}-${{ matrix.os }}.zip | |
unzip meshoptimizer-${{ env.MESHOPTIMIZER_VERSION }}-${{ matrix.os }}.zip | |
- name: Fetch prebuilt Assimp | |
run: | | |
cd deps | |
Invoke-WebRequest https://ci.magnum.graphics/assimp-${{ env.ASSIMP_VERSION }}-${{ matrix.os }}.zip -OutFile assimp-${{ env.ASSIMP_VERSION }}-${{ matrix.os }}.zip | |
unzip assimp-${{ env.ASSIMP_VERSION }}-${{ matrix.os }}.zip | |
- name: Fetch prebuilt zlib | |
# Zlib is present from Assimp already, overwrite | |
run: | | |
cd deps | |
Invoke-WebRequest https://ci.magnum.graphics/zlib-${{ env.ZLIB_VERSION }}-${{ matrix.os }}.zip -OutFile zlib-${{ env.ZLIB_VERSION }}-${{ matrix.os }}.zip | |
unzip -o zlib-${{ env.ZLIB_VERSION }}-${{ matrix.os }}.zip | |
- name: Fetch prebuilt libpng | |
run: | | |
cd deps | |
Invoke-WebRequest https://ci.magnum.graphics/libpng-${{ env.PNG_VERSION }}-${{ matrix.os }}.zip -OutFile libpng-${{ env.PNG_VERSION }}-${{ matrix.os }}.zip | |
unzip libpng-${{ env.PNG_VERSION }}-${{ matrix.os }}.zip | |
- name: Fetch prebuilt libjpeg-turbo | |
run: | | |
cd deps | |
Invoke-WebRequest https://ci.magnum.graphics/libjpeg-turbo-${{ env.JPEG_VERSION }}-${{ matrix.os }}.zip -OutFile libjpeg-turbo-${{ env.JPEG_VERSION }}-${{ matrix.os }}.zip | |
unzip libjpeg-turbo-${{ env.JPEG_VERSION }}-${{ matrix.os }}.zip | |
- name: Fetch prebuilt openexr | |
run: | | |
cd deps | |
Invoke-WebRequest https://ci.magnum.graphics/openexr-${{ env.OPENEXR_VERSION }}-${{ matrix.os }}.zip -OutFile openexr-${{ env.OPENEXR_VERSION }}-${{ matrix.os }}.zip | |
unzip openexr-${{ env.OPENEXR_VERSION }}-${{ matrix.os }}.zip | |
- name: Fetch prebuilt zlib-ng | |
# This is extracted ínto a subdirectory as it conflicts with zlib and is | |
# nastily patched into FindSpng | |
# TODO handle better (needs patches in libspng itself to remember if | |
# zlib-ng got used) | |
run: | | |
cd deps | |
mkdir zng | |
cd zng | |
Invoke-WebRequest https://ci.magnum.graphics/zlib-ng-${{ env.ZLIBNG_VERSION }}-${{ matrix.os }}.zip -OutFile zlib-ng-${{ env.ZLIBNG_VERSION }}-${{ matrix.os }}.zip | |
unzip zlib-ng-${{ env.ZLIBNG_VERSION }}-${{ matrix.os }}.zip | |
- name: Patch FindSpng to use zlib-ng | |
# TODO this hardcodes Actions build path (because for Bash it's /d/a | |
# instead of D:/a so can't use $(pwd)), handle better | |
shell: bash | |
# $GITHUB_WORKSPACE is with BACKSLASHES, so it has to be patched as well | |
run: | | |
sed -i "s^INTERFACE_LINK_LIBRARIES ZLIB::ZLIB)^INTERFACE_LINK_LIBRARIES ${GITHUB_WORKSPACE//\\//}/deps/zng/lib/zlibstatic.lib)^" magnum-plugins/modules/FindSpng.cmake | |
- name: Fetch prebuilt libspng | |
run: | | |
cd deps | |
Invoke-WebRequest https://ci.magnum.graphics/libspng-${{ env.SPNG_VERSION }}-${{ matrix.os }}-zng.zip -OutFile libspng-${{ env.SPNG_VERSION }}-${{ matrix.os }}-zng.zip | |
unzip libspng-${{ env.SPNG_VERSION }}-${{ matrix.os }}-zng.zip | |
- name: Fetch prebuilt zstd | |
run: | | |
cd deps | |
Invoke-WebRequest https://ci.magnum.graphics/zstd-${{ env.ZSTD_VERSION }}-${{ matrix.os }}.zip -OutFile zstd-${{ env.ZSTD_VERSION }}-${{ matrix.os }}.zip | |
unzip zstd-${{ env.ZSTD_VERSION }}-${{ matrix.os }}.zip | |
- name: Fetch Basis Universal sources | |
# Fuck me, the mess with underscores is outrageous, and WHY it has | |
# a v prefix in the filename but not in the extracted data?! | |
run: | | |
Invoke-WebRequest https://github.com/BinomialLLC/basis_universal/archive/v${{ env.BASIS_VERSION }}.zip -OutFile basis_universal-v${{ env.BASIS_VERSION }}.zip | |
unzip basis_universal-v${{ env.BASIS_VERSION }}.zip | |
ren basis_universal-${{ env.BASIS_VERSION }} basis-universal | |
# We want to use the external Zstd instead of this | |
Remove-Item -Recurse -Force basis-universal\zstd | |
- name: Fetch prebuilt libwebp | |
run: | | |
Invoke-WebRequest https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${{ env.WEBP_VERSION }}-windows-x64.zip -OutFile libwebp-${{ env.WEBP_VERSION }}-windows-x64.zip | |
unzip libwebp-${{ env.WEBP_VERSION }}-windows-x64.zip | |
ren libwebp-${{ env.WEBP_VERSION }}-windows-x64 libwebp | |
- name: Fetch prebuilt glslang | |
run: | | |
cd deps | |
Invoke-WebRequest https://ci.magnum.graphics/glslang-${{ env.GLSLANG_VERSION }}-${{ matrix.os }}.zip -OutFile glslang-${{ env.GLSLANG_VERSION }}-${{ matrix.os }}.zip | |
unzip glslang-${{ env.GLSLANG_VERSION }}-${{ matrix.os }}.zip | |
- name: Fetch prebuilt SPIRV-Tools | |
run: | | |
cd deps | |
Invoke-WebRequest https://ci.magnum.graphics/spirv-tools-${{ env.SPIRVTOOLS_VERSION }}-${{ matrix.os }}.zip -OutFile spirv-tools-${{ env.SPIRVTOOLS_VERSION }}-${{ matrix.os }}.zip | |
unzip spirv-tools-${{ env.SPIRVTOOLS_VERSION }}-${{ matrix.os }}.zip | |
- name: Build & install Corrade | |
shell: cmd | |
run: | | |
cmake ^ | |
-DCMAKE_CXX_COMPILER=cl.exe ^ | |
-DCMAKE_BUILD_TYPE=Release ^ | |
-DCMAKE_PREFIX_PATH=%CD:\=/%/deps ^ | |
-DCMAKE_INSTALL_PREFIX=%CD:\=/%/install ^ | |
-DCORRADE_BUILD_DEPRECATED=OFF ^ | |
-DCORRADE_WITH_TESTSUITE=OFF ^ | |
-DCORRADE_WITH_INTERCONNECT=ON ^ | |
-G Ninja -S corrade -B corrade-build || exit /b | |
ninja -C corrade-build install || exit /b | |
- name: Build & install Magnum | |
shell: cmd | |
run: | | |
cmake ^ | |
-DCMAKE_CXX_COMPILER=cl.exe ^ | |
-DCMAKE_BUILD_TYPE=Release ^ | |
-DCMAKE_PREFIX_PATH="%CD:\=/%/deps;%CD:\=/%/SDL" ^ | |
-DCMAKE_INSTALL_PREFIX=%CD:\=/%/install ^ | |
-DMAGNUM_BUILD_DEPRECATED=OFF ^ | |
-DMAGNUM_WITH_AUDIO=OFF ^ | |
-DMAGNUM_WITH_GL=ON ^ | |
-DMAGNUM_WITH_DEBUGTOOLS=ON ^ | |
-DMAGNUM_WITH_MESHTOOLS=ON ^ | |
-DMAGNUM_WITH_PRIMITIVES=ON ^ | |
-DMAGNUM_WITH_SCENEGRAPH=ON ^ | |
-DMAGNUM_WITH_SCENETOOLS=ON ^ | |
-DMAGNUM_WITH_SHADERS=ON ^ | |
-DMAGNUM_WITH_SHADERTOOLS=ON ^ | |
-DMAGNUM_WITH_TEXT=ON ^ | |
-DMAGNUM_WITH_TEXTURETOOLS=ON ^ | |
-DMAGNUM_WITH_TRADE=ON ^ | |
-DMAGNUM_WITH_VK=OFF ^ | |
-DMAGNUM_WITH_SDL2APPLICATION=ON ^ | |
-DMAGNUM_WITH_GL_INFO=ON ^ | |
-DMAGNUM_WITH_VK_INFO=OFF ^ | |
-DMAGNUM_WITH_IMAGECONVERTER=ON ^ | |
-DMAGNUM_WITH_SCENECONVERTER=ON ^ | |
-DMAGNUM_WITH_SHADERCONVERTER=ON ^ | |
-DMAGNUM_WITH_ANYIMAGECONVERTER=ON ^ | |
-DMAGNUM_WITH_ANYIMAGEIMPORTER=ON ^ | |
-DMAGNUM_WITH_ANYSCENECONVERTER=ON ^ | |
-DMAGNUM_WITH_ANYSCENEIMPORTER=ON ^ | |
-DMAGNUM_WITH_ANYSHADERCONVERTER=ON ^ | |
-DMAGNUM_WITH_OBJIMPORTER=OFF ^ | |
-DMAGNUM_WITH_TGAIMAGECONVERTER=ON ^ | |
-DMAGNUM_WITH_TGAIMPORTER=ON ^ | |
-G Ninja -S magnum -B magnum-build || exit /b | |
ninja -C magnum-build install || exit /b | |
- name: Build & install Magnum Plugins | |
shell: cmd | |
run: | | |
cmake ^ | |
-DCMAKE_CXX_COMPILER=cl.exe ^ | |
-DCMAKE_BUILD_TYPE=Release ^ | |
-DCMAKE_PREFIX_PATH="%CD:\=/%/deps;%CD:\=/%/libwebp" ^ | |
-DCMAKE_INSTALL_PREFIX=%CD:\=/%/install ^ | |
-DBASIS_UNIVERSAL_DIR=%CD:\=/%/basis-universal ^ | |
-DMAGNUM_WITH_ASSIMPIMPORTER=ON ^ | |
-DMAGNUM_WITH_ASTCIMPORTER=ON ^ | |
-DMAGNUM_WITH_BASISIMAGECONVERTER=ON ^ | |
-DMAGNUM_WITH_BASISIMPORTER=ON ^ | |
-DMAGNUM_WITH_BCDECIMAGECONVERTER=ON ^ | |
-DMAGNUM_WITH_DDSIMPORTER=ON ^ | |
-DMAGNUM_WITH_DEVILIMAGEIMPORTER=OFF ^ | |
-DMAGNUM_WITH_ETCDECIMAGECONVERTER=ON ^ | |
-DMAGNUM_WITH_GLSLANGSHADERCONVERTER=ON ^ | |
-DMAGNUM_WITH_GLTFIMPORTER=ON ^ | |
-DMAGNUM_WITH_GLTFSCENECONVERTER=ON ^ | |
-DMAGNUM_WITH_ICOIMPORTER=ON ^ | |
-DMAGNUM_WITH_JPEGIMAGECONVERTER=ON ^ | |
-DMAGNUM_WITH_JPEGIMPORTER=ON ^ | |
-DMAGNUM_WITH_KTXIMAGECONVERTER=ON ^ | |
-DMAGNUM_WITH_KTXIMPORTER=ON ^ | |
-DMAGNUM_WITH_MESHOPTIMIZERSCENECONVERTER=ON ^ | |
-DMAGNUM_WITH_MINIEXRIMAGECONVERTER=ON ^ | |
-DMAGNUM_WITH_OPENEXRIMAGECONVERTER=ON ^ | |
-DMAGNUM_WITH_OPENEXRIMPORTER=ON ^ | |
-DMAGNUM_WITH_PNGIMAGECONVERTER=ON ^ | |
-DMAGNUM_WITH_PNGIMPORTER=ON ^ | |
-DMAGNUM_WITH_PRIMITIVEIMPORTER=ON ^ | |
-DMAGNUM_WITH_SPIRVTOOLSSHADERCONVERTER=ON ^ | |
-DMAGNUM_WITH_SPNGIMPORTER=ON ^ | |
-DMAGNUM_WITH_STANFORDIMPORTER=ON ^ | |
-DMAGNUM_WITH_STANFORDSCENECONVERTER=ON ^ | |
-DMAGNUM_WITH_STBDXTIMAGECONVERTER=ON ^ | |
-DMAGNUM_WITH_STBIMAGECONVERTER=ON ^ | |
-DMAGNUM_WITH_STBIMAGEIMPORTER=ON ^ | |
-DMAGNUM_WITH_STBRESIZEIMAGECONVERTER=ON ^ | |
-DMAGNUM_WITH_STBTRUETYPEFONT=ON ^ | |
-DMAGNUM_WITH_STLIMPORTER=ON ^ | |
-DMAGNUM_WITH_UFBXIMPORTER=ON ^ | |
-DMAGNUM_WITH_WEBPIMAGECONVERTER=ON ^ | |
-DMAGNUM_WITH_WEBPIMPORTER=ON ^ | |
-G Ninja -S magnum-plugins -B magnum-plugins-build || exit /b | |
ninja -C magnum-plugins-build install || exit /b | |
rem Copy also the useful gltf<->glb Python scripts | |
copy magnum-plugins\src\MagnumPlugins\GltfImporter\Test\glb2gltf.py install\bin\glb2gltf.py || exit /b | |
copy magnum-plugins\src\MagnumPlugins\GltfImporter\Test\gltf2glb.py install\bin\gltf2glb.py || exit /b | |
- name: Build & install Magnum Extras | |
shell: cmd | |
run: | | |
cmake ^ | |
-DCMAKE_CXX_COMPILER=cl.exe ^ | |
-DCMAKE_BUILD_TYPE=Release ^ | |
-DCMAKE_PREFIX_PATH="%CD:\=/%/deps;%CD:\=/%/SDL" ^ | |
-DCMAKE_INSTALL_PREFIX=%CD:\=/%/install ^ | |
-DMAGNUM_WITH_PLAYER=ON ^ | |
-G Ninja -S magnum-extras -B magnum-extras-build || exit /b | |
ninja -C magnum-extras-build install || exit /b | |
- name: Setup Python 3.11 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.11' | |
- name: Install Pybind11 for Python 3.11 | |
shell: cmd | |
run: | | |
cmake ^ | |
-DCMAKE_C_COMPILER=cl.exe ^ | |
-DCMAKE_CXX_COMPILER=cl.exe ^ | |
-DCMAKE_BUILD_TYPE=Release ^ | |
-DCMAKE_INSTALL_PREFIX=%CD:\=/%/deps-11 ^ | |
-DPYBIND11_PYTHON_VERSION=3.11 ^ | |
-DPYBIND11_TEST=OFF ^ | |
-G Ninja -S pybind11-${{ env.PYBIND_VERSION }} -B pybind-build-11 || exit /b | |
ninja -C pybind-build-11 install || exit /b | |
- name: Build & install Magnum Bindings for Python 3.11 | |
shell: cmd | |
run: | | |
cmake ^ | |
-DCMAKE_CXX_COMPILER=cl.exe ^ | |
-DCMAKE_BUILD_TYPE=Release ^ | |
-DCMAKE_INSTALL_PREFIX=%CD:\=/%/install ^ | |
-DCMAKE_PREFIX_PATH="%CD:\=/%/deps;%CD:\=/%/SDL;%CD:\=/%/deps-11" ^ | |
-DPYBIND11_PYTHON_VERSION=3.11 ^ | |
-DMAGNUM_WITH_PYTHON=ON ^ | |
-G Ninja -S magnum-bindings -B magnum-bindings-build-11 || exit /b | |
rem We install just the version header here, the rest is done by setup.py | |
ninja -C magnum-bindings-build-11 install || exit /b | |
cd magnum-bindings-build-11/src/python || exit /b | |
python setup.py install --install-lib=python --root="%CD:\=/%/../../../install" || exit /b | |
- name: Copy over SDL DLL | |
shell: cmd | |
run: | | |
move SDL\lib\x64\SDL2.dll install\bin | |
- name: Remove includes, CMake modules, static libraries, corrade-rc, Python Egg Info | |
shell: cmd | |
run: | | |
rem Keep version info tho | |
move install\include\Corrade\version.h install\versionCorrade.h | |
move install\include\Magnum\version.h install\ | |
move install\include\Magnum\versionPlugins.h install\ | |
move install\include\Magnum\versionExtras.h install\ | |
move install\include\Magnum\versionBindings.h install\ | |
rmdir install\include /s /q | |
mkdir install\include | |
mkdir install\include\Corrade | |
move install\versionCorrade.h install\include\Corrade\version.h | |
mkdir install\include\Magnum | |
move install\version.h install\include\Magnum\ | |
move install\versionPlugins.h install\include\Magnum\ | |
move install\versionExtras.h install\include\Magnum\ | |
move install\versionBindings.h install\include\Magnum\ | |
rmdir install\share /s /q | |
rmdir install\lib /s /q | |
del install\bin\corrade-rc.exe | |
rem TODO can this be just not made at all? | |
rmdir install\python\magnum-0.0.0-py3.11.egg-info /s /q | |
- name: Collect version info | |
shell: bash | |
# the tag name is included only for Corrade, then the others have just N | |
# and a short hash (4 instead of 8 numbers, or at least as much to have | |
# the hash unique) | |
run: | | |
cd corrade | |
VERSION=$(git describe --match "v*" --abbrev=4) | |
echo "CORRADE_VERSION=$VERSION" >> $GITHUB_ENV | |
cd ../magnum | |
VERSION=$(git describe --match "v*" --abbrev=4) | |
echo "MAGNUM_VERSION=${VERSION:9}" >> $GITHUB_ENV | |
cd ../magnum-plugins | |
VERSION=$(git describe --match "v*" --abbrev=4) | |
echo "MAGNUM_PLUGINS_VERSION=${VERSION:9}" >> $GITHUB_ENV | |
cd ../magnum-extras | |
VERSION=$(git describe --match "v*" --abbrev=4) | |
echo "MAGNUM_EXTRAS_VERSION=${VERSION:9}" >> $GITHUB_ENV | |
cd ../magnum-bindings | |
VERSION=$(git describe --match "v*" --abbrev=4) | |
echo "MAGNUM_BINDINGS_VERSION=${VERSION:9}" >> $GITHUB_ENV | |
- name: Upload artifacts | |
uses: actions/[email protected] | |
with: | |
name: magnum-tools-${{ env.CORRADE_VERSION }}-${{ env.MAGNUM_VERSION }}-${{ env.MAGNUM_PLUGINS_VERSION }}-${{ env.MAGNUM_EXTRAS_VERSION }}-${{ env.MAGNUM_BINDINGS_VERSION }}-windows | |
path: install |