Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Feb 2019 09:27:44 +0000 (UTC)
From:      Tobias Kortkamp <tobik@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r493161 - in head/audio/tuxguitar: . files
Message-ID:  <201902170927.x1H9RiPF013427@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tobik
Date: Sun Feb 17 09:27:43 2019
New Revision: 493161
URL: https://svnweb.freebsd.org/changeset/ports/493161

Log:
  audio/tuxguitar: Prepare for FluidSynth 2.x
  
  Sanitize WRKSRC usage a bit to make sure we can patch the
  plugins too.
  
  PR:		233502
  Reported by:	jbeich
  Submitted by:	tobik
  Approved by:	yuri (maintainer timeout, 2 weeks)

Added:
  head/audio/tuxguitar/files/patch-TuxGuitar-fluidsynth_jni_org__herac__tuxguitar__player__impl__midiport__fluidsynth__MidiSynth.c   (contents, props changed)
  head/audio/tuxguitar/files/patch-TuxGuitar_build.properties
     - copied, changed from r493160, head/audio/tuxguitar/files/patch-build.properties
Deleted:
  head/audio/tuxguitar/files/patch-build.properties
Modified:
  head/audio/tuxguitar/Makefile

Modified: head/audio/tuxguitar/Makefile
==============================================================================
--- head/audio/tuxguitar/Makefile	Sun Feb 17 09:25:55 2019	(r493160)
+++ head/audio/tuxguitar/Makefile	Sun Feb 17 09:27:43 2019	(r493161)
@@ -18,7 +18,7 @@ MAINTAINER=	yuri@FreeBSD.org
 COMMENT=	Multitrack tablature editor and player
 
 LICENSE=	LGPL21
-LICENSE_FILE=	${WRKSRC}/../LICENSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
 
 BUILD_DEPENDS=	${JAVALIBDIR}/swt-devel.jar:x11-toolkits/swt-devel \
 		${JAVALIBDIR}/itext.jar:devel/itext \
@@ -38,7 +38,7 @@ USE_LDCONFIG=	yes
 JAVA_VERSION=	1.6+
 NOCCACHE=	yes
 
-WRKSRC_SUBDIR=	TuxGuitar
+BUILD_WRKSRC=	${WRKSRC}/TuxGuitar
 SF2_DIR=	${LOCALBASE}/share/sounds/sf2
 
 OPTIONS_DEFINE=	DOCS
@@ -56,11 +56,11 @@ post-extract:
 	@${CP} ${DISTDIR}/8MBGMSFX.SF2 ${WRKDIR}
 
 post-patch:
-	@${FIND} ${WRKSRC}/.. -name build.properties | ${XARGS} ${REINPLACE_CMD} -e '\
+	@${FIND} ${WRKSRC} -name build.properties | ${XARGS} ${REINPLACE_CMD} -e '\
 	    s|path\.swt=.*|path.swt=${JAVAJARDIR}/swt-devel.jar|; \
 	    s|path\.itext=.*|path.itext=${JAVAJARDIR}/itext.jar|; \
 	    s|path\.gervill=.*|path.gervill=${JAVAJARDIR}/gervill.jar|'
-	@${FIND} ${WRKSRC}/.. -name GNUmakefile | ${XARGS} ${REINPLACE_CMD} -e '\
+	@${FIND} ${WRKSRC} -name GNUmakefile | ${XARGS} ${REINPLACE_CMD} -e '\
 	    s|-I$$(shell gcj -print-file-name=include/)|-I${JAVA_HOME}/include \
 	    -I${JAVA_HOME}/include/freebsd -I${LOCALBASE}/include|; \
 	    s|-I $$(shell $$(GCJ) -print-file-name=include/)|-I${JAVA_HOME}/include \
@@ -73,38 +73,38 @@ post-patch:
 	    s|%%JAVASHAREDIR%%|${JAVASHAREDIR}|g; \
 	    s|%%DATADIR%%|${DATADIR}|g; \
 	    s|%%DOCSDIR%%|${DOCSDIR}|g' \
-	    ${WRKSRC}/build.properties
+	    ${WRKSRC}/TuxGuitar/build.properties
 
 post-build:
 .for p in ${PLUGINS}
-	(cd ${WRKSRC}/../TuxGuitar-${p}; \
+	(cd ${WRKSRC}/TuxGuitar-${p}; \
 	    ${SETENV} ${MAKE_ENV} ${ANT} ${MAKE_ARGS} ${ALL_TARGET})
 .endfor
-	cd ${WRKSRC}/../TuxGuitar-oss/jni && ${SETENV} ${MAKE_ENV} ${MAKE_CMD}
-	cd ${WRKSRC}/../TuxGuitar-fluidsynth/jni && ${SETENV} ${MAKE_ENV} ${MAKE_CMD}
-	cd ${WRKSRC}/../TuxGuitar-jack/jni && ${SETENV} ${MAKE_ENV} ${MAKE_CMD}
+	cd ${WRKSRC}/TuxGuitar-oss/jni && ${SETENV} ${MAKE_ENV} ${MAKE_CMD}
+	cd ${WRKSRC}/TuxGuitar-fluidsynth/jni && ${SETENV} ${MAKE_ENV} ${MAKE_CMD}
+	cd ${WRKSRC}/TuxGuitar-jack/jni && ${SETENV} ${MAKE_ENV} ${MAKE_CMD}
 
 do-install:
 	${INSTALL_SCRIPT} ${WRKDIR}/tuxguitar ${STAGEDIR}${PREFIX}/bin
-	${INSTALL_LIB} ${WRKSRC}/../TuxGuitar-oss/jni/libtuxguitar-oss-jni.so ${STAGEDIR}${PREFIX}/lib
-	${INSTALL_LIB} ${WRKSRC}/../TuxGuitar-fluidsynth/jni/libtuxguitar-fluidsynth-jni.so ${STAGEDIR}${PREFIX}/lib
+	${INSTALL_LIB} ${WRKSRC}/TuxGuitar-oss/jni/libtuxguitar-oss-jni.so ${STAGEDIR}${PREFIX}/lib
+	${INSTALL_LIB} ${WRKSRC}/TuxGuitar-fluidsynth/jni/libtuxguitar-fluidsynth-jni.so ${STAGEDIR}${PREFIX}/lib
 
 	@${MKDIR} ${STAGEDIR}${DATADIR}/plugins
-	${INSTALL_DATA} ${WRKSRC}/tuxguitar.jar ${STAGEDIR}${DATADIR}
-	${INSTALL_DATA} ${WRKSRC}/../misc/*.tg ${STAGEDIR}${DATADIR}
+	${INSTALL_DATA} ${WRKSRC}/TuxGuitar/tuxguitar.jar ${STAGEDIR}${DATADIR}
+	${INSTALL_DATA} ${WRKSRC}/misc/*.tg ${STAGEDIR}${DATADIR}
 	${INSTALL_DATA} ${WRKDIR}/8MBGMSFX.SF2 ${STAGEDIR}${DATADIR}
 .for p in ${PLUGINS}
-	${INSTALL_DATA} ${WRKSRC}/../TuxGuitar-${p}/tuxguitar-${p}.jar ${STAGEDIR}${DATADIR}/plugins
+	${INSTALL_DATA} ${WRKSRC}/TuxGuitar-${p}/tuxguitar-${p}.jar ${STAGEDIR}${DATADIR}/plugins
 .endfor
 	# Inline documentation
-	cd ${WRKSRC}/share/help &&   ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/help
-	cd ${WRKSRC}/share/lang &&   ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/lang
-	cd ${WRKSRC}/share/scales && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/scales
-	cd ${WRKSRC}/share/skins &&  ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/skins
+	cd ${WRKSRC}/TuxGuitar/share/help &&   ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/help
+	cd ${WRKSRC}/TuxGuitar/share/lang &&   ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/lang
+	cd ${WRKSRC}/TuxGuitar/share/scales && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/scales
+	cd ${WRKSRC}/TuxGuitar/share/skins &&  ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/skins
 
-	${INSTALL_DATA} ${WRKSRC}/../misc/tuxguitar.xpm ${STAGEDIR}${PREFIX}/share/pixmaps
-	${INSTALL_DATA} ${WRKSRC}/../misc/tuxguitar.desktop ${STAGEDIR}${PREFIX}/share/applications
-	${INSTALL_MAN} ${WRKSRC}/../misc/tuxguitar.1 ${STAGEDIR}${MANPREFIX}/man/man1
+	${INSTALL_DATA} ${WRKSRC}/misc/tuxguitar.xpm ${STAGEDIR}${PREFIX}/share/pixmaps
+	${INSTALL_DATA} ${WRKSRC}/misc/tuxguitar.desktop ${STAGEDIR}${PREFIX}/share/applications
+	${INSTALL_MAN} ${WRKSRC}/misc/tuxguitar.1 ${STAGEDIR}${MANPREFIX}/man/man1
 
 	# Share soundfont with FluidSynth
 	@${MKDIR} ${STAGEDIR}${SF2_DIR}
@@ -112,6 +112,6 @@ do-install:
 
 do-install-DOCS-on:
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}
-	cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}
+	cd ${WRKSRC}/TuxGuitar/doc && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}
 
 .include <bsd.port.mk>

Added: head/audio/tuxguitar/files/patch-TuxGuitar-fluidsynth_jni_org__herac__tuxguitar__player__impl__midiport__fluidsynth__MidiSynth.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/tuxguitar/files/patch-TuxGuitar-fluidsynth_jni_org__herac__tuxguitar__player__impl__midiport__fluidsynth__MidiSynth.c	Sun Feb 17 09:27:43 2019	(r493161)
@@ -0,0 +1,67 @@
+--- TuxGuitar-fluidsynth/jni/org_herac_tuxguitar_player_impl_midiport_fluidsynth_MidiSynth.c.orig	2009-10-31 14:34:13 UTC
++++ TuxGuitar-fluidsynth/jni/org_herac_tuxguitar_player_impl_midiport_fluidsynth_MidiSynth.c
+@@ -16,7 +16,11 @@ typedef struct{
+ 	jobject options;
+ }fluid_settings_foreach_option_data;
+ 
++#if FLUIDSYNTH_VERSION_MAJOR < 2
+ void fluid_settings_foreach_option_callback(void *data, char *name, char *option)
++#else
++void fluid_settings_foreach_option_callback(void *data, const char *name, const char *option)
++#endif
+ {
+ 	fluid_settings_foreach_option_data* handle = (fluid_settings_foreach_option_data *)data;
+ 	
+@@ -255,8 +259,12 @@ JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player
+ 			jstring jvalue = NULL;
+ 			char *value = NULL;
+ 			const jbyte *jkey = (*env)->GetStringUTFChars(env, key, NULL);
+-			
++
++#if FLUIDSYNTH_VERSION_MAJOR < 2
+ 			fluid_settings_getstr(handle->settings,(char *)jkey, &value );
++#else
++			fluid_settings_dupstr(handle->settings,(char *)jkey, &value );
++#endif
+ 			jvalue = (*env)->NewStringUTF(env, value);
+ 			
+ 			(*env)->ReleaseStringUTFChars(env, key, jkey);
+@@ -274,7 +282,12 @@ JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player
+ 		jmethodID mid = (*env)->GetMethodID(env, cl, "setValue", "(D)V");
+ 		if (mid != 0){
+ 			const jbyte *jkey = (*env)->GetStringUTFChars(env, key, NULL);
++#if FLUIDSYNTH_VERSION_MAJOR < 2
+ 			double value = fluid_settings_getnum_default(handle->settings,(char *)jkey);
++#else
++			double value = 0.0;
++			fluid_settings_getnum_default(handle->settings, (char*)jkey, &value);
++#endif
+ 			
+ 			(*env)->ReleaseStringUTFChars(env, key, jkey);
+ 			(*env)->CallVoidMethod( env, ref , mid , (jdouble)value );
+@@ -291,7 +304,12 @@ JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player
+ 		jmethodID mid = (*env)->GetMethodID(env, cl, "setValue", "(I)V");
+ 		if (mid != 0){
+ 			const jbyte *jkey = (*env)->GetStringUTFChars(env, key, NULL);
++#if FLUIDSYNTH_VERSION_MAJOR < 2
+ 			int value = fluid_settings_getint_default(handle->settings,(char *)jkey);
++#else
++			int value = 0;
++			fluid_settings_getint_default(handle->settings,(char *)jkey, &value);
++#endif
+ 			
+ 			(*env)->ReleaseStringUTFChars(env, key, jkey);
+ 			(*env)->CallVoidMethod( env, ref , mid , (jint)value );
+@@ -308,7 +326,12 @@ JNIEXPORT void JNICALL Java_org_herac_tuxguitar_player
+ 		jmethodID mid = (*env)->GetMethodID(env, cl, "setValue", "(Ljava/lang/String;)V");
+ 		if (mid != 0){
+ 			const jbyte *jkey = (*env)->GetStringUTFChars(env, key, NULL);
++#if FLUIDSYNTH_VERSION_MAJOR < 2
+ 			char *value = fluid_settings_getstr_default(handle->settings,(char *)jkey);
++#else
++			char *value = NULL;
++			fluid_settings_getstr_default(handle->settings,(char *)jkey, &value);
++#endif
+ 			jstring jvalue = (*env)->NewStringUTF(env, value);
+ 			
+ 			(*env)->ReleaseStringUTFChars(env, key, jkey);

Copied and modified: head/audio/tuxguitar/files/patch-TuxGuitar_build.properties (from r493160, head/audio/tuxguitar/files/patch-build.properties)
==============================================================================
--- head/audio/tuxguitar/files/patch-build.properties	Sun Feb 17 09:25:55 2019	(r493160, copy source)
+++ head/audio/tuxguitar/files/patch-TuxGuitar_build.properties	Sun Feb 17 09:27:43 2019	(r493161)
@@ -1,5 +1,5 @@
---- build.properties.orig	2009-10-31 14:32:52 UTC
-+++ build.properties
+--- TuxGuitar/build.properties.orig	2009-10-31 14:32:52 UTC
++++ TuxGuitar/build.properties
 @@ -5,15 +5,15 @@ ant.build.javac.source=1.4
  ant.build.javac.target=1.4
  
@@ -38,15 +38,15 @@
 -#dist.bin.path=/usr/local/bin/
 -#dist.share.path=/usr/local/share/TuxGuitar-${dist.version}/
 -#dist.doc.path=/usr/local/share/doc/TuxGuitar-${dist.version}/
-+lib.swt.jni=%%LOCALBASE%%/lib/
-+lib.swt.jar=%%JAVAJARDIR%%/swt-devel.jar
-+lib.itext.jar=%%JAVAJARDIR%%/itext.jar
++lib.swt.jni=/usr/local/lib/
++lib.swt.jar=/usr/local/share/java/classes/swt-devel.jar
++lib.itext.jar=/usr/local/share/java/classes/itext.jar
 +dist.file=xml/build-freebsd.xml
 +dist.version=1.2
-+dist.jar.path=%%JAVASHAREDIR%%/TuxGuitar-${dist.version}/
-+dist.bin.path=%%PREFIX%%/bin
-+dist.share.path=%%DATADIR%%
-+dist.doc.path=%%DOCSDIR%%
++dist.jar.path=/usr/local/share/java/TuxGuitar-${dist.version}/
++dist.bin.path=/usr/local/bin
++dist.share.path=/usr/local/share/tuxguitar
++dist.doc.path=/usr/local/share/doc/tuxguitar
  
  ########## DEFAULT MAC BUILD PROPERTIES ##########
  #lib.swt.jni=lib/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201902170927.x1H9RiPF013427>