Re: NEW: audio/timgm6mb && make timidity and sdl{,2}-mixer use it

2019-05-17 Thread Bryan Linton
On 2019-05-15 10:13:46, Brian Callahan  wrote:
> Hi ports --
> 
> We currently have a less than ideal situation regarding where audio
> patchsets are located for programs that need them. Right now, they are
> bundled into the timidity package. Which does make sense, that way when you
> install timidity you get the needed audio patches. However, sdl{,2}-mixer
> both come with their own bundled copies of timidity but do not come with the
> patches, meaning that unless a user also just happens to have the timidity
> package installed, they don't have midi playback with sdl{,2}-mixer.
> 
> This manifests in the ports tree with some games (corsixth, openxcom,
> prboom) having an RDEP on the timidity package solely in order for sdl-mixer
> to use the patches. There might be other packages that are missing out on
> midi audio support for the same reason.
> 
> So I propose we split the patchset off from timidity. The attached new port
> (audio/timgm6mb) is the patchset plus the needed configuration files. The
> patches set timgm6mb as an RDEP of the ports that need it.
> 
> After this goes in, I'll remove the RDEP on timidity from those 3 games.
> 

Hello,

It's nice to see Timidity getting some love!

I've tested that playing a few random MIDI files works with
Timidity with your patches.

sdl{,2}-mixer also compiled and installed just fine too.

I installed games/prboom to test if music played with it, but
didn't hear any actual music play.  Sound effects worked just
fine, but no music.

I rolled back to the original version of sdl-mixer and there was
no change, so I may simply be missing something in prboom's
configuration file or something.

Whatever the case may be, I saw no regressions in my (admittedly
light) testing.


On a related note, I don't mean to start a bikeshedding event, but
I'm curious about the history behind Timidity's FLAVORs.  I
presume that the default (of not building a graphical version) was
done because Timidity was a dependency of so many other ports and
presume the intention was to keep it as small and light as
possible.

I use Timidity's XaW flavor because it's the only one that shows a
piano keyboard and what notes are playing, which is useful to me
sometimes.

Since XaW is a relatively lightweight toolkit (at least, compared
to the gtk2 FLAVOR) would there be any chance at making the XaW
flavor the default (and thereby removing it as a FLAVOR option)?

This would slightly simplify the port, and since the patchsets
would now have been moved into their own separate port, only
people who actually wanted to have timidity installed for itself
would be installing it, so there would be less of a reason to keep
the default as small and minimal as possible.

Of course, this is only a minor suggestion.  If there's a good
reason for the FLAVORs being set up this way, then it doesn't take
much extra time on my part to manually compile and install Timidity
when necessary, so it's not a critical change.


Other options might include:

* Switch the port to use only X11 and non-X11 (I.e. build both
GTK2 and XaW together, without the option of selecting only one).
This would not be a problem for end users since Timidity allows
the user to select which toolkit to use at runtime.

-iddumb interface

-inncurses interface

-iaX Athena Widget interface

-igGTK+ interface

Indeed, I build it with FLAVOR="gtk2 xaw" and can select either
one at runtime.


* Just build everything all together regardless (I.e. remove ALL
FLAVORs from the Makefile).

This would pull in GTK2 and all of its dependencies, but I would
assume that most people working with MIDI files would likely have
GTK2 pulled in by some other graphical program somewhere anyway.

Timidity itself doesn't become very large.  The
timidity-2.15.0p0-gtk2-xaw.tgz package weighs in at only 610K


Either way, thank you for putting in the effort to improve
Timidity (and related ports)!

-- 
Bryan



NEW: audio/timgm6mb && make timidity and sdl{,2}-mixer use it

2019-05-15 Thread Brian Callahan

Hi ports --

We currently have a less than ideal situation regarding where audio 
patchsets are located for programs that need them. Right now, they are 
bundled into the timidity package. Which does make sense, that way when 
you install timidity you get the needed audio patches. However, 
sdl{,2}-mixer both come with their own bundled copies of timidity but do 
not come with the patches, meaning that unless a user also just happens 
to have the timidity package installed, they don't have midi playback 
with sdl{,2}-mixer.


This manifests in the ports tree with some games (corsixth, openxcom, 
prboom) having an RDEP on the timidity package solely in order for 
sdl-mixer to use the patches. There might be other packages that are 
missing out on midi audio support for the same reason.


So I propose we split the patchset off from timidity. The attached new 
port (audio/timgm6mb) is the patchset plus the needed configuration 
files. The patches set timgm6mb as an RDEP of the ports that need it.


After this goes in, I'll remove the RDEP on timidity from those 3 games.

OK?

~Brian



timgm6mb.tgz
Description: application/compressed-tar
Index: Makefile
===
RCS file: /cvs/ports/audio/timidity/Makefile,v
retrieving revision 1.49
diff -u -p -r1.49 Makefile
--- Makefile	15 May 2019 13:37:32 -	1.49
+++ Makefile	15 May 2019 13:58:31 -
@@ -5,19 +5,15 @@ COMMENT=	MIDI to WAV renderer and player
 V=		2.15.0
 DISTNAME=	TiMidity++-${V}
 PKGNAME=	timidity-${V}
+REVISION=	0
 CATEGORIES=	audio
 
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE:=timidity/}
-MASTER_SITES0=	https://mirrors.nycbug.org/pub/distfiles/
-TIINS=		TimGM6mb-20170802.tar.gz
-DISTFILES=	${TIINS}:0 ${DISTNAME}.tar.gz
 
 HOMEPAGE=	http://timidity.sourceforge.net/
 MAINTAINER=	Brian Callahan 
 
 # timidity: GPLv2+
-# TimGM6mb: https://musescore.org/en/handbook/soundfonts#list
-#	"License: GNU GPL, version 2; Courtesy of Tim Brechbill"
 PERMIT_PACKAGE_CDROM=	Yes
 
 WANTLIB += c curses m sndio
@@ -25,6 +21,11 @@ WANTLIB += c curses m sndio
 BUILD_DEPENDS=	${MODGNU_AUTOCONF_DEPENDS} \
 		${MODGNU_AUTOMAKE_DEPENDS}
 
+# NOTE:
+# timidity.cfg is distributed in the timgm6mb package
+# because sdl{,2}-mixer needs it too
+RUN_DEPENDS=	audio/timgm6mb
+
 CONFIGURE_STYLE=gnu
 AUTOCONF_VERSION = 2.59
 AUTOMAKE_VERSION = 1.9
@@ -71,13 +72,5 @@ post-patch:
 
 do-gen:
 	cd ${WRKSRC}; ${AUTOCONF_ENV} autoreconf -fi
-
-post-install:
-	${INSTALL_DATA_DIR} ${PREFIX}/share/timidity/TimGM6mb
-	${INSTALL_DATA} ${WRKDIST}/TimGM6mb/* \
-		${PREFIX}/share/timidity/TimGM6mb
-	${INSTALL_DATA_DIR} ${PREFIX}/share/examples/timidity
-	${SUBST_CMD} -c -m 644 ${WRKDIR}/timidity.cfg \
-		${PREFIX}/share/examples/timidity/timidity.cfg
 
 .include 
Index: distinfo
===
RCS file: /cvs/ports/audio/timidity/distinfo,v
retrieving revision 1.7
diff -u -p -r1.7 distinfo
--- distinfo	15 May 2019 13:37:32 -	1.7
+++ distinfo	15 May 2019 13:58:31 -
@@ -1,4 +1,2 @@
 SHA256 (TiMidity++-2.15.0.tar.gz) = C2EJo8ZGBMiFHNm7TLr8AUpOE7ACX1l+WG2XQjiPb7c=
-SHA256 (TimGM6mb-20170802.tar.gz) = tyxC4aU+yDs5vXpT6ftWcbkcOekt/DUFtZk5hVzCcUQ=
 SIZE (TiMidity++-2.15.0.tar.gz) = 1990143
-SIZE (TimGM6mb-20170802.tar.gz) = 9032726
Index: patches/patch-timidity_cfg
===
RCS file: patches/patch-timidity_cfg
diff -N patches/patch-timidity_cfg
--- patches/patch-timidity_cfg	2 Aug 2017 15:21:48 -	1.3
+++ /dev/null	1 Jan 1970 00:00:00 -
@@ -1,12 +0,0 @@
-$OpenBSD: patch-timidity_cfg,v 1.3 2017/08/02 15:21:48 bcallah Exp $
-Index: timidity.cfg
 timidity.cfg.orig
-+++ timidity.cfg
-@@ -0,0 +1,7 @@
-+#
-+#  Instrument configuration for timidity
-+#  see timidity.cfg(5) for further details
-+#
-+
-+dir ${TRUEPREFIX}/share/timidity/TimGM6mb
-+source TimGM6mb.cfg
Index: pkg/PLIST
===
RCS file: /cvs/ports/audio/timidity/pkg/PLIST,v
retrieving revision 1.9
diff -u -p -r1.9 PLIST
--- pkg/PLIST	15 May 2019 13:37:32 -	1.9
+++ pkg/PLIST	15 May 2019 13:58:31 -
@@ -2,190 +2,3 @@
 @bin bin/timidity
 @man man/man1/timidity.1
 @man man/man5/timidity.cfg.5
-share/examples/timidity/
-share/examples/timidity/timidity.cfg
-@sample ${SYSCONFDIR}/timidity.cfg
-share/timidity/
-share/timidity/TimGM6mb/
-share/timidity/TimGM6mb/5thSawWave.pat
-share/timidity/TimGM6mb/808Click.pat
-share/timidity/TimGM6mb/808Hat.pat
-share/timidity/TimGM6mb/808Snare.pat
-share/timidity/TimGM6mb/Accordion.pat
-share/timidity/TimGM6mb/AcousticBass.pat
-share/timidity/TimGM6mb/AcousticTom.pat
-share/timidity/TimGM6mb/Agogo.pat
-share/timidity/TimGM6mb/AgogoBell.pat
-share/timidity/TimGM6mb/AltoSax-TBv2.3.pat
-share/timidity/TimGM6mb/Applause.pat
-share/timidity/TimGM6mb/Atmosphere.pat
-share/timidity/TimGM6mb/Bagpipe.pat
-share/timidity/TimGM6mb/Bandoneon.pat
-share/timidity/TimGM6mb/Banjo.pat