Bug#946848: Tuxguitar ftbfs with the new libfluidsynth

2019-12-16 Thread gregor herrmann
On Mon, 16 Dec 2019 15:33:20 +0100, Sebastien Bacher wrote:

> Le 16/12/2019 à 15:30, gregor herrmann a écrit :
> > The patch seems to have gone missing on the way to the BTS 
> Sorry, I sent it in another step so I could include the Closes: #
> reference in the patch :-)

Clever :)

And I saw the second mail just after sending my question; sorry for
the noise.


Cheers,
gregor

-- 
 .''`.  https://info.comodo.priv.at -- Debian Developer https://www.debian.org
 : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D  85FA BB3A 6801 8649 AA06
 `. `'  Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe
   `-   BOFH excuse #431:  Borg implants are failing 



Bug#946848: Tuxguitar ftbfs with the new libfluidsynth

2019-12-16 Thread Sebastien Bacher
Le 16/12/2019 à 15:30, gregor herrmann a écrit :
> The patch seems to have gone missing on the way to the BTS 

Sorry, I sent it in another step so I could include the Closes: #
reference in the patch :-)



Bug#946848: Tuxguitar ftbfs with the new libfluidsynth

2019-12-16 Thread gregor herrmann
On Mon, 16 Dec 2019 15:25:03 +0100, Sebastien Bacher wrote:

> Tuxguitar fails to build with the recent libfluidsynth update,
> https://buildd.debian.org/status/package.php?p=tuxguitar&suite=unstable

Thanks for the bug report!
 
> The attached patch fixes the issue by backporting upstream r1800

The patch seems to have gone missing on the way to the BTS :)


Cheers,
gregor

-- 
 .''`.  https://info.comodo.priv.at -- Debian Developer https://www.debian.org
 : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D  85FA BB3A 6801 8649 AA06
 `. `'  Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe
   `-   BOFH excuse #270:  Someone has messed up the kernel pointers 



Bug#946848: Tuxguitar ftbfs with the new libfluidsynth

2019-12-16 Thread Sebastien Bacher

diff -Nru tuxguitar-1.2/debian/changelog tuxguitar-1.2/debian/changelog
--- tuxguitar-1.2/debian/changelog	2019-09-11 23:33:26.0 +0200
+++ tuxguitar-1.2/debian/changelog	2019-12-16 15:26:10.0 +0100
@@ -1,3 +1,11 @@
+tuxguitar (1.2-25) UNRELEASED; urgency=medium
+
+  * debian/patches/git_new_libfluidsynth.patch:
+- backport an upstream commit to build with the new libfluidsynth
+  (Closes: #946848)
+
+ -- Sebastien Bacher   Mon, 16 Dec 2019 15:18:17 +0100
+
 tuxguitar (1.2-24) unstable; urgency=medium
 
   * Team upload.
diff -Nru tuxguitar-1.2/debian/control tuxguitar-1.2/debian/control
--- tuxguitar-1.2/debian/control	2019-09-11 23:03:16.0 +0200
+++ tuxguitar-1.2/debian/control	2019-12-16 15:20:07.0 +0100
@@ -1,7 +1,8 @@
 Source: tuxguitar
 Section: sound
 Priority: optional
-Maintainer: Debian Java Maintainers 
+Maintainer: Ubuntu Developers 
+XSBC-Original-Maintainer: Debian Java Maintainers 
 Uploaders: Philippe Coval ,
tony mancill 
 Build-Depends: ant,
diff -Nru tuxguitar-1.2/debian/patches/git_new_libfluidsynth.patch tuxguitar-1.2/debian/patches/git_new_libfluidsynth.patch
--- tuxguitar-1.2/debian/patches/git_new_libfluidsynth.patch	1970-01-01 01:00:00.0 +0100
+++ tuxguitar-1.2/debian/patches/git_new_libfluidsynth.patch	2019-12-16 14:05:45.0 +0100
@@ -0,0 +1,122 @@
+Index: tuxguitar/TuxGuitar-fluidsynth/jni/GNUmakefile
+===
+--- tuxguitar/TuxGuitar-fluidsynth/jni/GNUmakefile	(révision 1799)
 tuxguitar/TuxGuitar-fluidsynth/jni/GNUmakefile	(révision 1800)
+@@ -1,4 +1,4 @@
+-CFLAGS?=-I$(shell gcj -print-file-name=include/)
++CFLAGS?=-I../../build-scripts/native-modules/common-include
+ CFLAGS+=-fPIC
+ LDFLAGS?=
+ LDLIBS?=-lfluidsynth
+Index: tuxguitar/TuxGuitar-fluidsynth/jni/org_herac_tuxguitar_player_impl_midiport_fluidsynth_MidiSynth.c
+===
+--- tuxguitar/TuxGuitar-fluidsynth/jni/org_herac_tuxguitar_player_impl_midiport_fluidsynth_MidiSynth.c	(révision 1799)
 tuxguitar/TuxGuitar-fluidsynth/jni/org_herac_tuxguitar_player_impl_midiport_fluidsynth_MidiSynth.c	(révision 1800)
+@@ -4,6 +4,9 @@
+ #include 
+ #include "org_herac_tuxguitar_player_impl_midiport_fluidsynth_MidiSynth.h"
+ 
++#define FLUID_VERSION_GEN(major, minor, micro) ((major << 16) | (minor << 8) | (micro)) 
++#define FLUID_VERSION FLUID_VERSION_GEN(FLUIDSYNTH_VERSION_MAJOR, FLUIDSYNTH_VERSION_MINOR, FLUIDSYNTH_VERSION_MICRO) 
++
+ typedef struct{
+ 	fluid_settings_t* settings;
+ 	fluid_synth_t* synth;
+@@ -217,7 +220,7 @@
+ 			double value = 0;
+ 			const jbyte *jkey = (*env)->GetStringUTFChars(env, key, NULL);
+ 			
+-			fluid_settings_getnum(handle->settings,(char *)jkey, &value );
++			fluid_settings_getnum(handle->settings, (char *)jkey, &value);
+ 			
+ 			(*env)->ReleaseStringUTFChars(env, key, jkey);
+ 			(*env)->CallVoidMethod( env, ref , mid , (jdouble)value );
+@@ -236,7 +239,7 @@
+ 			int value = 0;
+ 			const jbyte *jkey = (*env)->GetStringUTFChars(env, key, NULL);
+ 			
+-			fluid_settings_getint(handle->settings,(char *)jkey, &value );
++			fluid_settings_getint(handle->settings, (char *)jkey, &value);
+ 			
+ 			(*env)->ReleaseStringUTFChars(env, key, jkey);
+ 			(*env)->CallVoidMethod( env, ref , mid , (jint)value );
+@@ -256,7 +259,8 @@
+ 			char *value = NULL;
+ 			const jbyte *jkey = (*env)->GetStringUTFChars(env, key, NULL);
+ 			
+-			fluid_settings_getstr(handle->settings,(char *)jkey, &value );
++			fluid_settings_dupstr(handle->settings, (char *)jkey, &value);
++			
+ 			jvalue = (*env)->NewStringUTF(env, value);
+ 			
+ 			(*env)->ReleaseStringUTFChars(env, key, jkey);
+@@ -273,11 +277,16 @@
+ 		jclass cl = (*env)->GetObjectClass(env, ref);
+ 		jmethodID mid = (*env)->GetMethodID(env, cl, "setValue", "(D)V");
+ 		if (mid != 0){
++			double value = 0;
+ 			const jbyte *jkey = (*env)->GetStringUTFChars(env, key, NULL);
+-			double value = fluid_settings_getnum_default(handle->settings,(char *)jkey);
+-			
++
++#if FLUID_VERSION >= FLUID_VERSION_GEN(2,0,0)
++			fluid_settings_getnum_default(handle->settings, (char *)jkey, &value);
++#else
++			value = fluid_settings_getnum_default(handle->settings, (char *)jkey);
++#endif
+ 			(*env)->ReleaseStringUTFChars(env, key, jkey);
+-			(*env)->CallVoidMethod( env, ref , mid , (jdouble)value );
++			(*env)->CallVoidMethod( env, ref , mid , (jdouble) value );
+ 		}
+ 	}
+ }
+@@ -290,9 +299,14 @@
+ 		jclass cl = (*env)->GetObjectClass(env, ref);
+ 		jmethodID mid = (*env)->GetMethodID(env, cl, "setValue", "(I)V");
+ 		if (mid != 0){
++			int value = 0;
+ 			const jbyte *jkey = (*env)->GetStringUTFChars(env, key, NULL);
+-			int value = fluid_settings_getint_default(handle->settings,(char *)jkey);
+ 			
++#if FLUID_VERSION >= FLUID_VERSION_GEN(2,0,0)
++			fluid_settings_getint_default(handle->settings, (char *)jkey, &value);
++#else
++			value = fluid_settings_getint_defaul

Bug#946848: Tuxguitar ftbfs with the new libfluidsynth

2019-12-16 Thread Sebastien Bacher
Package: tuxguitar
Version: 1.2-24
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu focal ubuntu-patch


Tuxguitar fails to build with the recent libfluidsynth update,
https://buildd.debian.org/status/package.php?p=tuxguitar&suite=unstable

The attached patch fixes the issue by backporting upstream r1800