Bug 225453 - games/chocolate-doom: Update to 3.0.0
Summary: games/chocolate-doom: Update to 3.0.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Steve Wills
URL:
Keywords: needs-qa, patch
Depends on:
Blocks:
 
Reported: 2018-01-25 15:46 UTC by Shirkdog
Modified: 2019-01-15 14:25 UTC (History)
3 users (show)

See Also:
jakub_lach: maintainer-feedback+


Attachments
patch to port to get things to 3.0 (2.05 KB, patch)
2018-01-25 15:48 UTC, Shirkdog
no flags Details | Diff
new pkg-message to thoroughly explain how to configure music (1.27 KB, text/plain)
2018-06-01 04:29 UTC, Patrick McMunn
no flags Details
chocolate-doom 3.0.0 patch (4.25 KB, patch)
2018-06-03 22:20 UTC, jakub_lach
no flags Details | Diff
chocolate-doom 3.0.0 patch (4.20 KB, patch)
2018-06-03 22:32 UTC, jakub_lach
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Shirkdog 2018-01-25 15:46:47 UTC

    
Comment 1 Shirkdog 2018-01-25 15:48:27 UTC
Created attachment 190059 [details]
patch to port to get things to 3.0
Comment 2 Shirkdog 2018-01-25 15:51:45 UTC
chocolate-doom 3.0 now uses sdl2, so just made the updates to the Makefile and the distinfo with the attached patch and things seem to build for me. 

I did not touch the plist.
Comment 3 jakub_lach 2018-01-25 19:33:13 UTC
Thanks for noticing the update, portscout has failed me this time.

Were you able to test fluidsynth/MIDI support? Though chocolate-doom has it's OPL emulation, the former is default dependency for sdl2mixer.
Comment 4 Shirkdog 2018-01-25 20:47:27 UTC
(In reply to jakub_lach from comment #3)

Sound is working, I tested Music with "OPL (Adlib/Soundblaster)" and "Native MIDI" and things appear to be working. 

Let me know how to test this specifically.
Comment 5 jakub_lach 2018-01-25 21:00:11 UTC
It's about soundtrack, Native MIDI depends on Timidity, which is no longer required dependency for a sdl(2)mixer, and I couldn't build sdl2mixer with fluidsynth here. OPL2/3 is emulated and indeed works as before, maybe just a different pkg-message is in order, as we also have a new place for a configuration files.
Comment 6 jakub_lach 2018-02-25 21:16:17 UTC
Any feedback? Not sure how many/if any user values various replay options, making a chocolate-legacy just to support those looks a bit overkill.
Comment 7 Patrick McMunn 2018-05-29 23:59:41 UTC
I've tested 3.0.0 on my desktop and a netbook. On both machines, OPL music worked fine. On the netbook, Gravis Ultrasound didn't work until I downloaded and installed the GUS patches from https://www.chocolate-doom.org/wiki/index.php/GUS . Native MIDI didn't work. On the desktop, all 3 worked (though GUS didn't sound as good because I hadn't installed the patches). As it turned out, I already had Timidity installed on the desktop, so that appears to be why the GUS and native MIDI worked.

So everything seems to be working just fine with 3.0.0. Why not just add an optional runtime dependency in the chocolate-doom-3.0.0 port to depend on either Timidity or Timidity++? That way GUS or native MIDI is ready to go. Problem solved.

And if Timidity or Timidity++ is enabled, offer the option to pull in audio/guspats (for Gravis Ultrasound), audio/eawpats, or audio/eawplus (for native MIDI).

If you don't want to add a bunch of optional dependencies to the Chocolate Doom port, then at least have it output some informational messages informing the user to install audio/timidity, audio/timidity++, audio/guspats, audio/eawpats, or audio/eawplus for additional music playback options.
Comment 8 Patrick McMunn 2018-05-30 03:22:01 UTC
I did some more tinkering and want to make a correction. You do NOT need to have Timidity or Timidity++ installed for GUS or native MIDI to work. You only need to have a set of instrument patches (audio/eawpats, audio/eawplus, audio/freepats, audio/guspat) installed, run chocolate-doom-setup, go to the audio settings, select GUS or native MIDI, and enter the path to the patch directory.

If GUS or native MIDI is selected but the path to the patch directory is left blank, it will look for /etc/timidity/freepats.cfg by default. So it might not be a bad idea to patch the source for FreeBSD so that it looks for /usr/local/share/freepats/freepats.cfg by default.
Comment 9 Patrick McMunn 2018-06-01 04:29:43 UTC
Created attachment 193885 [details]
new pkg-message to thoroughly explain how to configure music

I'm attaching a proposed update to the pkg-message file. This thoroughly explains how Chocolate Doom handles music and how to properly configure it.
Comment 10 jakub_lach 2018-06-03 22:20:19 UTC
Created attachment 193975 [details]
chocolate-doom 3.0.0 patch

diff to 2.3.0
Comment 11 jakub_lach 2018-06-03 22:20:55 UTC
(In reply to Patrick from comment #9)

Thank you for your documented research and persistence!

I rewrote the pkg-message a little, and did some testing by myself, attaching 
the current state. Looks OK to me, ran portlint and routine tests, didn't have time to check all sound options.
Comment 12 jakub_lach 2018-06-03 22:32:02 UTC
Created attachment 193976 [details]
chocolate-doom 3.0.0 patch

corrected pkg-message
Comment 13 Patrick McMunn 2018-06-03 23:40:50 UTC
Although not necessary to close out this particular bug, Id like for the port to also include an rc script to run the server. I should be able to write one in my spare time. What would be the proper user:group for the server to run as? Would it be nobody:nobody?
Comment 14 Shirkdog 2018-06-04 00:55:38 UTC
(In reply to Patrick from comment #13)
I can try to work this up. It looks like there are no flags specific to running as a separate user, but since the default port is 2342 it should be fine as nobody in an rc script.
Comment 15 Shirkdog 2018-06-04 13:24:39 UTC
This worked for me, and I used daemon because the server does not appear to daemonize. I tested this in my doom jail, restarted and it appears to function. 

#!/bin/sh                                                                                                                                                                                                          
#                                                                                                                                                                                                                  
# PROVIDE: chocolate_server                                                                                                                                                                                        
# REQUIRE: LOGIN                                                                                                                                                                                                   
# KEYWORD: shutdown                                                                                                                                                                                                
                                                                                                                                                                                                                   
. /etc/rc.subr                                                                                                                                                                                                     
                                                                                                                                                                                                                   
name="chocolate_server"                                                                                                                                                                                            
rcvar=`set_rcvar`                                                                                                                                                                                                  
                                                                                                                                                                                                                   
load_rc_config $name                                                                                                                                                                                               
                                                                                                                                                                                                                   
start_cmd="chocolate_server_start"                                                                                                                                                                                 
: ${chocolate_server_program:=/usr/local/bin/chocolate-server}                                                                                                                                                     
: ${chocolate_server_commandline:="-servername ChocolateDoomServer"}                                                                                                                       
                                                                                                                                                                                                                   
chocolate_server_enable=${chocolate_server_enable="NO"}                                                                                                                                                            
                                                                                                                                                                                                                   
chocolate_server_start() {                                                                                                                                                                                         
   daemon -u nobody $chocolate_server_program $chocolate_server_commandline                                                                                                                                        
}                                                                                                                                                                                                                  
                                                                                                                                                                                                                   
run_rc_command "$1"
Comment 16 Shirkdog 2018-06-04 13:38:05 UTC
(In reply to Shirkdog from comment #15)

Forgot to add -f to daemon. The commandline can be blank, but I normally set the servername. So the following should be good for an rc script. 

#!/bin/sh                                                                                                                                                                                                          
#                                                                                                                                                                                                                  
# PROVIDE: chocolate_server                                                                                                                                                                                        
# REQUIRE: LOGIN                                                                                                                                                                                                   
# KEYWORD: shutdown                                                                                                                                                                                                
                                                                                                                                                                                                                   
. /etc/rc.subr                                                                                                                                                                                                     
                                                                                                                                                                                                                   
name="chocolate_server"                                                                                                                                                                                            
rcvar=`set_rcvar`                                                                                                                                                                                                  
                                                                                                                                                                                                                   
load_rc_config $name                                                                                                                                                                                               
                                                                                                                                                                                                                   
start_cmd="chocolate_server_start"                                                                                                                                                                                 
: ${chocolate_server_program:=/usr/local/bin/chocolate-server}                                                                                                                                                     
: ${chocolate_server_commandline:=""}                                                                                                                       
                                                                                                                                                                                                                   
chocolate_server_enable=${chocolate_server_enable="NO"}                                                                                                                                                            
                                                                                                                                                                                                                   
chocolate_server_start() {                                                                                                                                                                                         
   daemon -f -u nobody $chocolate_server_program $chocolate_server_commandline                                                                                                                                     
}                                                                                                                                                                                                                  
                                                                                                                                                                                                                   
run_rc_command "$1"
Comment 17 jakub_lach 2018-08-04 07:10:48 UTC
FWIW, I've accept the previous patch. Regarding the server, I have no way to test it.
Comment 18 commit-hook freebsd_committer freebsd_triage 2019-01-15 14:23:15 UTC
A commit references this bug:

Author: swills
Date: Tue Jan 15 14:22:15 UTC 2019
New revision: 490375
URL: https://svnweb.freebsd.org/changeset/ports/490375

Log:
  games/chocolate-doom: update to 3.0.0

  While here:

  * add rc script for server [1]
  * add pkg-message on music configuration [2]

  PR:		225453
  Submitted by:	jakub_lach@mailplus.pl (maintainer)
  Submitted by:	Shirkdog <mshirk@daemon-security.com> (update and [1])
  Submitted by:	Patrick McMunn <doctorwhoguy@gmail.com> [2]

Changes:
  head/games/chocolate-doom/Makefile
  head/games/chocolate-doom/distinfo
  head/games/chocolate-doom/files/chocolate-server.in
  head/games/chocolate-doom/files/patch-src_d__iwad.c
  head/games/chocolate-doom/pkg-message
Comment 19 Steve Wills freebsd_committer freebsd_triage 2019-01-15 14:25:35 UTC
Committed all this, with some minor edits. I think the server and rc script may be best to move to a separate package, maybe via a slave port, so that you don't have to install the GUI components if you only want to run a server. But for now, it's a good start. Thanks for the update, sorry it took so long.