#TODO probably wrong script, see https://github.com/minetest/minetest/blob/master/doc/compiling/linux.md
#TODO customization - https://github.com/minetest/minetest/tree/master/doc/compiling#cmake-options
[source]
git = "https://github.com/minetest/minetest"
branch = "stable-5"
[build]
template = "custom"
dependencies = [
    "freetype2",
    "sqlite3",
    "zlib",
    "libpng",
    "libjpeg",
    "libogg",
    "libvorbis",
    "openal",
    "curl",
    "zstd",
]
script = """
git clone --depth 1 https://github.com/minetest/irrlicht.git "${COOKBOOK_SOURCE}"/lib/irrlichtmt
    COOKBOOK_CONFIGURE="cmake"
    COOKBOOK_CONFIGURE_FLAGS=(
    -DCMAKE_BUILD_TYPE=Release
    -DCMAKE_CROSSCOMPILING=True
    -DCMAKE_EXE_LINKER_FLAGS="-static"
    -DCMAKE_INSTALL_PREFIX="/"
    -DCMAKE_PREFIX_PATH="${COOKBOOK_SYSROOT}"
    -DCMAKE_SYSTEM_NAME=Generic
    -DCMAKE_SYSTEM_PROCESSOR="$(echo "${TARGET}" | cut -d - -f1)"
    -DCMAKE_VERBOSE_MAKEFILE=On
"${COOKBOOK_SOURCE}"
)
cookbook_configure
"""
