263 lines
7.0 KiB
RPMSpec
263 lines
7.0 KiB
RPMSpec
#
|
|
# spec file for package ppsspp
|
|
#
|
|
# Copyright (c) 2021 SUSE LLC
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
%define _lto_cflags %{nil}
|
|
Name: ppsspp
|
|
Version: 1.12~git20211007
|
|
Release: 0
|
|
Summary: PlayStation Portable Emulator
|
|
License: GPL-2.0-or-later
|
|
Group: System/Emulators/Other
|
|
URL: http://www.ppsspp.org
|
|
Source: %{name}-%{version}.tar.xz
|
|
BuildRequires: Mesa-devel
|
|
BuildRequires: cmake >= 3.6
|
|
BuildRequires: fdupes
|
|
BuildRequires: gcc-c++
|
|
BuildRequires: glslang-devel
|
|
BuildRequires: pkgconfig
|
|
BuildRequires: snappy-devel
|
|
BuildRequires: unzip
|
|
BuildRequires: pkgconfig(libavcodec)
|
|
BuildRequires: pkgconfig(libavdevice)
|
|
BuildRequires: pkgconfig(libavfilter)
|
|
BuildRequires: pkgconfig(libavformat)
|
|
BuildRequires: pkgconfig(libavutil)
|
|
BuildRequires: pkgconfig(libpostproc)
|
|
BuildRequires: pkgconfig(libswresample)
|
|
BuildRequires: pkgconfig(libswscale)
|
|
#Desktop icon deps
|
|
BuildRequires: update-desktop-files
|
|
BuildRequires: wayland-devel
|
|
#Qt deps:
|
|
BuildRequires: pkgconfig(Qt5Core)
|
|
BuildRequires: pkgconfig(Qt5Multimedia)
|
|
BuildRequires: pkgconfig(Qt5OpenGL)
|
|
BuildRequires: pkgconfig(gl)
|
|
BuildRequires: pkgconfig(glew)
|
|
BuildRequires: pkgconfig(libpng)
|
|
BuildRequires: pkgconfig(libzip)
|
|
BuildRequires: pkgconfig(sdl2)
|
|
BuildRequires: pkgconfig(vulkan)
|
|
BuildRequires: pkgconfig(zlib)
|
|
Requires: %{name}-common
|
|
Requires(post): hicolor-icon-theme
|
|
Requires(postun):hicolor-icon-theme
|
|
# never built for PowerPC/Arm on 20200721
|
|
ExcludeArch: aarch64 %arm ppc ppc64 ppc64le s390x
|
|
|
|
%description
|
|
PPSSPP is a PSP emulator written in C++, and translates PSP CPU instructions directly into optimized x86, x64 and ARM machine code, using JIT recompilers (dynarecs).
|
|
|
|
%package headless
|
|
Summary: PPSSPP headless
|
|
Group: System/Emulators/Other
|
|
Requires: %{name}-common
|
|
|
|
%description headless
|
|
PPSSPP headless build
|
|
|
|
%package qt
|
|
Summary: PPSSPP Qt backend
|
|
Group: System/Emulators/Other
|
|
Requires: %{name}-common
|
|
|
|
%description qt
|
|
PPSSPP build using the Qt framework
|
|
|
|
%package common
|
|
Summary: PPSSPP assets
|
|
Group: System/Emulators/Other
|
|
|
|
%description common
|
|
Required assets for PPSSPP GUI and assorted configuration files
|
|
|
|
%prep
|
|
%setup -q
|
|
|
|
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.
|
|
|
|
const char *PPSSPP_GIT_VERSION = \"%{version}\";
|
|
|
|
// If you don't want this file to update/recompile, change to 1.
|
|
#define PPSSPP_GIT_VERSION_NO_UPDATE 1
|
|
" > git-version.cpp
|
|
|
|
%build
|
|
|
|
mkdir build-headless build-qt build
|
|
|
|
cd build-headless
|
|
cmake .. \
|
|
-DUSE_SYSTEM_FFMPEG="ON" \
|
|
-DHEADLESS="ON" \
|
|
-DCMAKE_C_FLAGS="%optflags" \
|
|
-DCMAKE_CXX_FLAGS="%optflags" \
|
|
-DCMAKE_BUILD_TYPE="Release|RelWithDebugInfo" \
|
|
-DCMAKE_SKIP_RPATH="YES" \
|
|
-Wno-dev
|
|
%make_jobs
|
|
|
|
cd ../build-qt
|
|
cmake .. \
|
|
-DUSE_SYSTEM_FFMPEG="ON" \
|
|
-DUSING_QT_UI="ON" \
|
|
-DCMAKE_C_FLAGS="%optflags" \
|
|
-DCMAKE_CXX_FLAGS="%optflags" \
|
|
-DCMAKE_BUILD_TYPE="Release|RelWithDebugInfo" \
|
|
-DCMAKE_SKIP_RPATH="YES" \
|
|
-Wno-dev
|
|
%make_jobs
|
|
|
|
cd ../build
|
|
cmake .. \
|
|
-DUSE_SYSTEM_FFMPEG="ON" \
|
|
-DCMAKE_C_FLAGS="%optflags" \
|
|
-DCMAKE_CXX_FLAGS="%optflags" \
|
|
-DCMAKE_BUILD_TYPE="Release|RelWithDebugInfo" \
|
|
-DCMAKE_SKIP_RPATH="YES" \
|
|
-Wno-dev
|
|
|
|
%make_jobs
|
|
|
|
%install
|
|
mkdir -p %{buildroot}%{_bindir}
|
|
mkdir -p %{buildroot}%{_libexecdir}/%{name}
|
|
mkdir -p %{buildroot}%{_sysconfdir}/%{name}
|
|
|
|
#setup wrapper(s)
|
|
|
|
##----------------####----------------####----------------####----------------##
|
|
|
|
touch %{buildroot}%{_sysconfdir}/%{name}/%{name}-headless.env
|
|
|
|
cat > %{buildroot}%{_bindir}/%{name}-headless << 'EOF'
|
|
#!/bin/sh
|
|
|
|
#Mark all sourced variables for export
|
|
set -a
|
|
|
|
#Do not edit this file!
|
|
#Use %{_sysconfdir}/%{name}/%{name}-headless.env to set environment variables
|
|
. %{_sysconfdir}/%{name}/%{name}-headless.env
|
|
|
|
exec %{_libexecdir}/%{name}/%{name}-headless "$@"
|
|
|
|
EOF
|
|
|
|
##----------------####----------------####----------------####----------------##
|
|
|
|
touch %{buildroot}%{_sysconfdir}/%{name}/%{name}-qt.env
|
|
|
|
cat > %{buildroot}%{_bindir}/%{name}-qt << 'EOF'
|
|
#!/bin/sh
|
|
|
|
#Mark all sourced variables for export
|
|
set -a
|
|
|
|
#Do not edit this file!
|
|
#Use %{_sysconfdir}/%{name}/%{name}-qt.env to set environment variables
|
|
. %{_sysconfdir}/%{name}/%{name}-qt.env
|
|
|
|
exec %{_libexecdir}/%{name}/%{name}-qt "$@"
|
|
|
|
EOF
|
|
|
|
##----------------####----------------####----------------####----------------##
|
|
|
|
touch %{buildroot}%{_sysconfdir}/%{name}/%{name}.env
|
|
|
|
cat > %{buildroot}%{_bindir}/%{name} << 'EOF'
|
|
#!/bin/sh
|
|
|
|
#Mark all sourced variables for export
|
|
set -a
|
|
|
|
#Do not edit this file!
|
|
#Use %{_sysconfdir}/%{name}/%{name}.env to set environment variables
|
|
. %{_sysconfdir}/%{name}/%{name}.env
|
|
|
|
exec %{_libexecdir}/%{name}/%{name} "$@"
|
|
|
|
EOF
|
|
|
|
##----------------####----------------####----------------####----------------##
|
|
|
|
#install files
|
|
install -m 755 -D build-headless/PPSSPPHeadless %{buildroot}%{_libexecdir}/%{name}/%{name}-headless
|
|
|
|
install -m 755 -D build-qt/PPSSPPQt %{buildroot}%{_libexecdir}/%{name}/%{name}-qt
|
|
|
|
install -m 755 -D build/PPSSPPSDL %{buildroot}%{_libexecdir}/%{name}/%{name}
|
|
|
|
mv assets %{buildroot}%{_libexecdir}/%{name}/
|
|
mkdir -p %{buildroot}%{_datadir}/pixmaps
|
|
install -m 444 -D icons/icon.svg %{buildroot}%{_datadir}/pixmaps/%{name}.svg
|
|
%suse_update_desktop_file -c %{name} PPSSPP 'PSP Emulator' %{name} %{name} System Emulator
|
|
%suse_update_desktop_file -c %{name}-qt PPSSPPQt 'PSP Emulator' %{name}-qt %{name} System Emulator
|
|
|
|
%fdupes %{buildroot}
|
|
|
|
%post
|
|
%desktop_database_post
|
|
%icon_theme_cache_post
|
|
|
|
%postun
|
|
%desktop_database_postun
|
|
%icon_theme_cache_postun
|
|
|
|
%files headless
|
|
%defattr(644,root,root)
|
|
%attr(755,root,root) %{_bindir}/%{name}-headless
|
|
%attr(755,root,root) %{_libexecdir}/%{name}/%{name}-headless
|
|
|
|
%files qt
|
|
%defattr(644,root,root)
|
|
%attr(755, root, root) %{_bindir}/%{name}-qt
|
|
%attr(755, root, root) %{_libexecdir}/%{name}/%{name}-qt
|
|
%{_datadir}/applications/%{name}-qt.desktop
|
|
|
|
%files common
|
|
%defattr(644,root,root)
|
|
%doc README.md
|
|
%license LICENSE.TXT
|
|
%{_libexecdir}/%{name}/assets
|
|
%{_datadir}/pixmaps/%{name}.svg
|
|
|
|
%config(noreplace) %{_sysconfdir}/%{name}
|
|
|
|
%files
|
|
%defattr(644,root,root)
|
|
%dir %{_libexecdir}/%{name}
|
|
%attr(755, root, root) %{_bindir}/%{name}
|
|
%attr(755, root, root) %{_libexecdir}/%{name}/%{name}
|
|
%{_datadir}/applications/%{name}.desktop
|
|
|
|
%changelog
|