mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-22 21:43:03 -04:00
dev-games/godot: bump to 3.3.2; enable raycast USE flag
Package-Manager: Portage-3.0.19, Repoman-3.0.3 Signed-off-by: Ross Charles Campbell <rossbridger.cc@gmail.com>
This commit is contained in:
@@ -1,2 +1 @@
|
|||||||
DIST godot-3.2.3.tar.gz 22459811 BLAKE2B fdebfc4fc4a259d52496feb2904ff1e311a8df3fd57568091b181380e28b789efd16d598df7a2331f22f182acebacb7af1f5aa88583f8b7e992be52f2f494198 SHA512 229a32f082e412f20533b781ee95a1e7a9039a6329fe3429f9a3388ba3aada311bcc49c2abecdeec7496ef039a81358009126b21daaeeb127c170b77c3def99f
|
DIST godot-3.3.2.tar.gz 29524679 BLAKE2B 1d7ee1703388d98c41524f64a99859216b060daad4502c4118adf31a95d45aa230d058630ae8735282a9b5d9f7c1ee464fb4caf9f92e3e55340370e007102f8d SHA512 3a8d187d44460ce0f28f9d26fabb30b5a9af651d9d1a1446480823885aae3ad018e32a072d4d60cf5d2c152b97759cee2172ca314c517d01cff8ddf05d91c24e
|
||||||
DIST godot-3.3.tar.gz 29430958 BLAKE2B 280b3b371c96e7a39e23f843759754e932fe4fd62b774b5d2d0d0e687fdb5dc8be7d95a18465f52d6f00456f62451115b1bf2e4afc2923ce704ffcde0f06544d SHA512 172cb23608e279c381fab00152cdf2e90b6c76401f97172031b37326789f2d8e153ef5a4c1dc4cc12cab14d04c384c576683b9edc13772e7f52b5d043f5e294d
|
|
||||||
|
|||||||
@@ -1,108 +0,0 @@
|
|||||||
commit 113b5ab1c45c01b8e6d54d13ac8876d091f883a8
|
|
||||||
Author: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
|
|
||||||
Date: Thu Feb 4 12:56:33 2021 +0100
|
|
||||||
|
|
||||||
Fix a crash in the TGA loader with malformed input
|
|
||||||
|
|
||||||
diff --git a/modules/tga/image_loader_tga.cpp b/modules/tga/image_loader_tga.cpp
|
|
||||||
index d60efdd5bc..964dc091a7 100644
|
|
||||||
--- a/modules/tga/image_loader_tga.cpp
|
|
||||||
+++ b/modules/tga/image_loader_tga.cpp
|
|
||||||
@@ -55,6 +55,10 @@ Error ImageLoaderTGA::decode_tga_rle(const uint8_t *p_compressed_buffer, size_t
|
|
||||||
compressed_pos += 1;
|
|
||||||
count = (c & 0x7f) + 1;
|
|
||||||
|
|
||||||
+ if (output_pos + count * p_pixel_size > output_pos) {
|
|
||||||
+ return ERR_PARSE_ERROR;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
if (c & 0x80) {
|
|
||||||
for (size_t i = 0; i < p_pixel_size; i++) {
|
|
||||||
pixels_w.ptr()[i] = p_compressed_buffer[compressed_pos];
|
|
||||||
@@ -78,7 +82,7 @@ Error ImageLoaderTGA::decode_tga_rle(const uint8_t *p_compressed_buffer, size_t
|
|
||||||
return OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
-Error ImageLoaderTGA::convert_to_image(Ref<Image> p_image, const uint8_t *p_buffer, const tga_header_s &p_header, const uint8_t *p_palette, const bool p_is_monochrome) {
|
|
||||||
+Error ImageLoaderTGA::convert_to_image(Ref<Image> p_image, const uint8_t *p_buffer, const tga_header_s &p_header, const uint8_t *p_palette, const bool p_is_monochrome, size_t p_output_size) {
|
|
||||||
|
|
||||||
#define TGA_PUT_PIXEL(r, g, b, a) \
|
|
||||||
int image_data_ofs = ((y * width) + x); \
|
|
||||||
@@ -130,6 +134,9 @@ Error ImageLoaderTGA::convert_to_image(Ref<Image> p_image, const uint8_t *p_buff
|
|
||||||
if (p_is_monochrome) {
|
|
||||||
while (y != y_end) {
|
|
||||||
while (x != x_end) {
|
|
||||||
+ if (i > p_output_size) {
|
|
||||||
+ return ERR_PARSE_ERROR;
|
|
||||||
+ }
|
|
||||||
uint8_t shade = p_buffer[i];
|
|
||||||
|
|
||||||
TGA_PUT_PIXEL(shade, shade, shade, 0xff)
|
|
||||||
@@ -143,6 +150,9 @@ Error ImageLoaderTGA::convert_to_image(Ref<Image> p_image, const uint8_t *p_buff
|
|
||||||
} else {
|
|
||||||
while (y != y_end) {
|
|
||||||
while (x != x_end) {
|
|
||||||
+ if (i > p_output_size) {
|
|
||||||
+ return ERR_PARSE_ERROR;
|
|
||||||
+ }
|
|
||||||
uint8_t index = p_buffer[i];
|
|
||||||
uint8_t r = 0x00;
|
|
||||||
uint8_t g = 0x00;
|
|
||||||
@@ -171,6 +181,10 @@ Error ImageLoaderTGA::convert_to_image(Ref<Image> p_image, const uint8_t *p_buff
|
|
||||||
} else if (p_header.pixel_depth == 24) {
|
|
||||||
while (y != y_end) {
|
|
||||||
while (x != x_end) {
|
|
||||||
+ if (i + 2 > p_output_size) {
|
|
||||||
+ return ERR_PARSE_ERROR;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
uint8_t r = p_buffer[i + 2];
|
|
||||||
uint8_t g = p_buffer[i + 1];
|
|
||||||
uint8_t b = p_buffer[i + 0];
|
|
||||||
@@ -186,6 +200,10 @@ Error ImageLoaderTGA::convert_to_image(Ref<Image> p_image, const uint8_t *p_buff
|
|
||||||
} else if (p_header.pixel_depth == 32) {
|
|
||||||
while (y != y_end) {
|
|
||||||
while (x != x_end) {
|
|
||||||
+ if (i + 3 > p_output_size) {
|
|
||||||
+ return ERR_PARSE_ERROR;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
uint8_t a = p_buffer[i + 3];
|
|
||||||
uint8_t r = p_buffer[i + 2];
|
|
||||||
uint8_t g = p_buffer[i + 1];
|
|
||||||
@@ -280,7 +298,7 @@ Error ImageLoaderTGA::load_image(Ref<Image> p_image, FileAccess *f, bool p_force
|
|
||||||
PoolVector<uint8_t>::Read src_image_r = src_image.read();
|
|
||||||
|
|
||||||
const size_t pixel_size = tga_header.pixel_depth >> 3;
|
|
||||||
- const size_t buffer_size = (tga_header.image_width * tga_header.image_height) * pixel_size;
|
|
||||||
+ size_t buffer_size = (tga_header.image_width * tga_header.image_height) * pixel_size;
|
|
||||||
|
|
||||||
PoolVector<uint8_t> uncompressed_buffer;
|
|
||||||
uncompressed_buffer.resize(buffer_size);
|
|
||||||
@@ -299,11 +317,12 @@ Error ImageLoaderTGA::load_image(Ref<Image> p_image, FileAccess *f, bool p_force
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
buffer = src_image_r.ptr();
|
|
||||||
+ buffer_size = src_image_len;
|
|
||||||
};
|
|
||||||
|
|
||||||
if (err == OK) {
|
|
||||||
PoolVector<uint8_t>::Read palette_r = palette.read();
|
|
||||||
- err = convert_to_image(p_image, buffer, tga_header, palette_r.ptr(), is_monochrome);
|
|
||||||
+ err = convert_to_image(p_image, buffer, tga_header, palette_r.ptr(), is_monochrome, buffer_size);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/modules/tga/image_loader_tga.h b/modules/tga/image_loader_tga.h
|
|
||||||
index 249e33411e..bbfc3fed32 100644
|
|
||||||
--- a/modules/tga/image_loader_tga.h
|
|
||||||
+++ b/modules/tga/image_loader_tga.h
|
|
||||||
@@ -73,7 +73,7 @@ class ImageLoaderTGA : public ImageFormatLoader {
|
|
||||||
uint8_t image_descriptor;
|
|
||||||
};
|
|
||||||
static Error decode_tga_rle(const uint8_t *p_compressed_buffer, size_t p_pixel_size, uint8_t *p_uncompressed_buffer, size_t p_output_size);
|
|
||||||
- static Error convert_to_image(Ref<Image> p_image, const uint8_t *p_buffer, const tga_header_s &p_header, const uint8_t *p_palette, const bool p_is_monochrome);
|
|
||||||
+ static Error convert_to_image(Ref<Image> p_image, const uint8_t *p_buffer, const tga_header_s &p_header, const uint8_t *p_palette, const bool p_is_monochrome, size_t p_output_size);
|
|
||||||
|
|
||||||
public:
|
|
||||||
virtual Error load_image(Ref<Image> p_image, FileAccess *f, bool p_force_linear, float p_scale);
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
diff --git a/SConstruct b/SConstruct
|
|
||||||
index 26019e6..f460aef 100644
|
|
||||||
--- a/SConstruct
|
|
||||||
+++ b/SConstruct
|
|
||||||
@@ -170,6 +170,8 @@ opts.Add(BoolVariable("builtin_zstd", "Use the built-in Zstd library", True))
|
|
||||||
# Compilation environment setup
|
|
||||||
opts.Add("CXX", "C++ compiler")
|
|
||||||
opts.Add("CC", "C compiler")
|
|
||||||
+opts.Add("AR", "Archiver")
|
|
||||||
+opts.Add("RANLIB", "Random Access Library Indexer")
|
|
||||||
opts.Add("LINK", "Linker")
|
|
||||||
opts.Add("CCFLAGS", "Custom flags for both the C and C++ compilers")
|
|
||||||
opts.Add("CFLAGS", "Custom flags for the C compiler")
|
|
||||||
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
|
|
||||||
index 716930d..28b1df4 100644
|
|
||||||
--- a/platform/x11/detect.py
|
|
||||||
+++ b/platform/x11/detect.py
|
|
||||||
@@ -130,7 +130,6 @@ def configure(env):
|
|
||||||
env["CXX"] = "clang++"
|
|
||||||
env["LINK"] = "clang++"
|
|
||||||
env.Append(CPPDEFINES=["TYPED_METHOD_BIND"])
|
|
||||||
- env.extra_suffix = ".llvm" + env.extra_suffix
|
|
||||||
|
|
||||||
if env["use_lld"]:
|
|
||||||
if env["use_llvm"]:
|
|
||||||
@@ -173,10 +172,6 @@ def configure(env):
|
|
||||||
env.Append(CCFLAGS=["-flto"])
|
|
||||||
env.Append(LINKFLAGS=["-flto"])
|
|
||||||
|
|
||||||
- if not env["use_llvm"]:
|
|
||||||
- env["RANLIB"] = "gcc-ranlib"
|
|
||||||
- env["AR"] = "gcc-ar"
|
|
||||||
-
|
|
||||||
env.Append(CCFLAGS=["-pipe"])
|
|
||||||
env.Append(LINKFLAGS=["-pipe"])
|
|
||||||
|
|
||||||
@@ -1,142 +0,0 @@
|
|||||||
# Copyright 1999-2021 Gentoo Authors
|
|
||||||
# Distributed under the terms of the GNU General Public License v2
|
|
||||||
|
|
||||||
EAPI=7
|
|
||||||
PYTHON_COMPAT=( python3_{7..9} )
|
|
||||||
|
|
||||||
inherit desktop python-any-r1 scons-utils xdg
|
|
||||||
|
|
||||||
DESCRIPTION="Multi-platform 2D and 3D game engine"
|
|
||||||
HOMEPAGE="https://godotengine.org"
|
|
||||||
|
|
||||||
SRC_URI="https://github.com/godotengine/${PN}/archive/${PV}-stable.tar.gz -> ${P}.tar.gz"
|
|
||||||
S="${WORKDIR}/${P}-stable"
|
|
||||||
KEYWORDS="~amd64 ~x86"
|
|
||||||
|
|
||||||
LICENSE="Apache-2.0 Boost-1.0 BSD CC-BY-3.0 MIT MPL-2.0 OFL-1.1 public-domain ZLIB"
|
|
||||||
SLOT="0/3"
|
|
||||||
IUSE="+bullet debug +enet +freetype lto +mbedtls +ogg +opus pulseaudio +theora +udev +upnp +vorbis +webp"
|
|
||||||
|
|
||||||
RDEPEND="
|
|
||||||
app-arch/lz4
|
|
||||||
app-arch/zstd
|
|
||||||
dev-libs/libpcre2[pcre32]
|
|
||||||
media-libs/alsa-lib
|
|
||||||
media-libs/libpng:0=
|
|
||||||
media-libs/libvpx
|
|
||||||
media-libs/mesa[gles2]
|
|
||||||
sys-libs/zlib
|
|
||||||
x11-libs/libX11
|
|
||||||
x11-libs/libXcursor
|
|
||||||
x11-libs/libXi
|
|
||||||
x11-libs/libXinerama
|
|
||||||
virtual/glu
|
|
||||||
virtual/opengl
|
|
||||||
bullet? ( >=sci-physics/bullet-2.89 )
|
|
||||||
enet? ( net-libs/enet:= )
|
|
||||||
freetype? ( media-libs/freetype:2 )
|
|
||||||
mbedtls? ( net-libs/mbedtls )
|
|
||||||
ogg? ( media-libs/libogg )
|
|
||||||
opus? (
|
|
||||||
media-libs/opus
|
|
||||||
media-libs/opusfile
|
|
||||||
)
|
|
||||||
pulseaudio? ( media-sound/pulseaudio )
|
|
||||||
theora? ( media-libs/libtheora )
|
|
||||||
udev? ( virtual/udev )
|
|
||||||
upnp? ( net-libs/miniupnpc )
|
|
||||||
vorbis? ( media-libs/libvorbis )
|
|
||||||
webp? ( media-libs/libwebp )
|
|
||||||
"
|
|
||||||
DEPEND="
|
|
||||||
${RDEPEND}
|
|
||||||
dev-lang/yasm
|
|
||||||
"
|
|
||||||
BDEPEND="virtual/pkgconfig"
|
|
||||||
|
|
||||||
PATCHES=(
|
|
||||||
"${FILESDIR}"/${P}-fix-llvm-build.patch
|
|
||||||
"${FILESDIR}"/${P}-fix-CVE-2021-26825.patch
|
|
||||||
)
|
|
||||||
|
|
||||||
src_prepare() {
|
|
||||||
default
|
|
||||||
rm -r thirdparty/{bullet,enet,freetype,libogg,libpng,libtheora,libvorbis,libvpx,libwebp,mbedtls,miniupnpc,opus,pcre2,zlib,zstd} || die
|
|
||||||
}
|
|
||||||
|
|
||||||
src_configure() {
|
|
||||||
myesconsargs=(
|
|
||||||
CC="$(tc-getCC)"
|
|
||||||
CXX="$(tc-getCXX)"
|
|
||||||
AR="$(tc-getAR)"
|
|
||||||
RANLIB="$(tc-getRANLIB)"
|
|
||||||
)
|
|
||||||
# Remove builtin third-party packages, link with system ones instead
|
|
||||||
myesconsargs+=(
|
|
||||||
builtin_bullet=no
|
|
||||||
builtin_enet=no
|
|
||||||
builtin_freetype=no
|
|
||||||
builtin_libogg=no
|
|
||||||
builtin_libpng=no
|
|
||||||
builtin_libtheora=no
|
|
||||||
builtin_libvorbis=no
|
|
||||||
builtin_libvpx=no
|
|
||||||
builtin_libwebp=no
|
|
||||||
builtin_mbedtls=no
|
|
||||||
builtin_miniupnpc=no
|
|
||||||
builtin_opus=no
|
|
||||||
builtin_pcre2=no
|
|
||||||
builtin_pcre2_with_jit=no
|
|
||||||
builtin_zlib=no
|
|
||||||
builtin_zstd=no
|
|
||||||
)
|
|
||||||
myesconsargs+=(
|
|
||||||
# Mono bindings requires MSBuild which is only available on Windows
|
|
||||||
module_mono_enabled=no
|
|
||||||
module_bullet_enabled=$(usex bullet)
|
|
||||||
module_enet_enabled=$(usex enet)
|
|
||||||
module_freetype_enabled=$(usex freetype)
|
|
||||||
module_mbedtls_enabled=$(usex mbedtls)
|
|
||||||
module_ogg_enabled=$(usex ogg)
|
|
||||||
module_opus_enabled=$(usex opus)
|
|
||||||
module_theora_enabled=$(usex theora)
|
|
||||||
module_upnp_enabled=$(usex upnp)
|
|
||||||
module_vorbis_enabled=$(usex vorbis)
|
|
||||||
module_webp_enabled=$(usex webp)
|
|
||||||
)
|
|
||||||
# Misc options
|
|
||||||
myesconsargs+=(
|
|
||||||
platform=x11
|
|
||||||
progress=yes
|
|
||||||
tools=yes
|
|
||||||
verbose=yes
|
|
||||||
pulseaudio=$(usex pulseaudio)
|
|
||||||
target=$(usex debug debug release_debug)
|
|
||||||
udev=$(usex udev)
|
|
||||||
use_lto=$(usex lto)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
src_compile() {
|
|
||||||
escons "${myesconsargs[@]}"
|
|
||||||
}
|
|
||||||
|
|
||||||
src_install() {
|
|
||||||
local godot_binary="${PN}.x11.opt.tools"
|
|
||||||
|
|
||||||
if [[ "${ARCH}" == "amd64" ]]; then
|
|
||||||
godot_binary="${godot_binary}.64"
|
|
||||||
elif [[ "${ARCH}" == "x86" ]]; then
|
|
||||||
godot_binary="${godot_binary}.32"
|
|
||||||
fi
|
|
||||||
|
|
||||||
newbin bin/${godot_binary} ${PN}
|
|
||||||
newicon icon.svg ${PN}.svg
|
|
||||||
doman misc/dist/linux/${PN}.6
|
|
||||||
domenu misc/dist/linux/org.godotengine.Godot.desktop
|
|
||||||
insinto /usr/share/metainfo
|
|
||||||
doins misc/dist/linux/org.godotengine.Godot.appdata.xml
|
|
||||||
insinto /usr/share/mime/application
|
|
||||||
doins misc/dist/linux/x-godot-project.xml
|
|
||||||
dodoc AUTHORS.md CHANGELOG.md DONORS.md README.md
|
|
||||||
}
|
|
||||||
@@ -15,7 +15,7 @@ KEYWORDS="~amd64 ~x86"
|
|||||||
|
|
||||||
LICENSE="Apache-2.0 Boost-1.0 BSD CC-BY-3.0 MIT MPL-2.0 OFL-1.1 public-domain ZLIB"
|
LICENSE="Apache-2.0 Boost-1.0 BSD CC-BY-3.0 MIT MPL-2.0 OFL-1.1 public-domain ZLIB"
|
||||||
SLOT="0/3"
|
SLOT="0/3"
|
||||||
IUSE="+bullet debug deprecated +enet +freetype lto +mbedtls +ogg +opus pulseaudio +theora +udev +upnp +vorbis +webp"
|
IUSE="+bullet debug deprecated +enet +freetype lto +mbedtls +ogg +opus pulseaudio raycast +theora +udev +upnp +vorbis +webp"
|
||||||
|
|
||||||
RDEPEND="
|
RDEPEND="
|
||||||
app-arch/lz4
|
app-arch/lz4
|
||||||
@@ -42,6 +42,7 @@ RDEPEND="
|
|||||||
media-libs/opusfile
|
media-libs/opusfile
|
||||||
)
|
)
|
||||||
pulseaudio? ( media-sound/pulseaudio )
|
pulseaudio? ( media-sound/pulseaudio )
|
||||||
|
raycast? ( media-libs/embree:3 )
|
||||||
theora? ( media-libs/libtheora )
|
theora? ( media-libs/libtheora )
|
||||||
udev? ( virtual/udev )
|
udev? ( virtual/udev )
|
||||||
upnp? ( net-libs/miniupnpc )
|
upnp? ( net-libs/miniupnpc )
|
||||||
@@ -93,9 +94,7 @@ src_configure() {
|
|||||||
myesconsargs+=(
|
myesconsargs+=(
|
||||||
# Mono bindings requires MSBuild which is only available on Windows
|
# Mono bindings requires MSBuild which is only available on Windows
|
||||||
module_mono_enabled=no
|
module_mono_enabled=no
|
||||||
# TODO: land embree library (https://github.com/embree/embree) in guru
|
module_raycast_enabled=$(usex raycast)
|
||||||
# so that we can enable raycast module
|
|
||||||
module_raycast_enabled=no
|
|
||||||
module_bullet_enabled=$(usex bullet)
|
module_bullet_enabled=$(usex bullet)
|
||||||
module_enet_enabled=$(usex enet)
|
module_enet_enabled=$(usex enet)
|
||||||
module_freetype_enabled=$(usex freetype)
|
module_freetype_enabled=$(usex freetype)
|
||||||
@@ -17,9 +17,10 @@ web-based (HTML5) platforms.
|
|||||||
<flag name="bullet">Enable support for <pkg>sci-physics/bullet</pkg></flag>
|
<flag name="bullet">Enable support for <pkg>sci-physics/bullet</pkg></flag>
|
||||||
<flag restrict=">=dev-games/godot-3.3.0" name="deprecated">Enable deprecated features</flag>
|
<flag restrict=">=dev-games/godot-3.3.0" name="deprecated">Enable deprecated features</flag>
|
||||||
<flag name="enet">Enable support for <pkg>net-libs/enet</pkg></flag>
|
<flag name="enet">Enable support for <pkg>net-libs/enet</pkg></flag>
|
||||||
<flag name="lto">Enable support for link time optimization</flag>
|
|
||||||
<flag name="freetype">Enable support for <pkg>media-libs/freetype</pkg></flag>
|
<flag name="freetype">Enable support for <pkg>media-libs/freetype</pkg></flag>
|
||||||
|
<flag name="lto">Enable support for link time optimization</flag>
|
||||||
<flag name="mbedtls">Enable support for <pkg>net-libs/mbedtls</pkg></flag>
|
<flag name="mbedtls">Enable support for <pkg>net-libs/mbedtls</pkg></flag>
|
||||||
|
<flag name="raycast">Enable raycast module using <pkg>media-libs/embree</pkg></flag>
|
||||||
</use>
|
</use>
|
||||||
<upstream>
|
<upstream>
|
||||||
<remote-id type="github">godotengine/godot</remote-id>
|
<remote-id type="github">godotengine/godot</remote-id>
|
||||||
|
|||||||
Reference in New Issue
Block a user