On 2013/03/27 10:59, Brian Callahan wrote:
> On 03/27/13 05:55, Stuart Henderson wrote:
> >
> >
> >untested, but from reading:-
> >
> >| +wav_player=aucat
> >| +wav_player_options=-m play -i %s
> >| +midi_player=timidity
> >...
> >
> >please use /usr/bin/aucat, ${LOCALBASE}/bin/timidity, etc (and add a
> >${SUBST_CMD} of course) so these have a full path
> >
> >| CONFIGURE_STYLE = gnu old
> >| CONFIGURE_ARGS = --mandir=${PREFIX}/man \
> >| --sysconfdir=${PREFIX}/share/examples/solfege
> >
> >this ("gnu old") is the old hack to allow overriding sysconfdir; now
> >you can set SYSCONFDIR in the port Makefile, see sysutils/nut for an
> >example.
> >
> >but in this case, it seems you are overriding it for the built package
> >too, where you really just want this to be used for "make fake".
> >so leave CONFIGURE_ARGS alone and override in FAKE_FLAGS or similar
> >(and @sample it in the plist).
> >
>
> OK, fixed. I used full paths for all applications listed in default.config,
> except for csound and mma (because we don't have ports of them).
>
> Attached.
>
> ~Brian
the @sample is not quite right there; I've changed it like this:
share/applications/solfege.desktop
share/examples/solfege/
-@sample share/examples/solfege/solfege
+share/examples/solfege/solfege
+@sample ${SYSCONFDIR}/solfege
share/locale/cs/LC_MESSAGES/solfege.mo
share/locale/da/LC_MESSAGES/solfege.mo
however the code to try and pick this config file up doesn't work
correctly, so here is a diff relative to your port.
I also allowed fluidsynth as an alternative to timidity, and provided
sample config lines to use with it (timidity isn't available in packages
due to copyright problems with some patches so it's a bit of an annoying
dependency).
Still not perfect as the only soundfont file we have in packages is in
mscore which is fairly huge (maybe we want to split that off into a
subpackage, or add some alternative ports of sf2 files?) and also
~/.solfegerc doesn't get updated automatically when you change
/etc/solfege, but I think these are steps in the right direction.
(the goal would be "pkg_add solfege" from an ftp mirror works without
additional steps, of course..)
diff --git Makefile Makefile
index 73198c9..ea9c25e 100644
--- Makefile
+++ Makefile
@@ -8,7 +8,7 @@ HOMEPAGE = http://www.solfege.org/
MAINTAINER = Brian Callahan <[email protected]>
-# GPLv3
+# GPLv3+
PERMIT_PACKAGE_CDROM = Yes
MASTER_SITES = ${MASTER_SITE_SOURCEFORGE:=solfege/}
@@ -20,22 +20,20 @@ BUILD_DEPENDS = print/lilypond,-main \
RUN_DEPENDS = audio/lame \
audio/mpg123 \
- audio/timidity \
+ timidity-*|fluidsynth-*:audio/timidity \
audio/vorbis-tools \
devel/desktop-file-utils
CONFIGURE_STYLE = gnu
USE_GMAKE = Yes
-USE_GROFF = Yes
-
-FAKE_FLAGS = mandir=${PREFIX}/man \
- sysconfdir=${PREFIX}/share/examples/solfege
-
NO_TEST = Yes
+FAKE_FLAGS = sysconfdir=${PREFIX}/share/examples/solfege
+
pre-configure:
- ${SUBST_CMD} ${WRKSRC}/default.config
- perl -pi -e "s,/bin/bash,/bin/sh,g"
${WRKSRC}/exercises/standard/lesson-files/bin/csound-play-harmonic-interval.sh
+ cd ${WRKSRC} && ${SUBST_CMD} default.config run-solfege.py.in && \
+ perl -pi -e "s,/bin/bash,/bin/sh,g" \
+ exercises/standard/lesson-files/bin/csound-play-harmonic-interval.sh
.include <bsd.port.mk>
diff --git patches/patch-run-solfege_py_in patches/patch-run-solfege_py_in
new file mode 100644
index 0000000..2275a35
--- /dev/null
+++ patches/patch-run-solfege_py_in
@@ -0,0 +1,15 @@
+$OpenBSD$
+--- run-solfege.py.in.orig Wed Mar 27 15:27:27 2013
++++ run-solfege.py.in Wed Mar 27 15:27:43 2013
+@@ -51,10 +51,7 @@ from solfege import filesystem
+ if not os.path.exists(filesystem.app_data()):
+ os.mkdir(filesystem.app_data())
+
+-if prefix == "/usr":
+- sysconf = "/etc/solfege"
+-else:
+- sysconf = os.path.join(prefix, "etc", "solfege")
++sysconf = "${SYSCONFDIR}/solfege"
+
+ try:
+ cfg.initialise(os.path.join(prefix, "share", "solfege", "default.config"),
diff --git patches/patch-system_rc patches/patch-system_rc
new file mode 100644
index 0000000..282e64c
--- /dev/null
+++ patches/patch-system_rc
@@ -0,0 +1,25 @@
+$OpenBSD$
+--- system.rc.orig Sat Jan 12 22:06:56 2013
++++ system.rc Wed Mar 27 15:48:28 2013
+@@ -1,8 +1,14 @@
+-# For Solfege versions X.Y.Z, this file get installed as
+-# /etc/solfegeX.Y
+-#
+-# Sys admin can override app defaults set in the file
+-# /usr/share/solfege/X.Y.Z/default.config
+-# (in debian packages the file is named
+-# /usr/share/solfege/default.config
++# Default settings from ${TRUEPREFIX}/share/solfege/default.config can be
++# overridden in this file. ~/.solfegerc is created based on these settings at
++# first startup.
+
++# To use Fluidsynth rather than Timidity, uncomment the following and
++# supply a Soundfont file (the example is available in the mscore package):
++
++#[app]
++#midi_to_wav_cmd=${LOCALBASE}/bin/fluidsynth
++#midi_to_wav_cmd_options=-i %(in)s -F %(out)s
${LOCALBASE}/share/mscore-1.3/sound/TimGM6mb.sf2
++
++#[sound]
++#midi_player=${LOCALBASE}/bin/fluidsynth
++#midi_player_options=-i ${LOCALBASE}/share/mscore-1.3/sound/TimGM6mb.sf2 %s
diff --git pkg/PLIST pkg/PLIST
index 74b65e7..d7da5f4 100644
--- pkg/PLIST
+++ pkg/PLIST
@@ -3,7 +3,8 @@ bin/solfege
@man man/man1/solfege.1
share/applications/solfege.desktop
share/examples/solfege/
-@sample share/examples/solfege/solfege
+share/examples/solfege/solfege
+@sample ${SYSCONFDIR}/solfege
share/locale/cs/LC_MESSAGES/solfege.mo
share/locale/da/LC_MESSAGES/solfege.mo
share/locale/de/LC_MESSAGES/solfege.mo