Bug 280958

Summary: emulators/mednafen: update to 1.32.1 and consolidate port
Product: Ports & Packages Reporter: Stefan Schlosser <bsdcode>
Component: Individual Port(s)Assignee: Jose Alonso Cardenas Marquez <acm>
Status: Closed FIXED    
Severity: Affects Only Me Flags: bugzilla: maintainer-feedback? (acm)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
URL: https://mednafen.github.io/documentation/ChangeLog.txt
Attachments:
Description Flags
update emulators/mednafen none

Description Stefan Schlosser 2024-08-21 00:37:31 UTC
Created attachment 252968 [details]
update emulators/mednafen

While updating the port I realized some obsolete parts in the port which give opportunity for improvements.

Aside from general cleanups in the LIB_DEPENDS, USES, USE_*, OPTIONS_* and *_DESC sections, some patches are not needed anymore. Especially everything relating to Joystick can be dropped, because it's now handled correctly upstream.

Most bundled libraries are available in the ports tree, so I used these (see CONFIGURE_ARGS+= --with-external-*). Special attention to audio/libtremor: it got removed last year from the ports tree. I used the drop-in replacement libvorbisfile.so:audio/libvorbis and applied some patches so mednafen actually uses it as replacement instead of tremor.

I added ALSA to the audio options, enabled by default. ALSA is the prioritized backend upstream, so when ALSA support is compiled in it will be used instead of the OSS backend with the default "sound.driver default" setting in mednafen.cfg. I added a patch to set "sound.device sexyal-literal-default" by default in mednafen.cfg, because "sound.device default" tries to use "hw:0" for the ALSA device which is not available on FreeBSD. "sexyal-literal-default" uses the true default value, which is "pcm.default" under the hood I assume. So this patch ensures users have working audio right from the start without searching and fiddling around with the configuration file.


Changelog:
https://mednafen.github.io/documentation/ChangeLog.txt

Port changes:
  * consolidate LIB_DEPENDS, USES, USE_*, OPTIONS_*, *_DESC and patches
  * unbundle external libraries
  * ALSA: add support, enabled by default
  * DOCS: install complete documentation
  * SS: remove hardcoded -mtune=haswell
  * pkg-message: add OSS section
  * pet portclippy(1), portfmt(1)
Comment 1 commit-hook freebsd_committer freebsd_triage 2024-09-09 22:31:57 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a64dfb2870a63c038e7e028a75528f193e84dcfb

commit a64dfb2870a63c038e7e028a75528f193e84dcfb
Author:     Stefan Schlosser <bsdcode@disroot.org>
AuthorDate: 2024-09-09 22:28:22 +0000
Commit:     Jose Alonso Cardenas Marquez <acm@FreeBSD.org>
CommitDate: 2024-09-09 22:30:56 +0000

    emulators/mednafen: Update to 1.32.1

    * consolidate LIB_DEPENDS, USES, USE_*, OPTIONS_*, *_DESC and patches
    * unbundle external libraries
    * ALSA: add support, enabled by default
    * DOCS: install complete documentation
    * SS: remove hardcoded -mtune=haswell
    * pkg-message: add OSS section
    * pet portclippy(1), portfmt(1)

    PR:             280021 280958

 emulators/mednafen/Makefile                        | 165 ++++++++++++---------
 emulators/mednafen/distinfo                        |   6 +-
 .../files/extra-patch-src_drivers_main.cpp (new)   |  11 ++
 emulators/mednafen/files/patch-configure.ac (new)  |  26 ++++
 .../files/patch-src-drivers_Joystick.cpp (gone)    |  20 ---
 .../patch-src_cdrom_CDAFReader__Vorbis.cpp (new)   |  20 +++
 ...atch-src_sound_OwlResampler__altivec.inc (gone) |   7 -
 emulators/mednafen/files/pkg-message.in            |  14 +-
 emulators/mednafen/pkg-plist                       |  64 +++++++-
 9 files changed, 231 insertions(+), 102 deletions(-)
Comment 2 Jose Alonso Cardenas Marquez freebsd_committer freebsd_triage 2024-09-09 22:33:25 UTC
Committed thanks!