commit 2dd9c9aad2c88eeb8d13f328eb51370fa860b28f
Author: Antonio T <sagitter(a)fedoraproject.org>
Date: Sun Jan 10 19:17:04 2021 +0100
Use bundled FFMpeg-3.0.2 in Fedora 34 (RPM Fusion bz#5889)
.gitignore | 1 +
ppsspp-ffmpeg-set_aarch64_build_flags.patch | 40 ++++++
ppsspp-ffmpeg-set_arm_build_flags.patch | 79 +++++++++++
ppsspp-ffmpeg-set_x64_build_flags.patch | 31 +++++
ppsspp.spec | 200 ++++++++++++++++++++--------
sources | 2 +-
6 files changed, 300 insertions(+), 53 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index fa9389c..0aa9054 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,4 @@
/ppsspp-1.10.0.tar.gz
/ppsspp-1.10.2.tar.gz
/ppsspp-1.10.3.tar.gz
+/ppsspp-ffmpeg-1.10.3.tar.gz
diff --git a/ppsspp-ffmpeg-set_aarch64_build_flags.patch
b/ppsspp-ffmpeg-set_aarch64_build_flags.patch
new file mode 100644
index 0000000..f9ef748
--- /dev/null
+++ b/ppsspp-ffmpeg-set_aarch64_build_flags.patch
@@ -0,0 +1,40 @@
+--- a/ffmpeg/linux_arm64.orig.sh 2021-01-08 16:07:44.000000000 +0100
++++ b/ffmpeg/linux_arm64.sh 2021-01-09 19:53:18.944667647 +0100
+@@ -3,12 +3,10 @@
+ set -e
+
+ GENERAL="\
+- --enable-cross-compile \
+ --extra-libs="-lgcc" \
+ --arch=aarch64 \
+- --cc=aarch64-linux-gnu-gcc \
+- --cross-prefix=aarch64-linux-gnu- \
+- --nm=aarch64-linux-gnu-gcc-nm"
++ --cc=gcc \
++ --nm=nm"
+
+ #~ GENERAL="\
+ #~ --enable-cross-compile \
+@@ -86,9 +84,10 @@
+ ./configure --target-os=linux \
+ --prefix=./linux/aarch64 \
+ ${GENERAL} \
+- --extra-cflags=" -O3 -fasm -Wno-psabi -fno-short-enums -fno-strict-aliasing
-finline-limit=300 " \
+- --disable-shared \
+- --enable-static \
++ --extra-cflags=" ${CFLAGS} -fasm -Wno-psabi -fno-short-enums
-fno-strict-aliasing -finline-limit=300 " \
++ --extra-ldflags="${LDFLAGS}" --disable-stripping \
++ --enable-shared \
++ --disable-static \
+ --enable-zlib \
+ --disable-everything \
+ ${MODULES} \
+@@ -99,8 +98,6 @@
+ ${DEMUXERS} \
+ ${MUXERS} \
+ ${PARSERS}
+-make clean
+-make install
+ }
+
+ build_ARM64
diff --git a/ppsspp-ffmpeg-set_arm_build_flags.patch
b/ppsspp-ffmpeg-set_arm_build_flags.patch
new file mode 100644
index 0000000..cde3dd6
--- /dev/null
+++ b/ppsspp-ffmpeg-set_arm_build_flags.patch
@@ -0,0 +1,79 @@
+--- a/ffmpeg/linux_arm.orig.sh 2021-01-08 16:07:44.000000000 +0100
++++ b/ffmpeg/linux_arm.sh 2021-01-09 19:57:17.924516740 +0100
+@@ -3,12 +3,10 @@
+ set -e
+
+ GENERAL="\
+- --enable-cross-compile \
+ --extra-libs="-lgcc" \
+ --arch=arm \
+- --cc=arm-linux-gnueabi-gcc \
+- --cross-prefix=arm-linux-gnueabi- \
+- --nm=arm-linux-gnueabi-nm"
++ --cc=gcc \
++ --nm=nm"
+
+ MODULES="\
+ --disable-avdevice \
+@@ -73,38 +71,16 @@
+ --enable-parser=aac_latm"
+
+
+-function build_ARMv6
+-{
+-./configure --target-os=linux \
+- --prefix=./linux/armv6 \
+- ${GENERAL} \
+- --extra-cflags=" -O3 -fasm -Wno-psabi -fno-short-enums -fno-strict-aliasing
-finline-limit=300 -mfloat-abi=softfp -mfpu=vfp -marm -march=armv6" \
+- --disable-shared \
+- --enable-static \
+- --enable-zlib \
+- --disable-everything \
+- ${MODULES} \
+- ${VIDEO_DECODERS} \
+- ${AUDIO_DECODERS} \
+- ${VIDEO_ENCODERS} \
+- ${AUDIO_ENCODERS} \
+- ${DEMUXERS} \
+- ${MUXERS} \
+- ${PARSERS} \
+- --disable-neon
+-
+-make clean
+-make install
+-}
+-
+ function build_ARMv7
+ {
+ ./configure --target-os=linux \
+ --prefix=./linux/armv7 \
+ ${GENERAL} \
+- --extra-cflags=" -O3 -fasm -Wno-psabi -fno-short-enums -fno-strict-aliasing
-finline-limit=300 -mfloat-abi=softfp -mfpu=neon -marm -march=armv7-a" \
+- --disable-shared \
+- --enable-static \
++ --extra-cflags=" ${CFLAGS} -fasm -Wno-psabi -fno-short-enums
-fno-strict-aliasing -finline-limit=300" \
++ --extra-ldflags="${LDFLAGS}" --disable-stripping \
++ --enable-rpath \
++ --enable-shared \
++ --disable-static \
+ --enable-zlib \
+ --disable-everything \
+ ${MODULES} \
+@@ -115,10 +91,7 @@
+ ${DEMUXERS} \
+ ${MUXERS} \
+ ${PARSERS}
+-make clean
+-make install
+ }
+
+-build_ARMv6
+ build_ARMv7
+-echo Linux ARM builds finished
++echo Linux ARM configure finished
+ }
+
+-build_ARMv6
+-build_ARMv7
+-echo Linux ARM builds finished
++echo Linux ARM configure finished
diff --git a/ppsspp-ffmpeg-set_x64_build_flags.patch
b/ppsspp-ffmpeg-set_x64_build_flags.patch
new file mode 100644
index 0000000..7e8900b
--- /dev/null
+++ b/ppsspp-ffmpeg-set_x64_build_flags.patch
@@ -0,0 +1,31 @@
+--- a/ffmpeg/linux_x86-64.orig.sh 2021-01-08 16:07:44.000000000 +0100
++++ b/ffmpeg/linux_x86-64.sh 2021-01-09 19:48:45.528724384 +0100
+@@ -8,8 +8,8 @@
+ ARCH="x86_64"
+
+ GENERAL="
+- --disable-shared \
+- --enable-static"
++ --enable-shared \
++ --disable-static"
+
+ MODULES="\
+ --disable-avdevice \
+@@ -83,7 +83,10 @@
+ ./configure \
+ --prefix=./linux/${ARCH} \
+ ${GENERAL} \
+- --extra-cflags="-D__STDC_CONSTANT_MACROS -O3" \
++ --cc=gcc \
++ --enable-rpath --disable-stripping \
++ --extra-cflags="-D__STDC_CONSTANT_MACROS ${CFLAGS}" \
++ --extra-ldflags="${LDFLAGS}" \
+ --enable-zlib \
+ --enable-pic \
+ --disable-yasm \
+@@ -99,5 +102,3 @@
+ ${PROTOCOLS} \
+ --arch=${ARCH}
+
+-make clean
+-make install
diff --git a/ppsspp.spec b/ppsspp.spec
index 059f770..b20d8e3 100644
--- a/ppsspp.spec
+++ b/ppsspp.spec
@@ -1,18 +1,45 @@
#
https://github.com/hrydgard/ppsspp/issues/8823
ExcludeArch: %{power64}
+# Filter private libraries
+%global _privatelibs libglslang
+%global _privatelibs %{_privatelibs}|libSPIRV
+%global _privatelibs %{_privatelibs}|libSPVRemapper
+%global _privatelibs %{_privatelibs}|ppsspp_libretro
+%global _privatelibs %{_privatelibs}|libavcodec
+%global _privatelibs %{_privatelibs}|libavformat
+%global _privatelibs %{_privatelibs}|libswscale
+%global _privatelibs %{_privatelibs}|libswresample
+%global _privatelibs %{_privatelibs}|libavutil
+%global __provides_exclude ^(%{_privatelibs})\\.so.*$
+%global __requires_exclude ^(%{_privatelibs})\\.so.*$
+#
+
# Disable LTO flags
# ... during IPA pass: pure-const
# lto1: internal compiler error: Segmentation fault
%define _lto_cflags %{nil}
-%if 0%{?el7}
-%global dts devtoolset-9-
-%endif
-
# -Wl,--as-needed breaks linking on fedora 30+
%undefine _ld_as_needed
+# Use bundled FFMpeg-3.0.2
+# See RPM Fusion bz#5889
+%if 0%{?fedora} > 32
+%bcond_without ffmpeg
+%else
+%bcond_with ffmpeg
+%endif
+%ifarch x86_64
+%global __arch x86_64
+%endif
+%ifarch %{arm}
+%global __arch armv7
+%endif
+%ifarch aarch64
+%global __arch aarch64
+%endif
+
%global commit 087de849bdc74205dd00d8e6e11ba17a591213ab
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global date 20200712
@@ -24,7 +51,17 @@ ExcludeArch: %{power64}
-DPYTHON_EXECUTABLE:FILEPATH=%{__python3} \\\
-Wno-dev -DARMIPS_REGEXP:BOOL=OFF \\\
-DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \\\
- -DUSE_FFMPEG:BOOL=ON -DUSE_SYSTEM_FFMPEG:BOOL=ON \\\
+ -DUSE_FFMPEG:BOOL=ON \\\
+%if %{with ffmpeg} \
+ -DUSE_SYSTEM_FFMPEG:BOOL=OFF \\\
+ -DFFmpeg_LIBRARY_avcodec:FILEPATH=${PWD}/ffmpeg/linux/%{__arch}/lib/libavcodec.so \\\
+ -DFFmpeg_LIBRARY_avformat:FILEPATH=${PWD}/ffmpeg/linux/%{__arch}/lib/libavformat.so \\\
+ -DFFmpeg_LIBRARY_avutil:FILEPATH=${PWD}/ffmpeg/linux/%{__arch}/lib/libavutil.so \\\
+ -DFFmpeg_LIBRARY_swresample:FILEPATH=${PWD}/ffmpeg/linux/%{__arch}/lib/libswresample.so
\\\
+ -DFFmpeg_LIBRARY_swscale:FILEPATH=${PWD}/ffmpeg/linux/%{__arch}/lib/libswscale.so \\\
+%else \
+ -DUSE_SYSTEM_FFMPEG:BOOL=ON \\\
+%endif \
-DUSE_SYSTEM_LIBZIP:BOOL=ON \\\
-DUSE_SYSTEM_SNAPPY:BOOL=ON \\\
%ifarch %{ix86} \
@@ -33,7 +70,7 @@ ExcludeArch: %{power64}
%ifarch %{arm} aarch64 \
-DARM:BOOL=ON \\\
%endif \
- %ifarch armv7l armv7hl armv7hnl \
+ %ifarch %{arm} \
-DARMV7:BOOL=ON \\\
%endif \
%ifarch x86_64 \
@@ -43,12 +80,13 @@ ExcludeArch: %{power64}
-DENABLE_GLSLANG_BINARIES:BOOL=OFF \\\
-DENABLE_HLSL:BOOL=OFF \\\
-DOPENGL_xmesa_INCLUDE_DIR:PATH= \\\
- -DHEADLESS=OFF -DZLIB_INCLUDE_DIR:PATH=%{_includedir}
+ -DHEADLESS=OFF -DZLIB_INCLUDE_DIR:PATH=%{_includedir} \\\
+ -DPNG_PNG_INCLUDE_DIR:PATH=%{_includedir}
Name: ppsspp
Version: 1.10.3
-Release: 6%{?dist}
+Release: 7%{?dist}
Summary: A PSP emulator
License: BSD and GPLv2+
URL:
https://www.ppsspp.org/
@@ -57,19 +95,19 @@ URL:
https://www.ppsspp.org/
## We need to checkout it, then download relative submodules
## which are not included in the source code:
##
-# git clone
https://github.com/hrydgard/ppsspp.git
-# cd ppsspp && git checkout %%{commit}
-# git submodule update --init ext/armips
-# git submodule update --init ext/glslang
-# git submodule update --init ext/SPIRV-Cross
-# git submodule update --init ext/discord-rpc
-# git clone
https://github.com/hrydgard/ppsspp-lang
-# rm -rf ppsspp-lang/.git
+# git clone -b v1.10.3 --depth 1 --single-branch --progress --recursive
https://github.com/hrydgard/ppsspp.git
+# cd ppsspp/ffmpeg && git checkout 4738685f4ac27c1775a238d1e602f399627b5e6f
+# rm -rf ios Windows* windows* macosx blackberry* gas-preprocessor symbian* wiiu
# cd ..
+# rm -rf ios Windows* windows* macosx blackberry* symbian*
+# rm -rf dx9sdk pspautotests
+# cd ..
+# find ppsspp/android -perm /644 -type f \( -name "*.a" \) -exec rm -f {}
';'
+# rm -rf ppsspp-lang/.git
# rm -rf ppsspp/.git ppsspp/.gitignore
-# tar -czvf ppsspp-%%{version}.tar.gz ppsspp
+# tar -czvf ppsspp-ffmpeg-%%{version}.tar.gz ppsspp
##
-Source0: ppsspp-%{version}.tar.gz
+Source0: %{name}-ffmpeg-%{version}.tar.gz
Source1: %{name}.desktop
Source2: %{name}.appdata.xml
Source3: %{name}-qt.desktop
@@ -82,30 +120,32 @@ Source5: %{name}-qt-wayland.desktop
Patch0: %{name}-1.1.0-git-version.patch
Patch1: %{name}-1.10.0-remove_unrecognized_flag.patch
+Patch2: %{name}-ffmpeg-set_x64_build_flags.patch
+Patch3: %{name}-ffmpeg-set_aarch64_build_flags.patch
+Patch4: %{name}-ffmpeg-set_arm_build_flags.patch
+
BuildRequires: pkgconfig(egl)
BuildRequires: pkgconfig(glesv2)
-%if 0%{?fedora} && 0%{?fedora} > 31
-BuildRequires: pkgconfig(opengl)
-%endif
-%if 0%{?fedora} && 0%{?fedora} < 32
-BuildRequires: pkgconfig(libglvnd)
-%endif
+BuildRequires: pkgconfig(opengl)
%{?fedora:BuildRequires: pkgconfig(libpng)}
%{?el7:BuildRequires: libglvnd-devel}
%{?el7:BuildRequires: pkgconfig(libpng)}
%{?el8:BuildRequires: pkgconfig(libpng16)}
-BuildRequires: pkgconfig(glew)
BuildRequires: cmake3
BuildRequires: make
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools
-BuildRequires: chrpath
+BuildRequires: patchelf
BuildRequires: desktop-file-utils
+%if %{without ffmpeg}
BuildRequires: ffmpeg-devel
+%endif
+BuildRequires: pkgconfig(glew)
+BuildRequires: pkgconfig(glu)
BuildRequires: wayland-devel
BuildRequires: snappy-devel
BuildRequires: SDL2-devel
-BuildRequires: %{?dts}gcc, %{?dts}gcc-c++
+BuildRequires: gcc gcc-c++
BuildRequires: libzip-devel
BuildRequires: snappy-devel
BuildRequires: zlib-devel
@@ -128,6 +168,15 @@ Data files of %{name}.
%package libs
Summary: PPSSPP private libraries
+%if %{with ffmpeg}
+License: GPLv3+ and LGPLv2+
+Provides: bundled(ffmpeg) = 0:3.0.2
+Provides: bundled(libavcodec) = 57
+Provides: bundled(libavformat) = 57
+Provides: bundled(libavutil) = 57
+Provides: bundled(libswresample) = 2
+Provides: bundled(libswscale) = 4
+%endif
%description libs
Private libraries used by PPSSPP.
@@ -150,10 +199,22 @@ PPSSPP with Qt5 frontend wrapper.
%prep
-%autosetup -n %{name} -p1
+%autosetup -n %{name} -N
-# Remove bundled libzip libraries
+%patch0 -p1 -b .backup
+%patch1 -p1 -b .backup
+%patch2 -p1 -b .backup
+%patch3 -p1 -b .backup
+%patch4 -p1 -b .backup
+
+# Remove bundled libraries
rm -rf /ext/native/ext/libzip
+rm -rf /ext/rapidjson
+rm -rf /ext/glew
+rm -rf /ext/zlib
+%if %{without ffmpeg}
+rm -rf ffmpeg
+%endif
# Set version
sed -e 's|@@unknown_version@@|%{version}|g' -i git-version.cmake
@@ -176,16 +237,40 @@ find ext Core -perm /755 -type f \( -name "*.cpp" -o -name
"*.h" -o -name "*.hpp
%build
-mkdir -p build
-export LDFLAGS="%{__global_ldflags} -fPIC"
-export CC=gcc
-export CXX=g++
+# Build bundled ffmpeg's shared libraries
+# 'make install' command moves compiled libraries into linux/arch/lib directory
+%if %{with ffmpeg}
+
+# Remove pre-compiled ffmpeg static libraries
+find ffmpeg -type f \( -name "*.a" \) -exec rm -f {} ';'
+
+pushd ffmpeg
+export CFLAGS="%{optflags}"
+export LDFLAGS="%{__global_ldflags}"
-%if 0%{?el7}
-%{?dts:source /opt/rh/devtoolset-9/enable}
+%ifarch x86_64
+sh -x ./linux_x86-64.sh
+%make_build
+make install
+%endif
+
+%ifarch aarch64
+sh -x ./linux_arm64.sh
+%make_build
+make install
+%endif
+
+%ifarch %{arm}
+sh -x ./linux_arm.sh
+%make_build
+make install
+%endif
+popd
%endif
+#
+mkdir -p build
%if %{with debug}
export CXXFLAGS="-O0 -g -fPIC"
export CFLAGS="-O0 -g -fPIC"
@@ -204,14 +289,6 @@ export CFLAGS="-O0 -g -fPIC"
%make_build -C build
mkdir -p build2
-export LDFLAGS="%{__global_ldflags} -fPIC"
-export CC=gcc
-export CXX=g++
-
-%if 0%{?el7}
-%{?dts:source /opt/rh/devtoolset-9/enable}
-%endif
-
%if %{with debug}
export CXXFLAGS="-O0 -g -fPIC"
export CFLAGS="-O0 -g -fPIC"
@@ -239,21 +316,34 @@ install -pm 755 build/PPSSPPSDL %{buildroot}%{_bindir}/
# Install libraries
mkdir -p %{buildroot}%{_libdir}/%{name}
-cp -a build2/lib/*.a %{buildroot}%{_libdir}/%{name}/
-cp -a build2/lib/*.so %{buildroot}%{_libdir}/%{name}/
-
-cp -u build/lib/*.a %{buildroot}%{_libdir}/%{name}/
-cp -u build/lib/*.so %{buildroot}%{_libdir}/%{name}/
+cp -a build2/lib/*.so* %{buildroot}%{_libdir}/%{name}/
+cp -u build/lib/*.so* %{buildroot}%{_libdir}/%{name}/
+
+%if %{with ffmpeg}
+pushd ffmpeg/linux/%{__arch}/lib
+install -pm 755 *.so* %{buildroot}%{_libdir}/%{name}/
+popd
+pushd %{buildroot}%{_libdir}/%{name}
+ln -sf libavcodec.so.57.24.102 libavcodec.so.57
+ln -sf libavcodec.so.57.24.102 libavcodec.so
+ln -sf libavformat.so.57.25.100 libavformat.so.57
+ln -sf libavformat.so.57.25.100 libavformat.so
+ln -sf libavutil.so.55.17.103 libavutil.so.55
+ln -sf libavutil.so.55.17.103 libavutil.so
+ln -sf libswresample.so.2.0.101 libswresample.so.2
+ln -sf libswresample.so.2.0.101 libswresample.so
+ln -sf libswscale.so.4.0.100 libswscale.so.4
+ln -sf libswscale.so.4.0.100 libswscale.so
+popd
+%endif
# Fix rpaths
-chrpath -r %{_libdir}/%{name} %{buildroot}%{_bindir}/PPSSPP*
-chrpath -d %{buildroot}%{_libdir}/%{name}/*.so
+patchelf --set-rpath %{_libdir}/%{name} %{buildroot}%{_bindir}/PPSSPP*
+patchelf --set-rpath %{_libdir}/%{name} %{buildroot}%{_libdir}/%{name}/*.so*
# Install data files
mkdir -p %{buildroot}%{_datadir}/%{name}
cp -a build2/assets %{buildroot}%{_datadir}/%{name}/
-
-install -pm 644 ppsspp-lang/*.ini %{buildroot}%{_datadir}/%{name}/assets/lang/
install -pm 644 Qt/languages/*.ts %{buildroot}%{_datadir}/%{name}/assets/lang/
install -pm 644 korean.txt %{buildroot}%{_datadir}/%{name}/assets/lang/korean.ini
install -pm 644 chinese.txt %{buildroot}%{_datadir}/%{name}/assets/lang/chinese.ini
@@ -310,6 +400,9 @@ fi
%files libs
%doc README.md
%license LICENSE.TXT
+%if %{with ffmpeg}
+%license ffmpeg/COPYING* ffmpeg/LICENSE.md
+%endif
%{_libdir}/%{name}/
%files data
@@ -320,6 +413,9 @@ fi
%{_datadir}/icons/%{name}/
%changelog
+* Sat Jan 09 2021 Antonio Trande <sagitter(a)fedoraproject.org> - 1.10.3-7
+- Use bundled FFMpeg-3.0.2 in Fedora 34 (RPM Fusion bz#5889)
+
* Fri Jan 1 2021 Leigh Scott <leigh123linux(a)gmail.com> - 1.10.3-6
- Rebuilt for new ffmpeg snapshot
diff --git a/sources b/sources
index a216734..3e21c0e 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (ppsspp-1.10.3.tar.gz) =
2e806f4b1dbff0bc5cb99ccb9f2d895f3252217011d7c78e7598478eb246481378ce4a6f2ca577f8a0d7298eecae417d063872c5be0256ebb07cb87b5faa8127
+SHA512 (ppsspp-ffmpeg-1.10.3.tar.gz) =
091a514a284c1eb6260d5752b2e7dc26e50adb75aab9f7ccdc3ab1f18770a799d2177b97ba8ccbfb913523e00307170818608be720769206c65553e5f4bd9383