# Copyright 2022-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 PYTHON_COMPAT=( python3_{9..11} ) inherit bash-completion-r1 desktop python-any-r1 scons-utils toolchain-funcs xdg DESCRIPTION="Multi-platform 2D and 3D game engine with a feature-rich editor" HOMEPAGE="https://godotengine.org/" SRC_URI="https://downloads.tuxfamily.org/godotengine/${PV}/${P}-stable.tar.xz" S="${WORKDIR}/${P}-stable" LICENSE=" MIT Apache-2.0 BSD Boost-1.0 CC0-1.0 Unlicense ZLIB gui? ( CC-BY-4.0 ) tools? ( OFL-1.1 )" SLOT="4/mono" KEYWORDS="~amd64" # Enable roughly same as upstream by default so it works as expected, # except raycast (tools-only heavy dependency), and deprecated. IUSE=" alsa +dbus debug deprecated +fontconfig +gui pulseaudio raycast +runner speech test +theora +tools +udev +upnp +vulkan +webp +mono" # TODO: tests still need more figuring out RESTRICT="test network-sandbox" # dlopen: libglvnd RDEPEND=" app-arch/zstd:= dev-games/recastnavigation:= dev-libs/icu:= dev-libs/libpcre2:=[pcre32] media-libs/freetype[brotli,harfbuzz] media-libs/harfbuzz:=[icu] media-libs/libogg media-libs/libpng:= media-libs/libvorbis ./bin/godot.linuxbsd.editor.x86_64.main.mono-noInput chmod +x ./bin/godot.linuxbsd.editor.x86_64.main.mono-noInput ./bin/godot.linuxbsd.editor.x86_64.main.mono-noInput --headless --generate-mono-glue ./modules/mono/glue ./modules/mono/build_scripts/build_assemblies.py --godot-output-dir ./bin fi } src_test() { xdg_environment_reset bin/godot*.main --headless --test || die } src_install() { local s=godot${SLOT//\//.} if use mono; then newbin bin/godot*.main.mono ${s} if use runner && use tools; then newbin bin/godot*.runner.mono ${s}-runner else # always available, revdeps shouldn't depend on [runner] dosym ${s} /usr/bin/${s}-runner fi insinto /usr/bin/GodotSharp doins -r bin/GodotSharp/* else newbin bin/godot*.main ${s} if use runner && use tools; then newbin bin/godot*.runner ${s}-runner else # always available, revdeps shouldn't depend on [runner] dosym ${s} /usr/bin/${s}-runner fi fi newman misc/dist/linux/godot.6 ${s}.6 dodoc AUTHORS.md CHANGELOG.md DONORS.md README.md if use gui; then newicon icon.svg ${s}.svg newmenu misc/dist/linux/org.godotengine.Godot.desktop \ org.godotengine.${s^}.desktop insinto /usr/share/metainfo newins misc/dist/linux/org.godotengine.Godot.appdata.xml \ org.godotengine.${s^}.appdata.xml insinto /usr/share/mime/application newins misc/dist/linux/org.godotengine.Godot.xml \ org.godotengine.${s^}.xml fi newbashcomp misc/dist/shell/godot.bash-completion ${s} bashcomp_alias ${s}{,-runner} insinto /usr/share/fish/vendor_completions.d newins misc/dist/shell/godot.fish ${s}.fish dosym ${s}.fish /usr/share/fish/vendor_completions.d/${s}-runner.fish insinto /usr/share/zsh/site-functions newins misc/dist/shell/_godot.zsh-completion _${s} dosym _${s} /usr/share/zsh/site-functions/_${s}-runner }