The package rpms/godot.git has added or updated architecture specific content in its spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s): https://src.fedoraproject.org/cgit/rpms/godot.git/commit/?id=9c7a9f30dfffd33....
Change: +%ifnarch x86_64
Thanks.
Full change: ============
commit 9c7a9f30dfffd331e910bc9d0fd07265fec764db Author: Rémi Verschelde rverschelde@gmail.com Date: Fri Apr 23 15:21:08 2021 +0200
Version 3.3-stable
New lightmapper (x86_64 only) uses embree (system) and oidn (bundled)
diff --git a/.gitignore b/.gitignore index 33fb29c..92f9829 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ /godot-3.2.1-stable.tar.xz.sha256 /godot-3.2.3-stable.tar.xz /godot-3.2.3-stable.tar.xz.sha256 +/godot-3.3-stable.tar.xz +/godot-3.3-stable.tar.xz.sha256 diff --git a/0001-CPU-lightmapper-environment-energy-fixes.patch b/0001-CPU-lightmapper-environment-energy-fixes.patch new file mode 100644 index 0000000..3856ec2 --- /dev/null +++ b/0001-CPU-lightmapper-environment-energy-fixes.patch @@ -0,0 +1,177 @@ +From 33d6b1f68f807e0d25430c269f4c34e134bbdfa4 Mon Sep 17 00:00:00 2001 +From: JFonS joan.fonssanchez@gmail.com +Date: Thu, 22 Apr 2021 15:01:25 +0200 +Subject: [PATCH] CPU lightmapper environment energy fixes. + +* Better handling of the scene's environment energy in the lightmapper + bakes. +* Fixed a bug where ProceduralSky::get_panorama() returned a reference + instead of a copy. +* Removed includes to Embree's internal header files. + +(cherry picked from commit 2db2d1153d2deb8490c0ca5ad0f094077f382f28) +--- + modules/raycast/lightmap_raycaster.cpp | 30 +++++++++++--------------- + scene/3d/baked_lightmap.cpp | 19 ++++++++++++---- + scene/3d/baked_lightmap.h | 2 +- + scene/resources/sky.cpp | 4 ++-- + scene/resources/sky.h | 2 +- + 5 files changed, 31 insertions(+), 26 deletions(-) + +diff --git a/modules/raycast/lightmap_raycaster.cpp b/modules/raycast/lightmap_raycaster.cpp +index 29334b7cb0..fac4385d77 100644 +--- a/modules/raycast/lightmap_raycaster.cpp ++++ b/modules/raycast/lightmap_raycaster.cpp +@@ -30,12 +30,7 @@ + + #include "lightmap_raycaster.h" + +-// From Embree. +-#include <math/vec2.h> +-#include <math/vec3.h> +-#include <xmmintrin.h> +- +-using namespace embree; ++#include <pmmintrin.h> + + LightmapRaycaster *LightmapRaycasterEmbree::create_embree_raycaster() { + return memnew(LightmapRaycasterEmbree); +@@ -135,25 +130,24 @@ void LightmapRaycasterEmbree::add_mesh(const Vector<Vector3> &p_vertices, const + + ERR_FAIL_COND(vertex_count % 3 != 0); + ERR_FAIL_COND(vertex_count != p_uv2s.size()); ++ ERR_FAIL_COND(!p_normals.empty() && vertex_count != p_normals.size()); + +- Vec3fa *embree_vertices = (Vec3fa *)rtcSetNewGeometryBuffer(embree_mesh, RTC_BUFFER_TYPE_VERTEX, 0, RTC_FORMAT_FLOAT3, sizeof(Vec3fa), vertex_count); +- Vec2fa *embree_light_uvs = (Vec2fa *)rtcSetNewGeometryBuffer(embree_mesh, RTC_BUFFER_TYPE_VERTEX_ATTRIBUTE, 0, RTC_FORMAT_FLOAT2, sizeof(Vec2fa), vertex_count); +- uint32_t *embree_triangles = (uint32_t *)rtcSetNewGeometryBuffer(embree_mesh, RTC_BUFFER_TYPE_INDEX, 0, RTC_FORMAT_UINT3, sizeof(uint32_t) * 3, vertex_count / 3); ++ Vector3 *embree_vertices = (Vector3 *)rtcSetNewGeometryBuffer(embree_mesh, RTC_BUFFER_TYPE_VERTEX, 0, RTC_FORMAT_FLOAT3, sizeof(Vector3), vertex_count); ++ copymem(embree_vertices, p_vertices.ptr(), sizeof(Vector3) * vertex_count); + +- Vec3fa *embree_normals = nullptr; +- if (!p_normals.empty()) { +- embree_normals = (Vec3fa *)rtcSetNewGeometryBuffer(embree_mesh, RTC_BUFFER_TYPE_VERTEX_ATTRIBUTE, 1, RTC_FORMAT_FLOAT3, sizeof(Vec3fa), vertex_count); +- } ++ Vector2 *embree_light_uvs = (Vector2 *)rtcSetNewGeometryBuffer(embree_mesh, RTC_BUFFER_TYPE_VERTEX_ATTRIBUTE, 0, RTC_FORMAT_FLOAT2, sizeof(Vector2), vertex_count); ++ copymem(embree_light_uvs, p_uv2s.ptr(), sizeof(Vector2) * vertex_count); + ++ uint32_t *embree_triangles = (uint32_t *)rtcSetNewGeometryBuffer(embree_mesh, RTC_BUFFER_TYPE_INDEX, 0, RTC_FORMAT_UINT3, sizeof(uint32_t) * 3, vertex_count / 3); + for (int i = 0; i < vertex_count; i++) { +- embree_vertices[i] = Vec3fa(p_vertices[i].x, p_vertices[i].y, p_vertices[i].z); +- embree_light_uvs[i] = Vec2fa(p_uv2s[i].x, p_uv2s[i].y); +- if (embree_normals != nullptr) { +- embree_normals[i] = Vec3fa(p_normals[i].x, p_normals[i].y, p_normals[i].z); +- } + embree_triangles[i] = i; + } + ++ if (!p_normals.empty()) { ++ Vector3 *embree_normals = (Vector3 *)rtcSetNewGeometryBuffer(embree_mesh, RTC_BUFFER_TYPE_VERTEX_ATTRIBUTE, 1, RTC_FORMAT_FLOAT3, sizeof(Vector3), vertex_count); ++ copymem(embree_normals, p_normals.ptr(), sizeof(Vector3) * vertex_count); ++ } ++ + rtcCommitGeometry(embree_mesh); + rtcSetGeometryIntersectFilterFunction(embree_mesh, filter_function); + rtcSetGeometryUserData(embree_mesh, this); +diff --git a/scene/3d/baked_lightmap.cpp b/scene/3d/baked_lightmap.cpp +index 67c201c3e5..af044fccdb 100644 +--- a/scene/3d/baked_lightmap.cpp ++++ b/scene/3d/baked_lightmap.cpp +@@ -810,7 +810,7 @@ BakedLightmap::BakeError BakedLightmap::bake(Node *p_from_node, String p_data_sa + } break; + case ENVIRONMENT_MODE_CUSTOM_SKY: { + if (environment_custom_sky.is_valid()) { +- environment_image = _get_irradiance_from_sky(environment_custom_sky, Vector2i(128, 64)); ++ environment_image = _get_irradiance_from_sky(environment_custom_sky, environment_custom_energy, Vector2i(128, 64)); + environment_xform.set_euler(environment_custom_sky_rotation_degrees * Math_PI / 180.0); + } + +@@ -1233,7 +1233,7 @@ void BakedLightmap::_clear_lightmaps() { + } + } + +-Ref<Image> BakedLightmap::_get_irradiance_from_sky(Ref<Sky> p_sky, Vector2i p_size) { ++Ref<Image> BakedLightmap::_get_irradiance_from_sky(Ref<Sky> p_sky, float p_energy, Vector2i p_size) { + if (p_sky.is_null()) { + return Ref<Image>(); + } +@@ -1245,7 +1245,7 @@ Ref<Image> BakedLightmap::_get_irradiance_from_sky(Ref<Sky> p_sky, Vector2i p_si + } + Ref<ProceduralSky> procedural = p_sky; + if (procedural.is_valid()) { +- sky_image = procedural->get_panorama(); ++ sky_image = procedural->get_data(); + } + + if (sky_image.is_null()) { +@@ -1254,6 +1254,17 @@ Ref<Image> BakedLightmap::_get_irradiance_from_sky(Ref<Sky> p_sky, Vector2i p_si + + sky_image->convert(Image::FORMAT_RGBF); + sky_image->resize(p_size.x, p_size.y, Image::INTERPOLATE_CUBIC); ++ ++ if (p_energy != 1.0) { ++ sky_image->lock(); ++ for (int i = 0; i < p_size.y; i++) { ++ for (int j = 0; j < p_size.x; j++) { ++ sky_image->set_pixel(j, i, sky_image->get_pixel(j, i) * p_energy); ++ } ++ } ++ sky_image->unlock(); ++ } ++ + return sky_image; + } + +@@ -1261,7 +1272,7 @@ Ref<Image> BakedLightmap::_get_irradiance_map(Ref<Environment> p_env, Vector2i p + Environment::BGMode bg_mode = p_env->get_background(); + switch (bg_mode) { + case Environment::BG_SKY: { +- return _get_irradiance_from_sky(p_env->get_sky(), Vector2i(128, 64)); ++ return _get_irradiance_from_sky(p_env->get_sky(), p_env->get_bg_energy(), Vector2i(128, 64)); + } + case Environment::BG_CLEAR_COLOR: + case Environment::BG_COLOR: { +diff --git a/scene/3d/baked_lightmap.h b/scene/3d/baked_lightmap.h +index 6f8f0b8f98..09791b5d2a 100644 +--- a/scene/3d/baked_lightmap.h ++++ b/scene/3d/baked_lightmap.h +@@ -187,7 +187,7 @@ private: + void _clear_lightmaps(); + + void _get_material_images(const MeshesFound &p_found_mesh, Lightmapper::MeshData &r_mesh_data, Vector<Ref<Texture> > &r_albedo_textures, Vector<Ref<Texture> > &r_emission_textures); +- Ref<Image> _get_irradiance_from_sky(Ref<Sky> p_sky, Vector2i p_size); ++ Ref<Image> _get_irradiance_from_sky(Ref<Sky> p_sky, float p_energy, Vector2i p_size); + Ref<Image> _get_irradiance_map(Ref<Environment> p_env, Vector2i p_size); + void _find_meshes_and_lights(Node *p_at_node, Vector<MeshesFound> &meshes, Vector<LightsFound> &lights); + Vector2i _compute_lightmap_size(const MeshesFound &p_mesh); +diff --git a/scene/resources/sky.cpp b/scene/resources/sky.cpp +index 0db92f2132..0bad4a2ed0 100644 +--- a/scene/resources/sky.cpp ++++ b/scene/resources/sky.cpp +@@ -390,8 +390,8 @@ ProceduralSky::TextureSize ProceduralSky::get_texture_size() const { + return texture_size; + } + +-Ref<Image> ProceduralSky::get_panorama() const { +- return panorama; ++Ref<Image> ProceduralSky::get_data() const { ++ return panorama->duplicate(); + } + + RID ProceduralSky::get_rid() const { +diff --git a/scene/resources/sky.h b/scene/resources/sky.h +index 5b5e6c7017..0cfd00bcda 100644 +--- a/scene/resources/sky.h ++++ b/scene/resources/sky.h +@@ -190,7 +190,7 @@ public: + void set_texture_size(TextureSize p_size); + TextureSize get_texture_size() const; + +- Ref<Image> get_panorama() const; ++ Ref<Image> get_data() const; + + virtual RID get_rid() const; + +-- +2.31.1 + diff --git a/0001-Linux-Don-t-attempt-linking-embree3-on-non-tools-lin.patch b/0001-Linux-Don-t-attempt-linking-embree3-on-non-tools-lin.patch new file mode 100644 index 0000000..d85191c --- /dev/null +++ b/0001-Linux-Don-t-attempt-linking-embree3-on-non-tools-lin.patch @@ -0,0 +1,51 @@ +From 162c78f9dca3669f84c837356730a5d33a63060b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= rverschelde@gmail.com +Date: Fri, 23 Apr 2021 10:25:51 +0200 +Subject: [PATCH] Linux: Don't attempt linking embree3 on non-tools, link it + for headless too + +`tech_debt++`, that's what we get for not taking the time to cleanup all this +and do it right... + +Follow-up to #48073 and #48102. + +(cherry picked from commit a14b51df924cbdd915f46571b396d6b9ac6e84ff) +--- + platform/server/detect.py | 7 +++++++ + platform/x11/detect.py | 2 +- + 2 files changed, 8 insertions(+), 1 deletion(-) + +diff --git a/platform/server/detect.py b/platform/server/detect.py +index 59eb3dc5cb..49fbdedd3f 100644 +--- a/platform/server/detect.py ++++ b/platform/server/detect.py +@@ -222,6 +222,13 @@ def configure(env): + if not env["builtin_pcre2"]: + env.ParseConfig("pkg-config libpcre2-32 --cflags --libs") + ++ # Embree is only compatible with x86_64. Yet another unreliable hack that will break ++ # cross-compilation, this will really need to be handle better. Thankfully only affects ++ # people who disable builtin_embree (likely distro packagers). ++ if env["tools"] and not env["builtin_embree"] and (is64 and platform.machine() == "x86_64"): ++ # No pkgconfig file so far, hardcode expected lib name. ++ env.Append(LIBS=["embree3"]) ++ + ## Flags + + # Linkflags below this line should typically stay the last ones +diff --git a/platform/x11/detect.py b/platform/x11/detect.py +index ada0669a69..1a52044150 100644 +--- a/platform/x11/detect.py ++++ b/platform/x11/detect.py +@@ -313,7 +313,7 @@ def configure(env): + # Embree is only compatible with x86_64. Yet another unreliable hack that will break + # cross-compilation, this will really need to be handle better. Thankfully only affects + # people who disable builtin_embree (likely distro packagers). +- if not env["builtin_embree"] and (is64 and platform.machine() == "x86_64"): ++ if env["tools"] and not env["builtin_embree"] and (is64 and platform.machine() == "x86_64"): + # No pkgconfig file so far, hardcode expected lib name. + env.Append(LIBS=["embree3"]) + +-- +2.31.1 + diff --git a/0001-embree-Allow-building-against-system-library-on-Linu.patch b/0001-embree-Allow-building-against-system-library-on-Linu.patch new file mode 100644 index 0000000..699f8d9 --- /dev/null +++ b/0001-embree-Allow-building-against-system-library-on-Linu.patch @@ -0,0 +1,224 @@ +From 66625962bff3b83caae324d6e9d402e2bfacc48f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= rverschelde@gmail.com +Date: Thu, 22 Apr 2021 02:03:43 +0200 +Subject: [PATCH] embree: Allow building against system library on Linux + +(cherry picked from commit b266cc2315f2d8fb1615e2c4f18558e602a7a700) +--- + SConstruct | 1 + + modules/raycast/SCsub | 165 +++++++++++++++++++++-------------------- + platform/x11/detect.py | 4 + + 3 files changed, 90 insertions(+), 80 deletions(-) + +diff --git a/SConstruct b/SConstruct +index c30f53308b..7abe58ba49 100644 +--- a/SConstruct ++++ b/SConstruct +@@ -151,6 +151,7 @@ opts.Add(BoolVariable("use_precise_math_checks", "Math checks use very precise e + # Thirdparty libraries + opts.Add(BoolVariable("builtin_bullet", "Use the built-in Bullet library", True)) + opts.Add(BoolVariable("builtin_certs", "Use the built-in SSL certificates bundles", True)) ++opts.Add(BoolVariable("builtin_embree", "Use the built-in Embree library", True)) + opts.Add(BoolVariable("builtin_enet", "Use the built-in ENet library", True)) + opts.Add(BoolVariable("builtin_freetype", "Use the built-in FreeType library", True)) + opts.Add(BoolVariable("builtin_libogg", "Use the built-in libogg library", True)) +diff --git a/modules/raycast/SCsub b/modules/raycast/SCsub +index 789d7d3251..e6808d76ba 100644 +--- a/modules/raycast/SCsub ++++ b/modules/raycast/SCsub +@@ -3,92 +3,97 @@ + Import("env") + Import("env_modules") + +-embree_src = [ +- "common/sys/sysinfo.cpp", +- "common/sys/alloc.cpp", +- "common/sys/filename.cpp", +- "common/sys/library.cpp", +- "common/sys/thread.cpp", +- "common/sys/string.cpp", +- "common/sys/regression.cpp", +- "common/sys/mutex.cpp", +- "common/sys/condition.cpp", +- "common/sys/barrier.cpp", +- "common/math/constants.cpp", +- "common/simd/sse.cpp", +- "common/lexers/stringstream.cpp", +- "common/lexers/tokenstream.cpp", +- "common/tasking/taskschedulerinternal.cpp", +- "common/algorithms/parallel_for.cpp", +- "common/algorithms/parallel_reduce.cpp", +- "common/algorithms/parallel_prefix_sum.cpp", +- "common/algorithms/parallel_for_for.cpp", +- "common/algorithms/parallel_for_for_prefix_sum.cpp", +- "common/algorithms/parallel_partition.cpp", +- "common/algorithms/parallel_sort.cpp", +- "common/algorithms/parallel_set.cpp", +- "common/algorithms/parallel_map.cpp", +- "common/algorithms/parallel_filter.cpp", +- "kernels/common/device.cpp", +- "kernels/common/stat.cpp", +- "kernels/common/acceln.cpp", +- "kernels/common/accelset.cpp", +- "kernels/common/state.cpp", +- "kernels/common/rtcore.cpp", +- "kernels/common/rtcore_builder.cpp", +- "kernels/common/scene.cpp", +- "kernels/common/alloc.cpp", +- "kernels/common/geometry.cpp", +- "kernels/common/scene_triangle_mesh.cpp", +- "kernels/geometry/primitive4.cpp", +- "kernels/builders/primrefgen.cpp", +- "kernels/bvh/bvh.cpp", +- "kernels/bvh/bvh_statistics.cpp", +- "kernels/bvh/bvh4_factory.cpp", +- "kernels/bvh/bvh8_factory.cpp", +- "kernels/bvh/bvh_collider.cpp", +- "kernels/bvh/bvh_rotate.cpp", +- "kernels/bvh/bvh_refit.cpp", +- "kernels/bvh/bvh_builder.cpp", +- "kernels/bvh/bvh_builder_morton.cpp", +- "kernels/bvh/bvh_builder_sah.cpp", +- "kernels/bvh/bvh_builder_sah_spatial.cpp", +- "kernels/bvh/bvh_builder_sah_mb.cpp", +- "kernels/bvh/bvh_builder_twolevel.cpp", +- "kernels/bvh/bvh_intersector1_bvh4.cpp", +-] ++env_raycast = env_modules.Clone() ++ ++# Thirdparty source files + +-embree_dir = "#thirdparty/embree/" ++if env["builtin_embree"]: ++ thirdparty_dir = "#thirdparty/embree/" + +-env_embree = env_modules.Clone() +-embree_sources = [embree_dir + file for file in embree_src] +-env_embree.Prepend(CPPPATH=[embree_dir, embree_dir + "include"]) +-env_embree.Append( +- CPPFLAGS=[ +- "-DEMBREE_TARGET_SSE2", +- "-DEMBREE_LOWEST_ISA", +- "-DTASKING_INTERNAL", +- "-DNDEBUG", +- "-D__SSE2__", +- "-D__SSE__", ++ embree_src = [ ++ "common/sys/sysinfo.cpp", ++ "common/sys/alloc.cpp", ++ "common/sys/filename.cpp", ++ "common/sys/library.cpp", ++ "common/sys/thread.cpp", ++ "common/sys/string.cpp", ++ "common/sys/regression.cpp", ++ "common/sys/mutex.cpp", ++ "common/sys/condition.cpp", ++ "common/sys/barrier.cpp", ++ "common/math/constants.cpp", ++ "common/simd/sse.cpp", ++ "common/lexers/stringstream.cpp", ++ "common/lexers/tokenstream.cpp", ++ "common/tasking/taskschedulerinternal.cpp", ++ "common/algorithms/parallel_for.cpp", ++ "common/algorithms/parallel_reduce.cpp", ++ "common/algorithms/parallel_prefix_sum.cpp", ++ "common/algorithms/parallel_for_for.cpp", ++ "common/algorithms/parallel_for_for_prefix_sum.cpp", ++ "common/algorithms/parallel_partition.cpp", ++ "common/algorithms/parallel_sort.cpp", ++ "common/algorithms/parallel_set.cpp", ++ "common/algorithms/parallel_map.cpp", ++ "common/algorithms/parallel_filter.cpp", ++ "kernels/common/device.cpp", ++ "kernels/common/stat.cpp", ++ "kernels/common/acceln.cpp", ++ "kernels/common/accelset.cpp", ++ "kernels/common/state.cpp", ++ "kernels/common/rtcore.cpp", ++ "kernels/common/rtcore_builder.cpp", ++ "kernels/common/scene.cpp", ++ "kernels/common/alloc.cpp", ++ "kernels/common/geometry.cpp", ++ "kernels/common/scene_triangle_mesh.cpp", ++ "kernels/geometry/primitive4.cpp", ++ "kernels/builders/primrefgen.cpp", ++ "kernels/bvh/bvh.cpp", ++ "kernels/bvh/bvh_statistics.cpp", ++ "kernels/bvh/bvh4_factory.cpp", ++ "kernels/bvh/bvh8_factory.cpp", ++ "kernels/bvh/bvh_collider.cpp", ++ "kernels/bvh/bvh_rotate.cpp", ++ "kernels/bvh/bvh_refit.cpp", ++ "kernels/bvh/bvh_builder.cpp", ++ "kernels/bvh/bvh_builder_morton.cpp", ++ "kernels/bvh/bvh_builder_sah.cpp", ++ "kernels/bvh/bvh_builder_sah_spatial.cpp", ++ "kernels/bvh/bvh_builder_sah_mb.cpp", ++ "kernels/bvh/bvh_builder_twolevel.cpp", ++ "kernels/bvh/bvh_intersector1_bvh4.cpp", + ] +-) + +-if not env_embree.msvc: +- env_embree.Append(CPPFLAGS=["-msse2", "-mxsave"]) +- if env["platform"] == "windows": +- env_embree.Append(CPPFLAGS=["-mstackrealign"]) ++ thirdparty_sources = [thirdparty_dir + file for file in embree_src] + +-if env["platform"] == "windows": +- if env.msvc: +- env.Append(LINKFLAGS=["psapi.lib"]) +- else: +- env.Append(LIBS=["psapi"]) ++ env_raycast.Prepend(CPPPATH=[thirdparty_dir, thirdparty_dir + "include"]) ++ env_raycast.Append( ++ CPPDEFINES=[ ++ "EMBREE_TARGET_SSE2", ++ "EMBREE_LOWEST_ISA", ++ "TASKING_INTERNAL", ++ "NDEBUG", ++ "__SSE2__", ++ "__SSE__", ++ ] ++ ) + +-env_embree.disable_warnings() +-env_embree.add_source_files(env.modules_sources, embree_sources) ++ if not env.msvc: ++ env_raycast.Append(CPPFLAGS=["-msse2", "-mxsave"]) ++ if env["platform"] == "windows": ++ env_raycast.Append(CPPFLAGS=["-mstackrealign"]) ++ ++ if env["platform"] == "windows": ++ if env.msvc: ++ env.Append(LINKFLAGS=["psapi.lib"]) ++ else: ++ env.Append(LIBS=["psapi"]) ++ ++ env_thirdparty = env_raycast.Clone() ++ env_thirdparty.disable_warnings() ++ env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) + +-env_raycast = env_modules.Clone() +-env_raycast.Prepend(CPPPATH=[embree_dir, embree_dir + "include", embree_dir + "common"]) + ++# Godot source files + env_raycast.add_source_files(env.modules_sources, "*.cpp") +diff --git a/platform/x11/detect.py b/platform/x11/detect.py +index ba5fb30d2e..7513bd701f 100644 +--- a/platform/x11/detect.py ++++ b/platform/x11/detect.py +@@ -310,6 +310,10 @@ def configure(env): + if not env["builtin_pcre2"]: + env.ParseConfig("pkg-config libpcre2-32 --cflags --libs") + ++ if not env["builtin_embree"]: ++ # No pkgconfig file so far, hardcode expected lib name. ++ env.Append(LIBS=["embree3"]) ++ + ## Flags + + if os.system("pkg-config --exists alsa") == 0: # 0 means found +-- +2.31.1 + diff --git a/0001-fbx-Fix-include-for-zlib-that-broke-unbundling.patch b/0001-fbx-Fix-include-for-zlib-that-broke-unbundling.patch new file mode 100644 index 0000000..3743587 --- /dev/null +++ b/0001-fbx-Fix-include-for-zlib-that-broke-unbundling.patch @@ -0,0 +1,44 @@ +From b616f41573ce56e872f73f160345da8a86504375 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= rverschelde@gmail.com +Date: Thu, 22 Apr 2021 02:18:44 +0200 +Subject: [PATCH] fbx: Fix include for zlib that broke unbundling + +It's possible to link against system zlib on Linux, so we should use system paths. + +(cherry picked from commit 93b74061387075909d1b4d29b0e5b2924e06f7d7) +--- + modules/fbx/SCsub | 3 +++ + modules/fbx/fbx_parser/FBXParser.cpp | 2 +- + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/modules/fbx/SCsub b/modules/fbx/SCsub +index 84220a66fa..0311fddfee 100644 +--- a/modules/fbx/SCsub ++++ b/modules/fbx/SCsub +@@ -8,6 +8,9 @@ env_fbx = env_modules.Clone() + # Make includes relative to the folder path specified here so our includes are clean + env_fbx.Prepend(CPPPATH=["#modules/fbx/"]) + ++if env["builtin_zlib"]: ++ env_fbx.Prepend(CPPPATH=["#thirdparty/zlib/"]) ++ + # Godot's own source files + env_fbx.add_source_files(env.modules_sources, "tools/*.cpp") + env_fbx.add_source_files(env.modules_sources, "data/*.cpp") +diff --git a/modules/fbx/fbx_parser/FBXParser.cpp b/modules/fbx/fbx_parser/FBXParser.cpp +index 0d737eb272..e9e44d94bf 100644 +--- a/modules/fbx/fbx_parser/FBXParser.cpp ++++ b/modules/fbx/fbx_parser/FBXParser.cpp +@@ -74,8 +74,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * @brief Implementation of the FBX parser and the rudimentary DOM that we use + */ + +-#include "thirdparty/zlib/zlib.h" + #include <stdlib.h> /* strtol */ ++#include <zlib.h> + + #include "ByteSwapper.h" + #include "FBXParseTools.h" +-- +2.31.1 + diff --git a/0001-lightmapper-Disable-build-if-raycast-module-can-t-bu.patch b/0001-lightmapper-Disable-build-if-raycast-module-can-t-bu.patch new file mode 100644 index 0000000..cc7ab76 --- /dev/null +++ b/0001-lightmapper-Disable-build-if-raycast-module-can-t-bu.patch @@ -0,0 +1,76 @@ +From 4e1360ac5922d3da9e2d2bcf67be22bb723efa92 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= rverschelde@gmail.com +Date: Thu, 22 Apr 2021 18:53:43 +0200 +Subject: [PATCH] lightmapper: Disable build if raycast module can't build + +We need to propagate the hacky checks from the raycast config to the +lightmapper config, as the failure of a `can_build()` check is not notified to +other modules (which might even be checked further depending on the processing +order in SConstruct). + +A more thorough fix would be to change SConstruct to do two loops on modules: +one to check `can_build()` and disable modules which can't build, then another +one to rechecked `can_build()` with the new lineup and do further config. +But there would be more risk for regressions than with this ad hoc hack. + +Similar story for the `platform/x11/detect.py` change... oh my eyes :( + +(cherry picked from commit a2c68d9da71053efa3ca7de6162aa71bc3651b92) +--- + modules/lightmapper_cpu/config.py | 25 ++++++++++++++++++++++++- + platform/x11/detect.py | 5 ++++- + 2 files changed, 28 insertions(+), 2 deletions(-) + +diff --git a/modules/lightmapper_cpu/config.py b/modules/lightmapper_cpu/config.py +index d01c1726dd..0b8837aa4e 100644 +--- a/modules/lightmapper_cpu/config.py ++++ b/modules/lightmapper_cpu/config.py +@@ -1,5 +1,28 @@ + def can_build(env, platform): +- return env["tools"] and env["module_raycast_enabled"] ++ if not env["tools"] or not env["module_raycast_enabled"]: ++ return False ++ ++ # Depends on raycast module (embree), but we can't have access to the result of ++ # `can_build()` for that module, so we need to duplicate that code as a short-term ++ # solution. ++ ++ # Embree requires at least SSE2 to be available, so 32-bit and ARM64 builds are ++ # not supported. ++ # It's also only relevant for tools build and desktop platforms, ++ # as doing lightmap generation on Android or HTML5 would be a bit far-fetched. ++ supported_platform = platform in ["x11", "osx", "windows", "server"] ++ supported_bits = env["bits"] == "64" ++ supported_arch = env["arch"] != "arm64" ++ ++ # Hack to disable on Linux arm64. This won't work well for cross-compilation (checks ++ # host, not target) and would need a more thorough fix by refactoring our arch and ++ # bits-handling code. ++ from platform import machine ++ ++ if platform == "x11" and machine() != "x86_64": ++ supported_arch = False ++ ++ return supported_platform and supported_bits and supported_arch + + + def configure(env): +diff --git a/platform/x11/detect.py b/platform/x11/detect.py +index 7513bd701f..ada0669a69 100644 +--- a/platform/x11/detect.py ++++ b/platform/x11/detect.py +@@ -310,7 +310,10 @@ def configure(env): + if not env["builtin_pcre2"]: + env.ParseConfig("pkg-config libpcre2-32 --cflags --libs") + +- if not env["builtin_embree"]: ++ # Embree is only compatible with x86_64. Yet another unreliable hack that will break ++ # cross-compilation, this will really need to be handle better. Thankfully only affects ++ # people who disable builtin_embree (likely distro packagers). ++ if not env["builtin_embree"] and (is64 and platform.machine() == "x86_64"): + # No pkgconfig file so far, hardcode expected lib name. + env.Append(LIBS=["embree3"]) + +-- +2.31.1 + diff --git a/godot-pr45702-Fix-crash-TGA-loader.patch b/godot-pr45702-Fix-crash-TGA-loader.patch deleted file mode 100644 index b9de555..0000000 --- a/godot-pr45702-Fix-crash-TGA-loader.patch +++ /dev/null @@ -1,112 +0,0 @@ -From 113b5ab1c45c01b8e6d54d13ac8876d091f883a8 Mon Sep 17 00:00:00 2001 -From: Hein-Pieter van Braam-Stewart hp@tmm.cx -Date: Thu, 4 Feb 2021 12:56:33 +0100 -Subject: [PATCH] Fix a crash in the TGA loader with malformed input - ---- - modules/tga/image_loader_tga.cpp | 25 ++++++++++++++++++++++--- - modules/tga/image_loader_tga.h | 2 +- - 2 files changed, 23 insertions(+), 4 deletions(-) - -diff --git a/modules/tga/image_loader_tga.cpp b/modules/tga/image_loader_tga.cpp -index d60efdd5bcc..964dc091a7d 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 249e33411e7..bbfc3fed329 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); diff --git a/godot.spec b/godot.spec index 2e03479..effb076 100644 --- a/godot.spec +++ b/godot.spec @@ -11,8 +11,8 @@ %define rdnsname org.godotengine.Godot
Name: godot -Version: 3.2.3 -Release: %{?prerel:0.%{status}.}2%{?dist} +Version: 3.3 +Release: %{?prerel:0.%{status}.}1%{?dist} Summary: Multi-platform 2D and 3D game engine with a feature-rich editor %if 0%{?mageia} Group: Development/Tools @@ -22,8 +22,13 @@ License: MIT and CC-BY and ASL 2.0 and BSD and zlib and OFL and Bitstream URL: https://godotengine.org Source0: https://downloads.tuxfamily.org/godotengine/%%7Bversion%7D/%%7B?prerel:%%7Bs... Source1: https://downloads.tuxfamily.org/godotengine/%%7Bversion%7D/%%7B?prerel:%%7Bs... -# Security fix: https://github.com/godotengine/godot/pull/45702 -Patch0: godot-pr45702-Fix-crash-TGA-loader.patch +# Backport from 3.3 branch to fix unbundling zlib in new fbx parser. +Patch0: 0001-fbx-Fix-include-for-zlib-that-broke-unbundling.patch +# Backports from 3.3 branch to allow (and fix) unbundling embree. +Patch1: 0001-CPU-lightmapper-environment-energy-fixes.patch +Patch2: 0001-embree-Allow-building-against-system-library-on-Linu.patch +Patch3: 0001-lightmapper-Disable-build-if-raycast-module-can-t-bu.patch +Patch4: 0001-Linux-Don-t-attempt-linking-embree3-on-non-tools-lin.patch
# Upstream does not support those arches (for now) ExcludeArch: ppc64 ppc64le s390x @@ -70,6 +75,11 @@ BuildRequires: scons BuildRequires: python3-scons %endif
+# Embree is x86_64 only, Godot's buildsystem handles that properly. +%ifarch x86_64 +BuildRequires: embree-devel +%endif + # For desktop and appdata files validation %if 0%{?mageia} BuildRequires: appstream-util @@ -87,12 +97,6 @@ Requires: hicolor-icon-theme # though that the `thirdparty` folder also contains code which is typically # not packaged in distros, and is probably best left bundled.
-# Upstream commit newer than the latest upstream release needed for features -# and fixes developed for Godot 3.2. -# Upstream commit 308db73d0b3c2d1870cd3e465eaa283692a4cf23. -# Could be unbundled if a recent enough version is packaged, but care is needed -# as Godot currently used experimental features which may change upstream. -Provides: bundled(assimp) %if ! %{system_bullet} # Needs at least bullet 2.89 (with a patch, see linked PR) or later (unpatched). # https://github.com/bulletphysics/bullet3/pull/2748 @@ -101,7 +105,7 @@ Provides: bundled(bullet) = 2.89 # Has some modifications for IPv6 support, upstream enet is unresponsive. # Should not be unbundled. # Cf: https://github.com/godotengine/godot/issues/6992 -Provides: bundled(enet) = 1.3.15 +Provides: bundled(enet) = 1.3.17 # Upstream commit from 2016 (32d5ac49414a8914ec1e1f285f3f927c6e8ec29d), # newer than 1.0.0.27 which is the last tag. # Could be unbundled if packaged. @@ -113,12 +117,17 @@ Provides: bundled(libwslay) = 1.1.1 # Has custom changes to support seeking in zip archives # Should not be unbundled. Provides: bundled(minizip) = 1.2.11 -# Upstream commit 25241c5a8f8451d41ab1b02ab2d865b01600d949, no releases. +# Upstream commit 3e403ec72a9145cbbcc6c63d94a4caf079aafec2, no releases. # Could be unbundled if packaged. Provides: bundled(nanosvg) +%ifarch x86_64 +# Could be unbundled but requires some upstream work, and it's not clear if +# upstream code would be compatible with more recent OIDN releases. +Provides: bundled(oidn) = 1.1.0 +%endif # Could be unbundled if packaged. Provides: bundled(squish) = 1.15 -# Upstream commit 656bb611afd517394dc1a202359b9ccaa3c03a53. +# Upstream commit e4b7840d9448b7d57a88384ce26143004f3c0c71. # Could be unbundled if packaged. Provides: bundled(tinyexr)
@@ -140,7 +149,7 @@ down to the last line of engine code. %{_datadir}/fish/vendor_completions.d/%{name}.fish %{_datadir}/icons/hicolor/scalable/apps/%{name}.svg %{_datadir}/metainfo/%{rdnsname}.appdata.xml -%{_datadir}/mime/application/x-%{name}-project.xml +%{_datadir}/mime/application/%{rdnsname}.xml %{_datadir}/zsh/site-functions/_%{name} %{_mandir}/man6/%{name}.6*
@@ -220,6 +229,9 @@ to_unbundle+=" bullet" %if %{system_libwslay} to_unbundle+=" wslay" %endif +%ifarch x86_64 +to_unbundle+=" embree" +%endif
system_libs="" for lib in $to_unbundle; do @@ -227,7 +239,13 @@ for lib in $to_unbundle; do rm -rf thirdparty/$lib done
-%define _scons scons-3 %{?_smp_mflags} "CCFLAGS=%{?build_cflags}" "LINKFLAGS=%{?build_ldflags}" $system_libs use_lto=yes udev=yes progress=no +# Those modules require embree and oidn which are x86_64 only. Godot's own logic to disable +# them on other arches is a bit brittle when it comes to cross-compiling currently. +%ifnarch x86_64 +%define disable_modules module_denoise_enabled=no module_lightmapper_cpu_enabled=no module_raycast_enabled=no +%endif + +%define _scons scons-3 %{?_smp_mflags} "CCFLAGS=%{?build_cflags}" "LINKFLAGS=%{?build_ldflags}" $system_libs use_lto=yes use_static_cpp=no progress=no %{?disable_modules}
%if 0%{?fedora} export BUILD_NAME="fedora" @@ -269,8 +287,8 @@ install -D -m644 misc/dist/linux/%{rdnsname}.desktop \ %{buildroot}%{_datadir}/applications/%{rdnsname}.desktop install -D -m644 misc/dist/linux/%{rdnsname}.appdata.xml \ %{buildroot}%{_datadir}/metainfo/%{rdnsname}.appdata.xml -install -D -m644 misc/dist/linux/x-%{name}-project.xml \ - %{buildroot}%{_datadir}/mime/application/x-%{name}-project.xml +install -D -m644 misc/dist/linux/%{rdnsname}.xml \ + %{buildroot}%{_datadir}/mime/application/%{rdnsname}.xml install -D -m644 misc/dist/linux/%{name}.6 \ %{buildroot}%{_mandir}/man6/%{name}.6 install -D -m644 misc/dist/shell/%{name}.bash-completion \ @@ -286,6 +304,10 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/%{rdnsname}.desktop appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/%{rdnsname}.appdata.xml
%changelog +* Fri Apr 23 2021 Rémi Verschelde akien@fedoraproject.org - 3.3-1 +- Version 3.3-stable +- New lightmapper (x86_64 only) uses embree (system) and oidn (bundled) + * Thu Apr 01 2021 Jonathan Wakely jwakely@redhat.com - 3.2.3-2 - Fix release tag
diff --git a/sources b/sources index 7d33ef5..42b73dd 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (godot-3.2.3-stable.tar.xz) = 8374a46a449a24c0a928f00aa6b20334e26c2aae543593c9a9bb9fd28d089b035c36c0a1953a37589eb80a9f0d4d359c0f6a887f0c68650b5f316ccbc45c9319 -SHA512 (godot-3.2.3-stable.tar.xz.sha256) = b1621f42d55de1cfdee9a88ed88bd0dd2ed81472ccb024703b7261ab411a24f9dd314bcbcb59afd243a268f395e4c4ba46064aebc901966b0fc03ed1fe6f9ca1 +SHA512 (godot-3.3-stable.tar.xz) = 953c041f2569fc858598f4e442b836157ed1069debc5fe71041a1edf76b83228d23731965aae9f7a6dbf2a66316bad29f34f06cf2c0d4fc8d444d0774d066313 +SHA512 (godot-3.3-stable.tar.xz.sha256) = 84e6c3e493d1ad3a0336de7ee55350891e01e1b7e445e61500e7460685a47544883958e713f93c884bdd45f94fedf1ca98173fe1295bcaab4b8ad1b4cdeb44d8
commit cbe121289f17f393e191119a9bcaf6e9401459aa Author: Jonathan Wakely jwakely@redhat.com Date: Thu Apr 1 11:13:30 2021 +0100
Fix release tag
diff --git a/godot.spec b/godot.spec index 5243dcf..2e03479 100644 --- a/godot.spec +++ b/godot.spec @@ -12,7 +12,7 @@
Name: godot Version: 3.2.3 -Release: %{?prerel:0.%{status}.}1%{?dist}.1 +Release: %{?prerel:0.%{status}.}2%{?dist} Summary: Multi-platform 2D and 3D game engine with a feature-rich editor %if 0%{?mageia} Group: Development/Tools @@ -286,6 +286,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/%{rdnsname}.desktop appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/%{rdnsname}.appdata.xml
%changelog +* Thu Apr 01 2021 Jonathan Wakely jwakely@redhat.com - 3.2.3-2 +- Fix release tag + * Tue Mar 30 2021 Jonathan Wakely jwakely@redhat.com - 3.2.3-1.1 - Rebuilt for removed libstdc++ symbol (#1937698)
commit 19f9acc726bc09ff71e2faff0fa23d92b6ed1d8c Author: Jonathan Wakely jwakely@redhat.com Date: Tue Mar 30 19:36:22 2021 +0100
Rebuilt for removed libstdc++ symbol (#1937698)
diff --git a/godot.spec b/godot.spec index 85ffd2d..5243dcf 100644 --- a/godot.spec +++ b/godot.spec @@ -12,7 +12,7 @@
Name: godot Version: 3.2.3 -Release: %{?prerel:0.%{status}.}1%{?dist} +Release: %{?prerel:0.%{status}.}1%{?dist}.1 Summary: Multi-platform 2D and 3D game engine with a feature-rich editor %if 0%{?mageia} Group: Development/Tools @@ -286,6 +286,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/%{rdnsname}.desktop appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/%{rdnsname}.appdata.xml
%changelog +* Tue Mar 30 2021 Jonathan Wakely jwakely@redhat.com - 3.2.3-1.1 +- Rebuilt for removed libstdc++ symbol (#1937698) + * Fri Feb 12 2021 Rémi Verschelde akien@fedoraproject.org - 3.2.3-1 - Version 3.2.3-stable - Drop tentative support for building for RHEL8
commit 3ba51295268db6d16e24e6fb448f55596a933f37 Author: Rémi Verschelde rverschelde@gmail.com Date: Fri Feb 12 13:53:56 2021 +0100
Drop tentative support for building for RHEL8
And fix support for Fedora 33.
diff --git a/godot.spec b/godot.spec index 8b5b68c..85ffd2d 100644 --- a/godot.spec +++ b/godot.spec @@ -28,15 +28,16 @@ Patch0: godot-pr45702-Fix-crash-TGA-loader.patch # Upstream does not support those arches (for now) ExcludeArch: ppc64 ppc64le s390x
+# See bundled section for explanations. +%define system_bullet 0%{?mageia} || 0%{?fedora} >= 34 +%define system_libwslay 0%{?mageia} + BuildRequires: gcc-c++ BuildRequires: mbedtls-devel -%if ! 0%{?rhel} BuildRequires: miniupnpc-devel -%endif BuildRequires: pkgconfig(alsa) -%if 0%{?mageia} -# Fedora doesn't provide bullet 2.89 -BuildRequires: pkgconfig(bullet) +%if %{system_bullet} +BuildRequires: pkgconfig(bullet) >= 2.89 %endif BuildRequires: pkgconfig(freetype2) BuildRequires: pkgconfig(gl) @@ -45,8 +46,7 @@ BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(libpulse) BuildRequires: pkgconfig(libudev) BuildRequires: pkgconfig(libwebp) -%if 0%{?mageia} -# Fedora doesn't provide wslay yet +%if %{system_libwslay} BuildRequires: pkgconfig(libwslay) %endif BuildRequires: pkgconfig(libzstd) @@ -71,10 +71,11 @@ BuildRequires: python3-scons %endif
# For desktop and appdata files validation -BuildRequires: desktop-file-utils >= 0.26 %if 0%{?mageia} BuildRequires: appstream-util +BuildRequires: desktop-file-utils >= 0.26 %else +BuildRequires: desktop-file-utils BuildRequires: libappstream-glib %endif
@@ -92,10 +93,8 @@ Requires: hicolor-icon-theme # Could be unbundled if a recent enough version is packaged, but care is needed # as Godot currently used experimental features which may change upstream. Provides: bundled(assimp) -%if ! 0%{?mageia} -# Can be unbundled once bullet 2.89+ is packaged. -# Note: When using system bullet 2.89, please backport this upstream commit -# which is needed for proper damping in Godot: +%if ! %{system_bullet} +# Needs at least bullet 2.89 (with a patch, see linked PR) or later (unpatched). # https://github.com/bulletphysics/bullet3/pull/2748 Provides: bundled(bullet) = 2.89 %endif @@ -107,15 +106,10 @@ Provides: bundled(enet) = 1.3.15 # newer than 1.0.0.27 which is the last tag. # Could be unbundled if packaged. Provides: bundled(libwebm) -%if ! 0%{?mageia} +%if ! %{system_libwslay} # Could be unbundled if packaged. Provides: bundled(libwslay) = 1.1.1 %endif -%if 0%{?rhel} -# Not provided in RHEL8. -# Upstream commit 44366328661826603982d1e0d7ebb4062c5f2bfc. -Provides: bundled(miniupnpc) -%endif # Has custom changes to support seeking in zip archives # Should not be unbundled. Provides: bundled(minizip) = 1.2.11 @@ -218,15 +212,13 @@ by pointing to the location of the game's data package. %build # Needs to be in %%build so that system_libs stays in scope # We don't unbundle enet and minizip as they have necessary custom changes -to_unbundle="freetype libogg libpng libtheora libvorbis libvpx libwebp mbedtls opus pcre2 zlib zstd" -# Godot requires bullet 2.89+, which Fedora doesn't package yet -# TODO: Fedora doesn't provide wslay yet, package it -%if 0%{?mageia} -to_unbundle+=" bullet wslay" +to_unbundle="freetype libogg libpng libtheora libvorbis libvpx libwebp mbedtls miniupnpc opus pcre2 zlib zstd" + +%if %{system_bullet} +to_unbundle+=" bullet" %endif -# RHEL8 doesn't provide miniupnpc -%if ! 0%{?rhel} -to_unbundle+=" miniupnpc" +%if %{system_libwslay} +to_unbundle+=" wslay" %endif
system_libs="" @@ -240,9 +232,6 @@ done %if 0%{?fedora} export BUILD_NAME="fedora" %endif -%if 0%{?rhel} -export BUILD_NAME="rhel" -%endif %if 0%{?mageia} export BUILD_NAME="mageia" %endif @@ -297,10 +286,11 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/%{rdnsname}.desktop appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/%{rdnsname}.appdata.xml
%changelog -* Thu Feb 11 2021 Rémi Verschelde akien@fedoraproject.org - 3.2.3-1 +* Fri Feb 12 2021 Rémi Verschelde akien@fedoraproject.org - 3.2.3-1 - Version 3.2.3-stable -- Adds fish completion files +- Drop tentative support for building for RHEL8 - Backport upstream patch to fix TGA loader crash (CVE-2021-26825, CVE-2021-26826) +- Adds fish completion files
* Tue Jan 26 2021 Fedora Release Engineering releng@fedoraproject.org - 3.2.1-1.2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
commit 7796e66e81734eb8d3e713678c6de04dcc8c3a96 Author: Rémi Verschelde rverschelde@gmail.com Date: Fri Feb 12 13:53:56 2021 +0100
Version 3.2.3-stable
Adds fish completion files Backport upstream patch to fix TGA loader crash (CVE-2021-26825, CVE-2021-26826)
diff --git a/.gitignore b/.gitignore index 9bc3f56..33fb29c 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ /godot-3.1.2-stable.tar.xz.sha256 /godot-3.2.1-stable.tar.xz /godot-3.2.1-stable.tar.xz.sha256 +/godot-3.2.3-stable.tar.xz +/godot-3.2.3-stable.tar.xz.sha256 diff --git a/godot-pr45702-Fix-crash-TGA-loader.patch b/godot-pr45702-Fix-crash-TGA-loader.patch new file mode 100644 index 0000000..b9de555 --- /dev/null +++ b/godot-pr45702-Fix-crash-TGA-loader.patch @@ -0,0 +1,112 @@ +From 113b5ab1c45c01b8e6d54d13ac8876d091f883a8 Mon Sep 17 00:00:00 2001 +From: Hein-Pieter van Braam-Stewart hp@tmm.cx +Date: Thu, 4 Feb 2021 12:56:33 +0100 +Subject: [PATCH] Fix a crash in the TGA loader with malformed input + +--- + modules/tga/image_loader_tga.cpp | 25 ++++++++++++++++++++++--- + modules/tga/image_loader_tga.h | 2 +- + 2 files changed, 23 insertions(+), 4 deletions(-) + +diff --git a/modules/tga/image_loader_tga.cpp b/modules/tga/image_loader_tga.cpp +index d60efdd5bcc..964dc091a7d 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 249e33411e7..bbfc3fed329 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); diff --git a/godot.spec b/godot.spec index e2ac094..8b5b68c 100644 --- a/godot.spec +++ b/godot.spec @@ -11,8 +11,8 @@ %define rdnsname org.godotengine.Godot
Name: godot -Version: 3.2.1 -Release: %{?prerel:0.%{status}.}1%{?dist}.2 +Version: 3.2.3 +Release: %{?prerel:0.%{status}.}1%{?dist} Summary: Multi-platform 2D and 3D game engine with a feature-rich editor %if 0%{?mageia} Group: Development/Tools @@ -22,6 +22,8 @@ License: MIT and CC-BY and ASL 2.0 and BSD and zlib and OFL and Bitstream URL: https://godotengine.org Source0: https://downloads.tuxfamily.org/godotengine/%%7Bversion%7D/%%7B?prerel:%%7Bs... Source1: https://downloads.tuxfamily.org/godotengine/%%7Bversion%7D/%%7B?prerel:%%7Bs... +# Security fix: https://github.com/godotengine/godot/pull/45702 +Patch0: godot-pr45702-Fix-crash-TGA-loader.patch
# Upstream does not support those arches (for now) ExcludeArch: ppc64 ppc64le s390x @@ -69,7 +71,7 @@ BuildRequires: python3-scons %endif
# For desktop and appdata files validation -BuildRequires: desktop-file-utils +BuildRequires: desktop-file-utils >= 0.26 %if 0%{?mageia} BuildRequires: appstream-util %else @@ -92,23 +94,26 @@ Requires: hicolor-icon-theme Provides: bundled(assimp) %if ! 0%{?mageia} # Can be unbundled once bullet 2.89+ is packaged. +# Note: When using system bullet 2.89, please backport this upstream commit +# which is needed for proper damping in Godot: +# https://github.com/bulletphysics/bullet3/pull/2748 Provides: bundled(bullet) = 2.89 %endif # Has some modifications for IPv6 support, upstream enet is unresponsive. # Should not be unbundled. # Cf: https://github.com/godotengine/godot/issues/6992 -Provides: bundled(enet) = 1.3.14 +Provides: bundled(enet) = 1.3.15 # Upstream commit from 2016 (32d5ac49414a8914ec1e1f285f3f927c6e8ec29d), # newer than 1.0.0.27 which is the last tag. # Could be unbundled if packaged. Provides: bundled(libwebm) %if ! 0%{?mageia} # Could be unbundled if packaged. -Provides: bundled(libwslay) = 1.1.0 +Provides: bundled(libwslay) = 1.1.1 %endif %if 0%{?rhel} # Not provided in RHEL8. -# Upstream commit 0ab1d6725b800f007f9bb9919150546476616f1b. +# Upstream commit 44366328661826603982d1e0d7ebb4062c5f2bfc. Provides: bundled(miniupnpc) %endif # Has custom changes to support seeking in zip archives @@ -138,6 +143,7 @@ down to the last line of engine code. %{_bindir}/%{name} %{_datadir}/applications/%{rdnsname}.desktop %{_datadir}/bash-completion/completions/%{name} +%{_datadir}/fish/vendor_completions.d/%{name}.fish %{_datadir}/icons/hicolor/scalable/apps/%{name}.svg %{_datadir}/metainfo/%{rdnsname}.appdata.xml %{_datadir}/mime/application/x-%{name}-project.xml @@ -280,6 +286,8 @@ install -D -m644 misc/dist/linux/%{name}.6 \ %{buildroot}%{_mandir}/man6/%{name}.6 install -D -m644 misc/dist/shell/%{name}.bash-completion \ %{buildroot}%{_datadir}/bash-completion/completions/%{name} +install -D -m644 misc/dist/shell/%{name}.fish \ + %{buildroot}%{_datadir}/fish/vendor_completions.d/%{name}.fish install -D -m644 misc/dist/shell/_%{name}.zsh-completion \ %{buildroot}%{_datadir}/zsh/site-functions/_%{name}
@@ -289,6 +297,11 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/%{rdnsname}.desktop appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/%{rdnsname}.appdata.xml
%changelog +* Thu Feb 11 2021 Rémi Verschelde akien@fedoraproject.org - 3.2.3-1 +- Version 3.2.3-stable +- Adds fish completion files +- Backport upstream patch to fix TGA loader crash (CVE-2021-26825, CVE-2021-26826) + * Tue Jan 26 2021 Fedora Release Engineering releng@fedoraproject.org - 3.2.1-1.2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
diff --git a/sources b/sources index 7ad58cc..7d33ef5 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (godot-3.2.1-stable.tar.xz) = eb4980409932f7b55be0030b0519b0bb1881dfdbbc7eb87c4f2c242add0b4bae743ecf67beb8f99ba50d44e6e06cc76772a0f74611a0dffcfa919183bab6a38a -SHA512 (godot-3.2.1-stable.tar.xz.sha256) = 1e1aa0fa209a6493f6b6340a95eb70a5cec46206f64e72b7b88c5942c1042ff8e8f6959aad4aa7425aac3c4d2bfb53235a174b7849cac8049b7211104e4e03e4 +SHA512 (godot-3.2.3-stable.tar.xz) = 8374a46a449a24c0a928f00aa6b20334e26c2aae543593c9a9bb9fd28d089b035c36c0a1953a37589eb80a9f0d4d359c0f6a887f0c68650b5f316ccbc45c9319 +SHA512 (godot-3.2.3-stable.tar.xz.sha256) = b1621f42d55de1cfdee9a88ed88bd0dd2ed81472ccb024703b7261ab411a24f9dd314bcbcb59afd243a268f395e4c4ba46064aebc901966b0fc03ed1fe6f9ca1
commit 73453a6f7d280e38852c9e1fd430888209b08ed2 Author: Fedora Release Engineering releng@fedoraproject.org Date: Tue Jan 26 08:57:32 2021 +0000
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
Signed-off-by: Fedora Release Engineering releng@fedoraproject.org
diff --git a/godot.spec b/godot.spec index b403063..e2ac094 100644 --- a/godot.spec +++ b/godot.spec @@ -12,7 +12,7 @@
Name: godot Version: 3.2.1 -Release: %{?prerel:0.%{status}.}1%{?dist}.1 +Release: %{?prerel:0.%{status}.}1%{?dist}.2 Summary: Multi-platform 2D and 3D game engine with a feature-rich editor %if 0%{?mageia} Group: Development/Tools @@ -289,6 +289,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/%{rdnsname}.desktop appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/%{rdnsname}.appdata.xml
%changelog +* Tue Jan 26 2021 Fedora Release Engineering releng@fedoraproject.org - 3.2.1-1.2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + * Mon Jul 27 2020 Fedora Release Engineering releng@fedoraproject.org - 3.2.1-1.1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
commit b26c00b57c98138f87b46cad56695136d1bb9edc Author: Fedora Release Engineering releng@fedoraproject.org Date: Mon Jul 27 20:57:20 2020 +0000
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
Signed-off-by: Fedora Release Engineering releng@fedoraproject.org
diff --git a/godot.spec b/godot.spec index abd9529..b403063 100644 --- a/godot.spec +++ b/godot.spec @@ -12,7 +12,7 @@
Name: godot Version: 3.2.1 -Release: %{?prerel:0.%{status}.}1%{?dist} +Release: %{?prerel:0.%{status}.}1%{?dist}.1 Summary: Multi-platform 2D and 3D game engine with a feature-rich editor %if 0%{?mageia} Group: Development/Tools @@ -289,6 +289,9 @@ desktop-file-validate %{buildroot}%{_datadir}/applications/%{rdnsname}.desktop appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/%{rdnsname}.appdata.xml
%changelog +* Mon Jul 27 2020 Fedora Release Engineering releng@fedoraproject.org - 3.2.1-1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Wed Mar 11 2020 Rémi Verschelde akien@fedoraproject.org - 3.2.1-1 - Version 3.2.1-stable - Bundles assimp, requires development version not packaged anywhere