From 7fd5042e4bb6db5e97ed6d082d22d80a1612b7fe66a6fa6916ad0f8a4f6ee35d Mon Sep 17 00:00:00 2001 From: Andreas Stieger Date: Tue, 4 Apr 2023 22:06:23 +0000 Subject: [PATCH 1/3] Accepting request 1077370 from home:AndreasStieger:branches:Emulators gcc13 fix OBS-URL: https://build.opensuse.org/request/show/1077370 OBS-URL: https://build.opensuse.org/package/show/Emulators/ppsspp?expand=0&rev=371 --- ppsspp-1.14.4-gcc13.patch | 60 ++++++++++++++++ ppsspp-1.14.4-system-png.patch | 123 +++++++++++++++++++++++++++++++++ ppsspp.changes | 7 ++ ppsspp.spec | 15 +--- 4 files changed, 193 insertions(+), 12 deletions(-) create mode 100644 ppsspp-1.14.4-gcc13.patch create mode 100644 ppsspp-1.14.4-system-png.patch diff --git a/ppsspp-1.14.4-gcc13.patch b/ppsspp-1.14.4-gcc13.patch new file mode 100644 index 0000000..2f5fd19 --- /dev/null +++ b/ppsspp-1.14.4-gcc13.patch @@ -0,0 +1,60 @@ +Index: ppsspp-1.14.4/ext/vma/vk_mem_alloc.h +=================================================================== +--- ppsspp-1.14.4.orig/ext/vma/vk_mem_alloc.h ++++ ppsspp-1.14.4/ext/vma/vk_mem_alloc.h +@@ -2624,6 +2624,7 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeS + #include + #include + #include ++#include + + #ifdef _MSC_VER + #include // For functions like __popcnt, _BitScanForward etc. +Index: ppsspp-1.14.4/Core/Reporting.h +=================================================================== +--- ppsspp-1.14.4.orig/Core/Reporting.h ++++ ppsspp-1.14.4/Core/Reporting.h +@@ -19,6 +19,7 @@ + + #include + #include ++#include + + #include "Common/CommonTypes.h" + #include "Common/File/Path.h" +Index: ppsspp-1.14.4/Common/Data/Format/IniFile.h +=================================================================== +--- ppsspp-1.14.4.orig/Common/Data/Format/IniFile.h ++++ ppsspp-1.14.4/Common/Data/Format/IniFile.h +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + + #include "Common/File/Path.h" + +Index: ppsspp-1.14.4/Common/Net/NetBuffer.h +=================================================================== +--- ppsspp-1.14.4.orig/Common/Net/NetBuffer.h ++++ ppsspp-1.14.4/Common/Net/NetBuffer.h +@@ -1,5 +1,7 @@ + #pragma once + ++#include ++ + #include "Common/Buffer.h" + + namespace net { +Index: ppsspp-1.14.4/Common/GPU/OpenGL/GLFeatures.h +=================================================================== +--- ppsspp-1.14.4.orig/Common/GPU/OpenGL/GLFeatures.h ++++ ppsspp-1.14.4/Common/GPU/OpenGL/GLFeatures.h +@@ -5,6 +5,7 @@ + #pragma once + + #include ++#include + + // TODO: Replace with thin3d's vendor enum. + enum { diff --git a/ppsspp-1.14.4-system-png.patch b/ppsspp-1.14.4-system-png.patch new file mode 100644 index 0000000..ceede16 --- /dev/null +++ b/ppsspp-1.14.4-system-png.patch @@ -0,0 +1,123 @@ +From: Andreas Stieger +Date: Tue, 04 Apr 2023 20:38:05 +0000 +Subject: [PATCH] use system libpng +Upstream: no + +Previously in spec file: + +sed -i -e 's|png17|png16|g' CMakeLists.txt +find ./ \ +-type f \( -name "*.cpp" -o -name "*.h" \) -exec \ +sed -i \ +-e 's|^#include [\"<]libpng1[0-9]/png.h[\">]|#include |g' \ +{} \; + +Index: ppsspp-1.14.4/CMakeLists.txt +=================================================================== +--- ppsspp-1.14.4.orig/CMakeLists.txt ++++ ppsspp-1.14.4/CMakeLists.txt +@@ -319,7 +319,7 @@ foreach (LANGUAGE C CXX) + endforeach() + + if(NOT MSVC) +- # NEON optimizations in libpng17 seem to cause PNG load errors, see #14485. ++ # NEON optimizations in libpng16 seem to cause PNG load errors, see #14485. + add_definitions(-DPNG_ARM_NEON_OPT=0) + + if(ANDROID) +@@ -1036,7 +1036,7 @@ else() + set(LIBZIP_LIBRARY libzip) + endif() + +-# Arm platforms require at least libpng17. ++# Arm platforms require at least libpng16. + if(ANDROID OR ARMV7 OR ARM64 OR ARM OR IOS) + set(PNG_REQUIRED_VERSION 1.7) + else() +@@ -1051,43 +1051,43 @@ if(PNG_FOUND) + else() + if(ARM) + set(PNG_ARM_INCLUDES +- ext/libpng17/arm/arm_init.c +- ext/libpng17/arm/filter_neon.S +- ext/libpng17/arm/filter_neon_intrinsics.c ++ ext/libpng16/arm/arm_init.c ++ ext/libpng16/arm/filter_neon.S ++ ext/libpng16/arm/filter_neon_intrinsics.c + ) + elseif(ARM64) + set(PNG_ARM_INCLUDES +- ext/libpng17/arm/arm_init.c +- ext/libpng17/arm/filter_neon_intrinsics.c ++ ext/libpng16/arm/arm_init.c ++ ext/libpng16/arm/filter_neon_intrinsics.c + ) + endif() +- add_library(png17 STATIC +- ext/libpng17/pngconf.h +- ext/libpng17/pngdebug.h +- ext/libpng17/png.c +- ext/libpng17/png.h +- ext/libpng17/pngerror.c +- ext/libpng17/pngget.c +- ext/libpng17/pnginfo.h +- ext/libpng17/pnglibconf.h +- ext/libpng17/pngmem.c +- ext/libpng17/pngpread.c +- ext/libpng17/pngpriv.h +- ext/libpng17/pngread.c +- ext/libpng17/pngrio.c +- ext/libpng17/pngrtran.c +- ext/libpng17/pngrutil.c +- ext/libpng17/pngset.c +- ext/libpng17/pngstruct.h +- ext/libpng17/pngtrans.c +- ext/libpng17/pngwio.c +- ext/libpng17/pngwrite.c +- ext/libpng17/pngwtran.c +- ext/libpng17/pngwutil.c ++ add_library(png16 STATIC ++ ext/libpng16/pngconf.h ++ ext/libpng16/pngdebug.h ++ ext/libpng16/png.c ++ ext/libpng16/png.h ++ ext/libpng16/pngerror.c ++ ext/libpng16/pngget.c ++ ext/libpng16/pnginfo.h ++ ext/libpng16/pnglibconf.h ++ ext/libpng16/pngmem.c ++ ext/libpng16/pngpread.c ++ ext/libpng16/pngpriv.h ++ ext/libpng16/pngread.c ++ ext/libpng16/pngrio.c ++ ext/libpng16/pngrtran.c ++ ext/libpng16/pngrutil.c ++ ext/libpng16/pngset.c ++ ext/libpng16/pngstruct.h ++ ext/libpng16/pngtrans.c ++ ext/libpng16/pngwio.c ++ ext/libpng16/pngwrite.c ++ ext/libpng16/pngwtran.c ++ ext/libpng16/pngwutil.c + ${PNG_ARM_INCLUDES} + ) +- set(PNG_LIBRARIES png17) +- include_directories(ext/libpng17) ++ set(PNG_LIBRARIES png16) ++ include_directories(ext/libpng16) + endif() + + set(nativeExtra) +Index: ppsspp-1.14.4/ext/native/tools/atlastool.cpp +=================================================================== +--- ppsspp-1.14.4.orig/ext/native/tools/atlastool.cpp ++++ ppsspp-1.14.4/ext/native/tools/atlastool.cpp +@@ -19,7 +19,7 @@ + // dist-per-pixel + + #include +-#include ++#include + #include + #include + #include diff --git a/ppsspp.changes b/ppsspp.changes index c1fd46f..6e06c38 100644 --- a/ppsspp.changes +++ b/ppsspp.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Apr 4 20:44:11 UTC 2023 - Andreas Stieger + +- Address GCC13 build failures, add ppsspp-1.14.4-gcc13.patch +- Convert spec file construct to patch, + add ppsspp-1.14.4-system-png.patch + ------------------------------------------------------------------- Sat Jan 21 21:11:41 UTC 2023 - Andreas Stieger diff --git a/ppsspp.spec b/ppsspp.spec index 13c71d2..9a244b5 100644 --- a/ppsspp.spec +++ b/ppsspp.spec @@ -1,7 +1,7 @@ # # spec file for package ppsspp # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -25,6 +25,8 @@ License: GPL-2.0-or-later Group: System/Emulators/Other URL: https://www.ppsspp.org Source: https://github.com/hrydgard/ppsspp/releases/download/v%{version}/%{name}-%{version}.tar.xz +Patch0: ppsspp-1.14.4-system-png.patch +Patch1: ppsspp-1.14.4-gcc13.patch BuildRequires: Mesa-devel BuildRequires: cmake >= 3.6 BuildRequires: fdupes @@ -95,17 +97,6 @@ Required assets for PPSSPP GUI and assorted configuration files %prep %autosetup -p1 -sed -i \ --e 's|png17|png16|g' \ -CMakeLists.txt - -#Use system libpng -find ./ \ --type f \( -name "*.cpp" -o -name "*.h" \) -exec \ -sed -i \ --e 's|^#include [\"<]libpng1[0-9]/png.h[\">]|#include |g' \ -{} \; - echo "// This is a generated file. const char *PPSSPP_GIT_VERSION = \"%{version}\"; From 51d3360e0ebcafb8737a7b5761f44c9f9254aac520b243dbdc6b66d64299459e Mon Sep 17 00:00:00 2001 From: Andreas Stieger Date: Tue, 4 Apr 2023 22:47:40 +0000 Subject: [PATCH 2/3] OBS-URL: https://build.opensuse.org/package/show/Emulators/ppsspp?expand=0&rev=372 --- ppsspp-1.14.4-gcc13.patch | 101 +++++++++++++++++++++----------------- 1 file changed, 57 insertions(+), 44 deletions(-) diff --git a/ppsspp-1.14.4-gcc13.patch b/ppsspp-1.14.4-gcc13.patch index 2f5fd19..ddcabaa 100644 --- a/ppsspp-1.14.4-gcc13.patch +++ b/ppsspp-1.14.4-gcc13.patch @@ -1,31 +1,20 @@ -Index: ppsspp-1.14.4/ext/vma/vk_mem_alloc.h -=================================================================== ---- ppsspp-1.14.4.orig/ext/vma/vk_mem_alloc.h -+++ ppsspp-1.14.4/ext/vma/vk_mem_alloc.h -@@ -2624,6 +2624,7 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeS - #include - #include - #include -+#include - - #ifdef _MSC_VER - #include // For functions like __popcnt, _BitScanForward etc. -Index: ppsspp-1.14.4/Core/Reporting.h -=================================================================== ---- ppsspp-1.14.4.orig/Core/Reporting.h -+++ ppsspp-1.14.4/Core/Reporting.h -@@ -19,6 +19,7 @@ - - #include - #include -+#include - - #include "Common/CommonTypes.h" - #include "Common/File/Path.h" -Index: ppsspp-1.14.4/Common/Data/Format/IniFile.h -=================================================================== ---- ppsspp-1.14.4.orig/Common/Data/Format/IniFile.h -+++ ppsspp-1.14.4/Common/Data/Format/IniFile.h +From 822592c6b1441f7110e1cb15dcc5cd2ea1de8099 Mon Sep 17 00:00:00 2001 +From: Andreas Stieger +Date: Wed, 5 Apr 2023 00:20:14 +0200 +Subject: [PATCH] Fix build with GCC13: various standard includes + +--- + Common/Data/Format/IniFile.h | 1 + + Common/GPU/OpenGL/GLFeatures.h | 1 + + Common/Net/NetBuffer.h | 2 ++ + Core/Reporting.h | 1 + + ext/vma/vk_mem_alloc.h | 1 + + 5 files changed, 6 insertions(+) + +diff --git a/Common/Data/Format/IniFile.h b/Common/Data/Format/IniFile.h +index 1008fff5df94..cbe73f185542 100644 +--- a/Common/Data/Format/IniFile.h ++++ b/Common/Data/Format/IniFile.h @@ -8,6 +8,7 @@ #include #include @@ -34,22 +23,10 @@ Index: ppsspp-1.14.4/Common/Data/Format/IniFile.h #include "Common/File/Path.h" -Index: ppsspp-1.14.4/Common/Net/NetBuffer.h -=================================================================== ---- ppsspp-1.14.4.orig/Common/Net/NetBuffer.h -+++ ppsspp-1.14.4/Common/Net/NetBuffer.h -@@ -1,5 +1,7 @@ - #pragma once - -+#include -+ - #include "Common/Buffer.h" - - namespace net { -Index: ppsspp-1.14.4/Common/GPU/OpenGL/GLFeatures.h -=================================================================== ---- ppsspp-1.14.4.orig/Common/GPU/OpenGL/GLFeatures.h -+++ ppsspp-1.14.4/Common/GPU/OpenGL/GLFeatures.h +diff --git a/Common/GPU/OpenGL/GLFeatures.h b/Common/GPU/OpenGL/GLFeatures.h +index 04df20f87f5a..f2aa3380568d 100644 +--- a/Common/GPU/OpenGL/GLFeatures.h ++++ b/Common/GPU/OpenGL/GLFeatures.h @@ -5,6 +5,7 @@ #pragma once @@ -58,3 +35,39 @@ Index: ppsspp-1.14.4/Common/GPU/OpenGL/GLFeatures.h // TODO: Replace with thin3d's vendor enum. enum { +diff --git a/Common/Net/NetBuffer.h b/Common/Net/NetBuffer.h +index 6247aca98555..12a4ba37c8c4 100644 +--- a/Common/Net/NetBuffer.h ++++ b/Common/Net/NetBuffer.h +@@ -1,5 +1,7 @@ + #pragma once + ++#include ++ + #include "Common/Buffer.h" + + namespace net { +diff --git a/Core/Reporting.h b/Core/Reporting.h +index 211267c8f77c..1d254256f75a 100644 +--- a/Core/Reporting.h ++++ b/Core/Reporting.h +@@ -19,6 +19,7 @@ + + #include + #include ++#include + + #include "Common/CommonTypes.h" + #include "Common/File/Path.h" +diff --git a/ext/vma/vk_mem_alloc.h b/ext/vma/vk_mem_alloc.h +index f52dceeaf416..90719c161516 100644 +--- a/ext/vma/vk_mem_alloc.h ++++ b/ext/vma/vk_mem_alloc.h +@@ -2624,6 +2624,7 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString( + #include + #include + #include ++#include + + #ifdef _MSC_VER + #include // For functions like __popcnt, _BitScanForward etc. From a5a6d6ffbae3fa664065d925939ea4de0cec5e75fc44d6bd840a76ca900f707c Mon Sep 17 00:00:00 2001 From: Andreas Stieger Date: Tue, 4 Apr 2023 22:48:32 +0000 Subject: [PATCH 3/3] OBS-URL: https://build.opensuse.org/package/show/Emulators/ppsspp?expand=0&rev=373 --- ppsspp-1.14.4-gcc13.patch | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ppsspp-1.14.4-gcc13.patch b/ppsspp-1.14.4-gcc13.patch index ddcabaa..41e3fa1 100644 --- a/ppsspp-1.14.4-gcc13.patch +++ b/ppsspp-1.14.4-gcc13.patch @@ -3,6 +3,9 @@ From: Andreas Stieger Date: Wed, 5 Apr 2023 00:20:14 +0200 Subject: [PATCH] Fix build with GCC13: various standard includes +https://github.com/hrydgard/ppsspp/pull/17234 +https://github.com/hrydgard/ppsspp/commit/9874737087e8d24ea72b3f08b4975031b54a80a5 + --- Common/Data/Format/IniFile.h | 1 + Common/GPU/OpenGL/GLFeatures.h | 1 +