SHA256
1
0
forked from pool/retroarch

- Remove retroarch-config.patch and use upstream config and updater

- Remove cores dependencies and prefer downloading from upstream
- Add retroarch_migrate_config.py and run it after installation

OBS-URL: https://build.opensuse.org/package/show/Emulators/retroarch?expand=0&rev=58
This commit is contained in:
Yunhe Guo 2022-02-19 10:16:19 +00:00 committed by Git OBS Bridge
parent f52c944b9b
commit 7e49c551a1
4 changed files with 37 additions and 179 deletions

View File

@ -1,78 +0,0 @@
diff -rub retroarch.orig/retroarch.cfg retroarch/retroarch.cfg
--- retroarch.orig/retroarch.cfg 2019-11-02 16:28:42.045539778 +0200
+++ retroarch/retroarch.cfg 2019-11-06 20:21:31.990684917 +0200
@@ -642,7 +642,7 @@
# menu_show_online_updater = true
# If disabled, will hide the ability to update cores (and core info files) inside the menu.
-# menu_show_core_updater = true
+menu_show_core_updater = false
# If disabled, the libretro core will keep running in the background when we
# are in the menu.
@@ -771,7 +771,7 @@
# Assets directory. This location is queried by default when menu interfaces try to look for
# loadable assets, etc.
-# assets_directory =
+assets_directory = /usr/share/libretro/assets
# Dynamic wallpapers directory. The place to store the wallpapers dynamically
# loaded by the menu depending on context.
@@ -781,31 +781,31 @@
# thumbnails_directory =
# File browser directory. Sets start directory for menu file browser.
-# rgui_browser_directory =
+rgui_browser_directory = ~/
# Core directory for libretro core implementations.
-# libretro_directory =
+libretro_directory = /usr/lib/libretro
# Core info directory for libretro core information.
-# libretro_info_path =
+libretro_info_path = /usr/share/libretro/info
# Path to content database directory.
-# content_database_path =
+content_database_path = /usr/share/libretro/database/rdb
# Saved queries are stored to this directory.
-# cursor_directory =
+cursor_directory = /usr/share/libretro/database/cursors
# Path to cheat database directory.
-# cheat_database_path =
+cheat_database_path = /usr/share/libretro/database/cht
# Defines a directory where CPU-based video filters are kept.
-# video_filter_dir =
+video_filter_dir = /usr/lib/libretro/filters/video
# Directory where DSP plugins are kept.
-# audio_filter_dir =
+audio_filter_dir = /usr/lib/libretro/filters/audio
# Defines a directory where shaders (Cg, CGP, GLSL) are kept for easy access.
-# video_shader_dir =
+video_shader_dir = /usr/share/libretro/shaders
# Recording output directory. Where recordings are saved.
# recording_output_directory =
@@ -825,7 +825,7 @@
# Input binds which are made explicit (input_playerN_*_btn/axis) will take priority over autoconfigs.
# Autoconfigs can be created with retroarch-joyconfig, manually, or with a frontend.
# Requires input_autodetect_enable to be enabled.
-# joypad_autoconfig_dir =
+joypad_autoconfig_dir = /usr/share/libretro/autoconfig
# Save all remapped controls to this directory.
# input_remapping_directory =
@@ -913,3 +913,6 @@
# Enable device vibration for supported cores
# enable_device_vibration = false
+# Download thumbnails from network on demand
+network_on_demand_thumbnails = true
+

View File

@ -1,6 +1,9 @@
-------------------------------------------------------------------
Sat Feb 19 04:06:41 UTC 2022 - Yunhe Guo <i@guoyunhe.me>
- Remove retroarch-config.patch and use upstream config and updater
- Remove cores dependencies and prefer downloading from upstream
- Add retroarch_migrate_config.py and run it after installation
- Update to version 1.10.0
* ARCHIVE: Allow loading files from archive subdirectory
* AUDIO: Remove frame limit from audio batch callback. Before, if

View File

@ -23,8 +23,8 @@ Summary: Emulator frontend
License: GPL-3.0-only
Group: System/Emulators/Other
URL: http://www.retroarch.com
Source: %{name}-%{version}.tar.gz
Patch0: retroarch-config.patch
Source0: %{name}-%{version}.tar.gz
Source1: %{name}_migrate_old_config.py
BuildRequires: fdupes
BuildRequires: gcc-c++
@ -74,101 +74,6 @@ BuildRequires: pkgconfig(libavutil)
BuildRequires: pkgconfig(libswscale)
%endif
# Shared data
Recommends: retroarch-joypad-autoconfig
Recommends: libretro-core-info
Recommends: libretro-database
Recommends: libretro-glsl-shaders
Recommends: retroarch-assets
# Emulation cores
# Arcade/MAME
# MAME 2003 Plus has the best performance, supporting most games before 2000
Recommends: libretro-mame2003-plus
# Atari 2600
Recommends: libretro-stella
# Atari 5200
Recommends: libretro-atari800
# Atari 7800
Recommends: libretro-prosystem
# Atari Jaguar
Recommends: libretro-virtualjaguar
# Atari Lynx
Recommends: libretro-handy
# Nintendo Entertainment System (NES)
Recommends: libretro-nestopia
# Super Nintendo Entertainment System (SNES)
Recommends: libretro-bsnes
# Nintendo 64 (N64)
Recommends: libretro-parallel-n64
# GameCube (GC) and Wii (not fully working yet)
Recommends: libretro-dolphin
# Nintendo Game Boy Color (GBC)
Recommends: libretro-gambatte
# Nintendo Game Boy Advance (GBA)
Recommends: libretro-mgba
# Nintendo DS (NDS)
Recommends: libretro-desmume
# Nintendo 3DS (3DS)
Recommends: libretro-citra
# Sega Genesis/Mega Drive (MD)
Recommends: libretro-picodrive
# Sega Saturn (SS)
Recommends: libretro-yabause
# Sega Dreamcast (DC)
Recommends: libretro-flycast
# Sony PlayStation (PSX)
%ifarch armv6l armv6hl armv7l armv7hl aarch64
Recommends: libretro-pcsx-rearmed
%else
Recommends: libretro-beetle-psx-hw
%endif
# Sony PlayStation 2 (PS2)
Recommends: libretro-play
# Sony PlayStation Portable (PSP)
Recommends: libretro-ppsspp
# Amstrad
Recommends: libretro-crocods
# Amstrad CPC
Recommends: libretro-cap32
# Bandai WonderSwan
Recommends: libretro-beetle-wswan
# Fairchild ChannelF
Recommends: libretro-freechaf
# Game & Watch
Recommends: libretro-gw
# Mattel Intellivision
Recommends: libretro-freeintv
# MS DOS
Recommends: libretro-dosbox
# MSX
Recommends: libretro-bluemsx
# Neo Geo Pocket
Recommends: libretro-beetle-ngp
# PC Engine/TurboGrafx-16
Recommends: libretro-beetle-pce-fast
# ZX 81
Recommends: libretro-81
# ZX Spectrum
Recommends: libretro-fuse
# Game and game engine cores
Recommends: libretro-2048
Recommends: libretro-3dengine
Recommends: libretro-chailove
Recommends: libretro-craft
Recommends: libretro-easyrpg
Recommends: libretro-ffmpeg
Recommends: libretro-gme
%description
RetroArch is a modular multi-system emulator system that is designed to be
fast, lightweight, and portable. It has features few other emulators frontends
@ -177,10 +82,6 @@ have, such as real-time rewinding and game-aware shading.
%prep
%setup -q
%autopatch -p1
# Change /usr/lib/ to /usr/lib64/ on 64-bit platform
sed -i s~/usr/lib/~%{_libdir}/~g retroarch.cfg
# Change /usr/bin/env python to /usr/bin/python
sed -i s~%{_bindir}/env\ python~%{_bindir}/python~g tools/cg2glsl.py
@ -228,12 +129,17 @@ make %{?_smp_mflags}
%install
%make_install
install -m 0755 %{SOURCE1} %{buildroot}%{_bindir}/%{name}_migrate_old_config
%fdupes %{buildroot}
%post
%{_bindir}/%{name}_migrate_old_config
%files
%config(noreplace) %{_sysconfdir}/%{name}.cfg
%{_bindir}/%{name}
%{_bindir}/%{name}_migrate_old_config
%{_bindir}/%{name}-cg2glsl
%{_datadir}/applications/%{name}.desktop
%{_datadir}/metainfo/com.libretro.*.xml

View File

@ -0,0 +1,27 @@
#!/usr/bin/python3
import glob
config_files = glob.glob('/home/*/.config/retroarch/retroarch.cfg')
for config_file in config_files:
fin = open(config_file, 'rt')
data = fin.read()
fin.close()
# revert patched config with upstream config
data = data.replace('assets_directory = "/usr/share/libretro/assets"', 'assets_directory = "~/.config/retroarch/assets"')
data = data.replace('audio_filter_dir = "/usr/lib64/libretro/filters/audio"', 'audio_filter_dir = "~/.config/retroarch/filters/audio"')
data = data.replace('cheat_database_path = "/usr/share/libretro/database/cht"', 'cheat_database_path = "~/.config/retroarch/cheats"')
data = data.replace('content_database_path = "/usr/share/libretro/database/rdb"', 'content_database_path = "~/.config/retroarch/database/rdb"')
data = data.replace('cursor_directory = "/usr/share/libretro/database/cursors"', 'cursor_directory = "~/.config/retroarch/database/cursors"')
data = data.replace('joypad_autoconfig_dir = "/usr/share/libretro/autoconfig"', 'joypad_autoconfig_dir = "~/.config/retroarch/autoconfig"')
data = data.replace('libretro_directory = "/usr/lib64/libretro"', 'libretro_directory = "~/.config/retroarch/cores"')
data = data.replace('libretro_info_path = "/usr/share/libretro/info"', 'libretro_info_path = "~/.config/retroarch/cores"')
data = data.replace('menu_show_core_updater = "false"', 'menu_show_core_updater = "true"')
data = data.replace('video_filter_dir = "/usr/lib64/libretro/filters/video"', 'video_filter_dir = "~/.config/retroarch/filters/video"')
data = data.replace('video_shader_dir = "/usr/share/libretro/shaders"', 'video_shader_dir = "~/.config/retroarch/shaders"')
fout = open(config_file, 'wt')
fout.write(data)
fout.close()