Accepting request 1077376 from Emulators

gcc13 fixes for TW

OBS-URL: https://build.opensuse.org/request/show/1077376
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/ppsspp?expand=0&rev=19
This commit is contained in:
Dominique Leuenberger 2023-04-05 19:27:18 +00:00 committed by Git OBS Bridge
commit 18e19a556f
4 changed files with 209 additions and 12 deletions

76
ppsspp-1.14.4-gcc13.patch Normal file
View File

@ -0,0 +1,76 @@
From 822592c6b1441f7110e1cb15dcc5cd2ea1de8099 Mon Sep 17 00:00:00 2001
From: Andreas Stieger <Andreas.Stieger@gmx.de>
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 +
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 <map>
#include <string>
#include <vector>
+#include <cstdint>
#include "Common/File/Path.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
#include <string>
+#include <cstdint>
// 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 <cstdint>
+
#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 <string>
#include <vector>
+#include <cstdint>
#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 <cstring>
#include <utility>
#include <type_traits>
+#include <cstdio>
#ifdef _MSC_VER
#include <intrin.h> // For functions like __popcnt, _BitScanForward etc.

View File

@ -0,0 +1,123 @@
From: Andreas Stieger <Andreas.Stieger@gmx.de>
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 <png.h>|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 <assert.h>
-#include <libpng17/png.h>
+#include <png.h>
#include <ft2build.h>
#include <freetype/ftbitmap.h>
#include <set>

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Apr 4 20:44:11 UTC 2023 - Andreas Stieger <andreas.stieger@gmx.de>
- 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 <andreas.stieger@gmx.de> Sat Jan 21 21:11:41 UTC 2023 - Andreas Stieger <andreas.stieger@gmx.de>

View File

@ -1,7 +1,7 @@
# #
# spec file for package ppsspp # 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 # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -25,6 +25,8 @@ License: GPL-2.0-or-later
Group: System/Emulators/Other Group: System/Emulators/Other
URL: https://www.ppsspp.org URL: https://www.ppsspp.org
Source: https://github.com/hrydgard/ppsspp/releases/download/v%{version}/%{name}-%{version}.tar.xz 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: Mesa-devel
BuildRequires: cmake >= 3.6 BuildRequires: cmake >= 3.6
BuildRequires: fdupes BuildRequires: fdupes
@ -95,17 +97,6 @@ Required assets for PPSSPP GUI and assorted configuration files
%prep %prep
%autosetup -p1 %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 <png.h>|g' \
{} \;
echo "// This is a generated file. echo "// This is a generated file.
const char *PPSSPP_GIT_VERSION = \"%{version}\"; const char *PPSSPP_GIT_VERSION = \"%{version}\";