From 78fb82834ccd2bf3e8568bdcef3899f52bde76ec Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Sun, 14 Apr 2019 13:42:35 +1000 Subject: [PATCH] FluidSynth: bump version * add native MediaKit output driver * use system soundfont settings --- ...-1.1.8.recipe => fluidsynth-1.1.11.recipe} | 16 +- .../fluidsynth/fluidsynth-1.1.6.recipe | 89 ---- .../patches/fluidsynth-1.1.11.patchset | 430 ++++++++++++++++++ .../patches/fluidsynth-1.1.6.patchset | 146 ------ .../patches/fluidsynth-1.1.8.patchset | 134 ------ 5 files changed, 441 insertions(+), 374 deletions(-) rename media-sound/fluidsynth/{fluidsynth-1.1.8.recipe => fluidsynth-1.1.11.recipe} (86%) delete mode 100644 media-sound/fluidsynth/fluidsynth-1.1.6.recipe create mode 100644 media-sound/fluidsynth/patches/fluidsynth-1.1.11.patchset delete mode 100644 media-sound/fluidsynth/patches/fluidsynth-1.1.6.patchset delete mode 100644 media-sound/fluidsynth/patches/fluidsynth-1.1.8.patchset diff --git a/media-sound/fluidsynth/fluidsynth-1.1.8.recipe b/media-sound/fluidsynth/fluidsynth-1.1.11.recipe similarity index 86% rename from media-sound/fluidsynth/fluidsynth-1.1.8.recipe rename to media-sound/fluidsynth/fluidsynth-1.1.11.recipe index 2d6f64c96..292a532bc 100644 --- a/media-sound/fluidsynth/fluidsynth-1.1.8.recipe +++ b/media-sound/fluidsynth/fluidsynth-1.1.11.recipe @@ -1,4 +1,4 @@ -SUMMARY="FA software real-time synthesizer" +SUMMARY="A software real-time synthesizer" DESCRIPTION=" Fluidsynth is a free open source software synthesizer written in C. It \ can convert MIDI note data to an audio signal using SoundFont technology \ @@ -6,15 +6,15 @@ without a SoundFont compatible soundcard. Fluidsynth can perform as a virtual \ MIDI device and read in SMF (.mid) files directly. Another function is its \ ability to send audio data to a Raw or Wave file." HOMEPAGE="http://www.fluidsynth.org/" -COPYRIGHT="2007-2012 Josh Green, Pedro Lopez-Cabanillas, David Henningsson" +COPYRIGHT="2007-2018 Josh Green, Pedro Lopez-Cabanillas, David Henningsson" LICENSE="GNU LGPL v2.1" REVISION="1" SOURCE_URI="https://github.com/FluidSynth/fluidsynth/archive/v$portVersion.tar.gz" -CHECKSUM_SHA256="318df5aebde8e7353c8878f5c9cb3ba8ed578c2607978b6fbfc5f1cb2ad9d799" +CHECKSUM_SHA256="da8878ff374d12392eecf87e96bad8711b8e76a154c25a571dd8614d1af80de8" PATCHES="fluidsynth-$portVersion.patchset" ARCHITECTURES="?x86_gcc2 ?x86 x86_64" -SECONDARY_ARCHITECTURES="?x86_gcc2 ?x86" +SECONDARY_ARCHITECTURES="?x86_gcc2 x86" PROVIDES=" fluidsynth${secondaryArchSuffix} = $portVersion @@ -41,6 +41,9 @@ PROVIDES_devel=" REQUIRES_devel=" fluidsynth$secondaryArchSuffix == $portVersion base " +CONFLICTS_devel=" + fluidsynth2${secondaryArchSuffix}_devel + " BUILD_REQUIRES=" haiku${secondaryArchSuffix}_devel @@ -63,12 +66,15 @@ BUILD_PREREQUIRES=" BUILD() { - cmake . $cmakeDirArgs + mkdir -p build + cd build + cmake .. $cmakeDirArgs make $jobArgs } INSTALL() { + cd build make install mkdir -p $(dirname $includeDir) diff --git a/media-sound/fluidsynth/fluidsynth-1.1.6.recipe b/media-sound/fluidsynth/fluidsynth-1.1.6.recipe deleted file mode 100644 index a64eae5d1..000000000 --- a/media-sound/fluidsynth/fluidsynth-1.1.6.recipe +++ /dev/null @@ -1,89 +0,0 @@ -SUMMARY="FA software real-time synthesizer" -DESCRIPTION=" -Fluidsynth is a free open source software synthesizer written in C. It \ -can convert MIDI note data to an audio signal using SoundFont technology \ -without a SoundFont compatible soundcard. Fluidsynth can perform as a virtual \ -MIDI device and read in SMF (.mid) files directly. Another function is its \ -ability to send audio data to a Raw or Wave file." -HOMEPAGE="http://www.fluidsynth.org/" -COPYRIGHT="2007-2012 Josh Green, Pedro Lopez-Cabanillas, David Henningsson" -LICENSE="GNU LGPL v2.1" -REVISION="5" -SOURCE_URI="http://sourceforge.net/projects/fluidsynth/files/fluidsynth-$portVersion/fluidsynth-$portVersion.tar.bz2" -CHECKSUM_SHA256="d28b47dfbf7f8e426902ae7fa2981d821fbf84f41da9e1b85be933d2d748f601" -PATCHES="fluidsynth-1.1.6.patchset" - -ARCHITECTURES="x86_gcc2 x86 x86_64" -SECONDARY_ARCHITECTURES="x86_gcc2 x86" - -PROVIDES=" - fluidsynth${secondaryArchSuffix} = $portVersion - cmd:fluidsynth${secondaryArchSuffix} - lib:libfluidsynth${secondaryArchSuffix} = 1.5.2 compat >= 1 - " -REQUIRES=" - haiku${secondaryArchSuffix} - lib:libFLAC$secondaryArchSuffix - lib:libglib_2.0$secondaryArchSuffix - lib:libiconv$secondaryArchSuffix - lib:libintl$secondaryArchSuffix - lib:libncurses$secondaryArchSuffix - lib:libogg$secondaryArchSuffix - lib:libreadline$secondaryArchSuffix - lib:libsndfile$secondaryArchSuffix - lib:libvorbis$secondaryArchSuffix - " - -PROVIDES_devel=" - fluidsynth${secondaryArchSuffix}_devel = $portVersion - devel:libfluidsynth$secondaryArchSuffix = 1.5.2 compat >= 1 - " -REQUIRES_devel=" - fluidsynth$secondaryArchSuffix == $portVersion base - " - -BUILD_REQUIRES=" - haiku${secondaryArchSuffix}_devel - devel:libFLAC$secondaryArchSuffix - devel:libglib_2.0$secondaryArchSuffix - devel:libiconv$secondaryArchSuffix - devel:libncurses$secondaryArchSuffix - devel:libogg$secondaryArchSuffix - devel:libreadline$secondaryArchSuffix - devel:libsndfile$secondaryArchSuffix - devel:libvorbis$secondaryArchSuffix - " -BUILD_PREREQUIRES=" - cmd:aclocal - cmd:autoconf - cmd:awk - cmd:find - cmd:gcc$secondaryArchSuffix - cmd:libtoolize$secondaryArchSuffix - cmd:make - cmd:pkg_config$secondaryArchSuffix - " - -BUILD() -{ - libtoolize -fci - ./autogen.sh - - runConfigure ./configure - make $jobArgs -} - -INSTALL() -{ - make install - - #remove libtool file - rm $libDir/*.la - - prepareInstalledDevelLib libfluidsynth - fixPkgconfig - - # devel package - packageEntries devel \ - $developDir -} diff --git a/media-sound/fluidsynth/patches/fluidsynth-1.1.11.patchset b/media-sound/fluidsynth/patches/fluidsynth-1.1.11.patchset new file mode 100644 index 000000000..44330d99e --- /dev/null +++ b/media-sound/fluidsynth/patches/fluidsynth-1.1.11.patchset @@ -0,0 +1,430 @@ +From 413c2e913b7ce390490497bce402baa60beb0ed0 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Sun, 14 Apr 2019 13:31:52 +1000 +Subject: Add Haiku MediaKit support + + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b13d958..6d6b2c4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -20,7 +20,8 @@ + # CMake based build system. Pedro Lopez-Cabanillas + + cmake_minimum_required ( VERSION 3.0.2 ) +-project ( FluidSynth C ) ++project ( FluidSynth C CXX) ++set(CMAKE_CXX_STANDARD 11) + set ( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_admin ) + + # FluidSynth package name +@@ -66,6 +67,7 @@ option ( enable-jack "compile JACK support (if it is available)" on ) + option ( enable-libsndfile "compile libsndfile support (if it is available)" on ) + option ( enable-midishare "compile MidiShare support (if it is available)" on ) + option ( enable-oss "compile OSS support (if it is available)" on ) ++option ( enable-haiku "compile Haiku MediaKit audio support (if it is available)" on ) + option ( enable-pkgconfig "use pkg-config to locate fluidsynth's (mostly optional) dependencies" on ) + option ( enable-pulseaudio "compile PulseAudio support (if it is available)" on ) + option ( enable-readline "compile readline lib line editing (if it is available)" on ) +@@ -89,7 +91,7 @@ if ( CMAKE_SYSTEM MATCHES "OS2" ) + endif ( CMAKE_SYSTEM MATCHES "OS2" ) + + # Initialize the library directory name suffix. +-if (NOT MINGW AND NOT MSVC) ++if (NOT MINGW AND NOT MSVC AND NOT HAIKU) + if ( CMAKE_SIZEOF_VOID_P EQUAL 8 ) + set ( _init_lib_suffix "64" ) + else ( CMAKE_SIZEOF_VOID_P EQUAL 8 ) +@@ -133,8 +135,10 @@ check_include_file ( signal.h HAVE_SIGNAL_H ) + check_include_file ( getopt.h HAVE_GETOPT_H ) + include ( TestInline ) + include ( TestVLA ) ++if ( NOT HAIKU ) + include ( TestBigEndian ) + test_big_endian ( WORDS_BIGENDIAN ) ++endif ( NOT HAIKU ) + + unset ( LIBFLUID_CPPFLAGS CACHE ) + unset ( LIBFLUID_LIBS CACHE ) +@@ -162,6 +166,11 @@ if ( CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" ) + set ( CMAKE_C_FLAGS_RELWITHDEBINFO "-std=gnu89 -O2 -g -fomit-frame-pointer -finline-functions ${GNUCC_VISIBILITY_FLAG} -DNDEBUG ${GNUCC_WARNING_FLAGS}" ) + endif ( CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" ) + ++# Haiku ++if ( HAIKU ) ++set ( CMAKE_CXX_FLAGS "-fpermissive") ++endif ( HAIKU ) ++ + # Windows + unset ( WINDOWS_SUPPORT CACHE ) + unset ( WINDOWS_LIBS CACHE ) +@@ -188,7 +197,11 @@ else ( WIN32 ) + # Check PThreads, but not in Windows + find_package ( Threads REQUIRED ) + set ( HAVE_LIBPTHREAD ${Threads_FOUND} ) ++if ( HAIKU ) ++ set ( LIBFLUID_LIBS "network;bsd;be;media" ${CMAKE_THREAD_LIBS_INIT} ) ++else ( HAIKU ) + set ( LIBFLUID_LIBS "m" ${CMAKE_THREAD_LIBS_INIT} ) ++endif ( HAIKU ) + endif ( WIN32 ) + + # IBM OS/2 +@@ -410,6 +423,11 @@ else(NOT enable-pkgconfig) + unset_pkg_config ( DBUS ) + endif ( enable-dbus ) + ++ unset ( HAIKU_SUPPORT CACHE ) ++ if ( enable-haiku ) ++ set ( HAIKU_SUPPORT 1 ) ++ endif ( enable-haiku ) ++ + endif(NOT enable-pkgconfig) + + unset ( AUFILE_SUPPORT CACHE ) +@@ -482,8 +500,13 @@ else () + endif () + configure_file ( fluidsynth.pc.in + ${CMAKE_BINARY_DIR}/fluidsynth.pc IMMEDIATE @ONLY ) ++if ( HAIKU ) ++install ( FILES ${CMAKE_BINARY_DIR}/fluidsynth.pc ++ DESTINATION ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}${LIB_SUFFIX}/pkgconfig ) ++else ( HAIKU ) + install ( FILES ${CMAKE_BINARY_DIR}/fluidsynth.pc + DESTINATION ${LIB_INSTALL_DIR}/pkgconfig ) ++endif ( HAIKU ) + + # Extra targets for Unix build environments + if ( UNIX ) +diff --git a/cmake_admin/report.cmake b/cmake_admin/report.cmake +index 1a7fcca..05449fe 100644 +--- a/cmake_admin/report.cmake ++++ b/cmake_admin/report.cmake +@@ -43,6 +43,12 @@ else ( PORTAUDIO_SUPPORT ) + message ( "PortAudio: no" ) + endif ( PORTAUDIO_SUPPORT ) + ++if ( HAIKU_SUPPORT ) ++ message ( "Haiku MediaKit support: yes" ) ++else ( HAIKU_SUPPORT ) ++ message ( "Haiku MediaKit support: no" ) ++endif ( HAIKU_SUPPORT ) ++ + if ( OSS_SUPPORT ) + message ( "OSS: yes" ) + else ( OSS_SUPPORT ) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 4405b3d..0b035ef 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -83,6 +83,10 @@ if ( WINDOWS_SUPPORT ) + set ( fluid_windows_SOURCES drivers/fluid_dsound.c drivers/fluid_winmidi.c ) + endif ( WINDOWS_SUPPORT ) + ++if ( HAIKU_SUPPORT ) ++ set ( fluid_haiku_SOURCES drivers/fluid_haiku.cpp ) ++endif ( HAIKU_SUPPORT ) ++ + if ( OSS_SUPPORT ) + set ( fluid_oss_SOURCES drivers/fluid_oss.c ) + endif ( OSS_SUPPORT ) +@@ -261,6 +265,7 @@ add_library ( libfluidsynth + ${fluid_lash_SOURCES} + ${fluid_ladspa_SOURCES} + ${fluid_midishare_SOURCES} ++ ${fluid_haiku_SOURCES} + ${fluid_oss_SOURCES} + ${fluid_portaudio_SOURCES} + ${fluid_pulse_SOURCES} +diff --git a/src/config.cmake b/src/config.cmake +index d0415b8..1c1d4f9 100644 +--- a/src/config.cmake ++++ b/src/config.cmake +@@ -19,6 +19,9 @@ + /* Define if building for Mac OS X Darwin */ + #cmakedefine DARWIN @DARWIN@ + ++/* Define to enable Haiku MediaKit audio driver */ ++#cmakedefine HAIKU_SUPPORT @HAIKU_SUPPORT@ ++ + /* Define if D-Bus support is enabled */ + #cmakedefine DBUS_SUPPORT @DBUS_SUPPORT@ + +diff --git a/src/drivers/fluid_adriver.c b/src/drivers/fluid_adriver.c +index da77e1f..cd2a861 100644 +--- a/src/drivers/fluid_adriver.c ++++ b/src/drivers/fluid_adriver.c +@@ -55,6 +55,15 @@ int delete_fluid_alsa_audio_driver(fluid_audio_driver_t* p); + void fluid_alsa_audio_driver_settings(fluid_settings_t* settings); + #endif + ++#if HAIKU_SUPPORT ++fluid_audio_driver_t* new_fluid_haiku_audio_driver(fluid_settings_t* settings, ++ fluid_synth_t* synth); ++fluid_audio_driver_t* new_fluid_haiku_audio_driver2(fluid_settings_t* settings, ++ fluid_audio_func_t func, void* data); ++int delete_fluid_haiku_audio_driver(fluid_audio_driver_t* p); ++void fluid_haiku_audio_driver_settings(fluid_settings_t* settings); ++#endif ++ + #if OSS_SUPPORT + fluid_audio_driver_t* new_fluid_oss_audio_driver(fluid_settings_t* settings, + fluid_synth_t* synth); +@@ -138,6 +147,14 @@ static const fluid_audriver_definition_t fluid_audio_drivers[] = + fluid_alsa_audio_driver_settings }, + #endif + ++#if HAIKU_SUPPORT ++ { "mediakit", ++ new_fluid_haiku_audio_driver, ++ new_fluid_haiku_audio_driver2, ++ delete_fluid_haiku_audio_driver, ++ fluid_haiku_audio_driver_settings }, ++#endif ++ + #if OSS_SUPPORT + { "oss", + new_fluid_oss_audio_driver, +@@ -256,6 +273,8 @@ void fluid_audio_driver_settings(fluid_settings_t* settings) + fluid_settings_register_str(settings, "audio.driver", "portaudio", 0, NULL, NULL); + #elif DART_SUPPORT + fluid_settings_register_str(settings, "audio.driver", "dart", 0, NULL, NULL); ++#elif HAIKU_SUPPORT ++ fluid_settings_register_str(settings, "audio.driver", "mediakit", 0, NULL, NULL); + #elif AUFILE_SUPPORT + fluid_settings_register_str(settings, "audio.driver", "file", 0, NULL, NULL); + #else +@@ -290,6 +309,9 @@ void fluid_audio_driver_settings(fluid_settings_t* settings) + #if DART_SUPPORT + fluid_settings_add_option(settings, "audio.driver", "dart"); + #endif ++#if HAIKU_SUPPORT ++ fluid_settings_add_option(settings, "audio.driver", "mediakit"); ++#endif + #if AUFILE_SUPPORT + fluid_settings_add_option(settings, "audio.driver", "file"); + #endif +diff --git a/src/drivers/fluid_haiku.cpp b/src/drivers/fluid_haiku.cpp +new file mode 100644 +index 0000000..0c4243d +--- /dev/null ++++ b/src/drivers/fluid_haiku.cpp +@@ -0,0 +1,149 @@ ++/* Haiku MediaKit Driver for FluidSynth ++ * ++ * Copyright (C) 2019 Gerasim Troeglazov ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public License ++ * as published by the Free Software Foundation; either version 2.1 of ++ * the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free ++ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA ++ * 02110-1301, USA ++ */ ++ ++#include ++#include ++ ++extern "C" { ++#include "fluid_synth.h" ++#include "fluid_adriver.h" ++#include "fluid_settings.h" ++ ++typedef struct ++{ ++ fluid_audio_driver_t driver; ++ ++ void *data; ++ fluid_audio_callback_t write_ptr; ++ ++ int frame_size; ++ ++ BSoundPlayer *m_player; ++ ++} fluid_haiku_audio_driver_t; ++ ++ ++static void playerProc(void *cookie, void *buffer, size_t len, const media_raw_audio_format &format) ++{ ++ fluid_haiku_audio_driver_t *dev = (fluid_haiku_audio_driver_t *)cookie; ++ len /= dev->frame_size; ++ dev->write_ptr(dev->data, len, buffer, 0, 2, buffer, 1, 2); ++} ++ ++void fluid_haiku_audio_driver_settings(fluid_settings_t *settings) ++{ ++ fluid_settings_register_str(settings, "audio.haiku.device", "default", 0, NULL, NULL); ++ fluid_settings_add_option(settings, "audio.haiku.device", "default"); ++} ++ ++int delete_fluid_haiku_audio_driver(fluid_audio_driver_t *d) ++{ ++ fluid_haiku_audio_driver_t *dev = (fluid_haiku_audio_driver_t *) d; ++ ++ if (dev == NULL) return FLUID_OK; ++ ++ if (dev->m_player != NULL) { ++ dev->m_player->SetHasData(false); ++ dev->m_player->Stop(); ++ delete dev->m_player; ++ dev->m_player = NULL; ++ } ++ FLUID_FREE (dev); ++} ++ ++fluid_audio_driver_t * ++new_fluid_haiku_audio_driver2(fluid_settings_t *settings, fluid_audio_func_t func, void* data) ++{ ++ fluid_haiku_audio_driver_t *dev = NULL; ++ fluid_audio_callback_t write_ptr; ++ ++ double sample_rate; ++ int period_size; ++ int periods; ++ int sample_size; ++ ++ char *device; ++ const char *dev_name; ++ ++ fluid_settings_getnum(settings, "synth.sample-rate", &sample_rate); ++ fluid_settings_getint(settings, "audio.periods", &periods); ++ fluid_settings_getint(settings, "audio.period-size", &period_size); ++ ++ if(period_size < 1024) { ++ period_size = 1024; ++ } else { ++ if((period_size & (period_size - 1)) != 0) { ++ FLUID_LOG(FLUID_ERR, "\"audio.period-size\" must be a power of 2"); ++ return NULL; ++ } ++ } ++ ++ if(fluid_settings_str_equal(settings, "audio.sample-format", "16bits")) ++ { ++ FLUID_LOG(FLUID_DBG, "Selected 16 bit sample format"); ++ sample_size = sizeof(short); ++ write_ptr = fluid_synth_write_s16; ++ } else { ++ FLUID_LOG(FLUID_ERR, "Unhandled sample format"); ++ return NULL; ++ } ++ ++ dev = FLUID_NEW(fluid_haiku_audio_driver_t); ++ if(dev == NULL) { ++ FLUID_LOG(FLUID_ERR, "Out of memory"); ++ return NULL; ++ } ++ FLUID_MEMSET(dev, 0, sizeof(fluid_haiku_audio_driver_t)); ++ ++ dev->data = data; ++ dev->frame_size = 2 * sample_size; ++ dev->write_ptr = write_ptr; ++ ++ media_raw_audio_format mediaKitFormat = { ++ (float)sample_rate, ++ (uint32)2, ++ media_raw_audio_format::B_AUDIO_SHORT, ++ B_MEDIA_LITTLE_ENDIAN, ++ (uint32)periods * period_size * dev->frame_size ++ }; ++ ++ dev->m_player = new BSoundPlayer(&mediaKitFormat, "FluidSynth", playerProc, NULL, (void*)dev); ++ ++ if(dev->m_player->InitCheck() != B_OK) { ++ delete dev->m_player; ++ dev->m_player = NULL; ++ delete_fluid_haiku_audio_driver(&dev->driver); ++ return NULL; ++ } ++ ++ dev->m_player->SetHasData(true); ++ dev->m_player->Start(); ++ ++ return (fluid_audio_driver_t *) dev; ++} ++ ++fluid_audio_driver_t* ++new_fluid_haiku_audio_driver(fluid_settings_t* settings, fluid_synth_t* synth) ++{ ++ return new_fluid_haiku_audio_driver2(settings, NULL, synth); ++} ++ ++} ++ +diff --git a/src/fluidsynth.c b/src/fluidsynth.c +index 7b5ece4..76d1e50 100644 +--- a/src/fluidsynth.c ++++ b/src/fluidsynth.c +@@ -303,7 +303,6 @@ int main(int argc, char** argv) + + lash_args = fluid_lash_extract_args (&argc, &argv); + #endif +- + print_welcome (); + + settings = new_fluid_settings(); +diff --git a/src/synth/fluid_synth.c b/src/synth/fluid_synth.c +index 6b5c951..0498e82 100644 +--- a/src/synth/fluid_synth.c ++++ b/src/synth/fluid_synth.c +@@ -29,6 +29,10 @@ + #include "fluid_hash.h" + #include "fluid_defsfont.h" + ++#ifdef __HAIKU__ ++#include ++#endif ++ + #ifdef TRAP_ON_FPE + #define _GNU_SOURCE + #include +@@ -186,8 +190,25 @@ void fluid_synth_settings(fluid_settings_t* settings) + FLUID_HINT_TOGGLED, NULL, NULL); + fluid_settings_register_str(settings, "midi.portname", "", 0, NULL, NULL); + ++#ifdef __HAIKU__ ++ char midiSettings[PATH_MAX] = ""; ++ if (find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, midiSettings, sizeof(midiSettings)) == B_OK) { ++ strcat(midiSettings, "/Media/midi_settings"); ++ if( access( midiSettings, F_OK ) != -1 ) { ++ FILE *inFile = fopen(midiSettings, "rt"); ++ if (inFile) { ++ char sf2file[PATH_MAX]; ++ if (fscanf(inFile, "# Midi\n\tsoundfont \"%[^\"]\"", sf2file)) { ++ fluid_settings_register_str(settings, "synth.default-soundfont", sf2file, 0, NULL, NULL); ++ } ++ fclose(inFile); ++ } ++ } ++ } ++#else + fluid_settings_register_str(settings, "synth.default-soundfont", + DEFAULT_SOUNDFONT, 0, NULL, NULL); ++#endif + + fluid_settings_register_int(settings, "synth.polyphony", + 256, 1, 65535, 0, NULL, NULL); +diff --git a/src/utils/fluid_sys.h b/src/utils/fluid_sys.h +index 27cb118..149d5b5 100644 +--- a/src/utils/fluid_sys.h ++++ b/src/utils/fluid_sys.h +@@ -422,7 +422,7 @@ extern fluid_profile_data_t fluid_profile_data[]; + sample data. + */ + +-#if defined(HAVE_SYS_MMAN_H) && !defined(__OS2__) ++#if defined(HAVE_SYS_MMAN_H) && !defined(__OS2__) && !defined(__HAIKU__) + #define fluid_mlock(_p,_n) mlock(_p, _n) + #define fluid_munlock(_p,_n) munlock(_p,_n) + #else +-- +2.21.0 + diff --git a/media-sound/fluidsynth/patches/fluidsynth-1.1.6.patchset b/media-sound/fluidsynth/patches/fluidsynth-1.1.6.patchset deleted file mode 100644 index a312882ac..000000000 --- a/media-sound/fluidsynth/patches/fluidsynth-1.1.6.patchset +++ /dev/null @@ -1,146 +0,0 @@ -From 24f44d67be0ad012ec04ffc8fd620d19ae1aaa75 Mon Sep 17 00:00:00 2001 -From: Adrien Destugues -Date: Wed, 9 Jul 2014 15:19:11 +0200 -Subject: Get things to build on Haiku. - - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 004b022..e210f6b 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -140,7 +140,7 @@ if ( CMAKE_COMPILER_IS_GNUCC ) - set ( CMAKE_SHARED_LINKER_FLAGS - "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" ) - endif ( NOT APPLE AND NOT OS2 ) -- set ( GNUCC_WARNING_FLAGS "-Wall -W -Wpointer-arith -Wbad-function-cast -Wno-cast-qual -Wcast-align -Wstrict-prototypes -Wno-unused-parameter -Wdeclaration-after-statement" ) -+ set ( GNUCC_WARNING_FLAGS "-Wall -W -Wpointer-arith -Wbad-function-cast -Wno-cast-qual -Wcast-align -Wstrict-prototypes" ) - set ( CMAKE_C_FLAGS_DEBUG "-g -DDEBUG ${GNUCC_WARNING_FLAGS}" ) - set ( CMAKE_C_FLAGS_RELEASE "-O2 -fomit-frame-pointer -funroll-all-loops -finline-functions -DNDEBUG ${GNUCC_WARNING_FLAGS}" ) - set ( CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -fomit-frame-pointer -funroll-all-loops -finline-functions -DNDEBUG ${GNUCC_WARNING_FLAGS}" ) -@@ -168,9 +168,9 @@ if ( WIN32 ) - endif ( MINGW ) - else ( WIN32 ) - # Check PThreads, but not in Windows -- find_package ( Pthreads REQUIRED ) -- set ( HAVE_LIBPTHREAD ${PTHREADS_FOUND} ) -- set ( LIBFLUID_LIBS "m" ) -+ find_package ( Threads REQUIRED ) -+ set ( HAVE_LIBPTHREAD ${THREADS_FOUND} ) -+ set ( LIBFLUID_LIBS "network;bsd" ) - endif ( WIN32 ) - - # IBM OS/2 -@@ -412,7 +412,7 @@ set ( includedir "\${prefix}/${INCLUDE_INSTALL_DIR}" ) - configure_file ( fluidsynth.pc.in - ${CMAKE_BINARY_DIR}/fluidsynth.pc IMMEDIATE @ONLY ) - install ( FILES ${CMAKE_BINARY_DIR}/fluidsynth.pc -- DESTINATION ${LIB_INSTALL_DIR}${LIB_SUFFIX}/pkgconfig ) -+ DESTINATION ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}${LIB_SUFFIX}/pkgconfig ) - - # Extra targets for Unix build environments - if ( UNIX ) -diff --git a/src/utils/fluid_sys.h b/src/utils/fluid_sys.h -index 7cfb7a9..6ac460e 100644 ---- a/src/utils/fluid_sys.h -+++ b/src/utils/fluid_sys.h -@@ -335,7 +335,7 @@ extern fluid_profile_data_t fluid_profile_data[]; - sample data. - */ - --#if defined(HAVE_SYS_MMAN_H) && !defined(__OS2__) -+#if defined(HAVE_SYS_MMAN_H) && !defined(__OS2__) && !defined(__HAIKU__) - #define fluid_mlock(_p,_n) mlock(_p, _n) - #define fluid_munlock(_p,_n) munlock(_p,_n) - #else --- -1.8.3.4 - -From 168e9fa215ab0a97c823aac7cc815d2d8542287d Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= -Date: Fri, 15 Aug 2014 16:10:40 +0200 -Subject: [PATCH] configure: Haiku: drop libm, add libnetwork - -Haiku doesn't have libm proper, it's embedded in libroot. -Also, we use libnetwork for socket() and friends. - -Somehow all this doesn't seem to change anything though!? ---- - configure.ac | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/configure.ac b/configure.ac -index 2641597..c621cd2 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -83,6 +83,10 @@ os2*) - solaris*) - LDFLAGS="$LDFLAGS -lnsl -lsocket" - ;; -+haiku*) -+ LIBFLUID_LIBS="" -+ LDFLAGS="$LDFLAGS -lnetwork" -+ ;; - esac - - AC_SUBST(LIBFLUID_LIBS) --- -1.8.3.4 - -From 71dedb016726d4732b8527eb487e901fe0ed7452 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= -Date: Fri, 15 Aug 2014 16:37:55 +0200 -Subject: [PATCH 1/2] configure: AM_CONFIG_HEADER is deprecated - -Use AC_CONFIG_HEADER instead. ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index d0e1cfe..e88cba6 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -35,7 +35,7 @@ m4_define([lt_age], [5]) - LT_VERSION_INFO="lt_current:lt_revision:lt_age" - AC_SUBST(LT_VERSION_INFO) - --AM_CONFIG_HEADER(src/config.h) -+AC_CONFIG_HEADER(src/config.h) - AC_CONFIG_MACRO_DIR([m4]) - - CFLAGS="$CFLAGS" --- -1.8.3.4 - - -From 0057f67ec395e9053b1c235d2fe904aa25800bfe Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= -Date: Fri, 15 Aug 2014 16:41:10 +0200 -Subject: [PATCH 2/2] configure: Drop -Wno-unused-parameter (gcc2 doesn't know - this) - -Haiku requires buiding with gcc2 for some parts... ---- - configure.ac | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/configure.ac b/configure.ac -index e88cba6..36d37c5 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -151,10 +151,10 @@ AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], - # Those are only valid for GCC - if test "$GCC" = yes; then - if test "$ENABLE_DEBUG" = "yes"; then -- CFLAGS="${CFLAGS} ${FCCFLAGS} -g -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Wno-unused-parameter -Wno-cast-qual" -+ CFLAGS="${CFLAGS} ${FCCFLAGS} -g -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Wno-cast-qual" - AC_DEFINE(DEBUG, 1, [Define to activate debugging message]) - else -- CFLAGS="${CFLAGS} ${FCCFLAGS} -O2 -fomit-frame-pointer -funroll-all-loops -finline-functions -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Winline -Wno-unused-parameter -Wno-cast-qual" -+ CFLAGS="${CFLAGS} ${FCCFLAGS} -O2 -fomit-frame-pointer -funroll-all-loops -finline-functions -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Winline -Wno-cast-qual" - AC_DEFINE(DEBUG, 0, [Define to activate debugging message]) - fi - fi --- -1.8.3.4 - diff --git a/media-sound/fluidsynth/patches/fluidsynth-1.1.8.patchset b/media-sound/fluidsynth/patches/fluidsynth-1.1.8.patchset deleted file mode 100644 index 157dbbe40..000000000 --- a/media-sound/fluidsynth/patches/fluidsynth-1.1.8.patchset +++ /dev/null @@ -1,134 +0,0 @@ -From a5d73acc21fdc084697ef1e767debd5a779bedaa Mon Sep 17 00:00:00 2001 -From: Adrien Destugues -Date: Wed, 9 Jul 2014 15:19:11 +0200 -Subject: Get things to build on Haiku. - - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index aa4154c..c120590 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -151,7 +151,7 @@ if ( CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" ) - set ( GNUCC_VISIBILITY_FLAG "-fvisibility=hidden" ) - endif ( OS2 ) - -- set ( GNUCC_WARNING_FLAGS "-Wall -W -Wpointer-arith -Wbad-function-cast -Wno-cast-qual -Wcast-align -Wstrict-prototypes -Wno-unused-parameter -Wdeclaration-after-statement" ) -+ set ( GNUCC_WARNING_FLAGS "-Wall -W -Wpointer-arith -Wbad-function-cast -Wno-cast-qual -Wcast-align -Wstrict-prototypes" ) - set ( CMAKE_C_FLAGS_DEBUG "-std=gnu89 -g ${GNUCC_VISIBILITY_FLAG} -DDEBUG ${GNUCC_WARNING_FLAGS}" ) - set ( CMAKE_C_FLAGS_RELEASE "-std=gnu89 -O2 -fomit-frame-pointer -finline-functions ${GNUCC_VISIBILITY_FLAG} -DNDEBUG ${GNUCC_WARNING_FLAGS}" ) - set ( CMAKE_C_FLAGS_RELWITHDEBINFO "-std=gnu89 -O2 -g -fomit-frame-pointer -finline-functions ${GNUCC_VISIBILITY_FLAG} -DNDEBUG ${GNUCC_WARNING_FLAGS}" ) -@@ -181,7 +181,7 @@ else ( WIN32 ) - # Check PThreads, but not in Windows - find_package ( Threads REQUIRED ) - set ( HAVE_LIBPTHREAD ${Threads_FOUND} ) -- set ( LIBFLUID_LIBS "m" ${CMAKE_THREAD_LIBS_INIT} ) -+ set ( LIBFLUID_LIBS "network;bsd" ${CMAKE_THREAD_LIBS_INIT} ) - endif ( WIN32 ) - - # IBM OS/2 -@@ -458,7 +458,7 @@ set ( includedir "\${prefix}/${INCLUDE_INSTALL_DIR}" ) - configure_file ( fluidsynth.pc.in - ${CMAKE_BINARY_DIR}/fluidsynth.pc IMMEDIATE @ONLY ) - install ( FILES ${CMAKE_BINARY_DIR}/fluidsynth.pc -- DESTINATION ${LIB_INSTALL_DIR}${LIB_SUFFIX}/pkgconfig ) -+ DESTINATION ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}${LIB_SUFFIX}/pkgconfig ) - - # Extra targets for Unix build environments - if ( UNIX ) -diff --git a/src/utils/fluid_sys.h b/src/utils/fluid_sys.h -index b5034e9..9d4797c 100644 ---- a/src/utils/fluid_sys.h -+++ b/src/utils/fluid_sys.h -@@ -421,7 +421,7 @@ extern fluid_profile_data_t fluid_profile_data[]; - sample data. - */ - --#if defined(HAVE_SYS_MMAN_H) && !defined(__OS2__) -+#if defined(HAVE_SYS_MMAN_H) && !defined(__OS2__) && !defined(__HAIKU__) - #define fluid_mlock(_p,_n) mlock(_p, _n) - #define fluid_munlock(_p,_n) munlock(_p,_n) - #else --- -2.14.2 - - -From a2d6c08c2a7dcda8f0beb3a9ecd41b5a00580054 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= -Date: Fri, 15 Aug 2014 16:10:40 +0200 -Subject: configure: Haiku: drop libm, add libnetwork - -Haiku doesn't have libm proper, it's embedded in libroot. -Also, we use libnetwork for socket() and friends. - -Somehow all this doesn't seem to change anything though!? - -diff --git a/configure.ac b/configure.ac -index 3c0e62c..7d86739 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -83,6 +83,10 @@ os2*) - solaris*) - LDFLAGS="$LDFLAGS -lnsl -lsocket" - ;; -+haiku*) -+ LIBFLUID_LIBS="" -+ LDFLAGS="$LDFLAGS -lnetwork" -+ ;; - esac - - AC_SUBST(LIBFLUID_LIBS) --- -2.14.2 - - -From 151ebec6a1f8bc70b64473044ff7dee1c79ee740 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= -Date: Fri, 15 Aug 2014 16:37:55 +0200 -Subject: configure: AM_CONFIG_HEADER is deprecated - -Use AC_CONFIG_HEADER instead. - -diff --git a/configure.ac b/configure.ac -index 7d86739..da1cffa 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -35,7 +35,7 @@ m4_define([lt_age], [6]) - LT_VERSION_INFO="lt_current:lt_revision:lt_age" - AC_SUBST(LT_VERSION_INFO) - --AM_CONFIG_HEADER(src/config.h) -+AC_CONFIG_HEADER(src/config.h) - AC_CONFIG_MACRO_DIR([m4]) - - CFLAGS="$CFLAGS" --- -2.14.2 - - -From c1e0919abc7aaa87be61207612517a175cbad252 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= -Date: Fri, 15 Aug 2014 16:41:10 +0200 -Subject: configure: Drop -Wno-unused-parameter (gcc2 doesn't know this) - -Haiku requires buiding with gcc2 for some parts... - -diff --git a/configure.ac b/configure.ac -index da1cffa..a3f358b 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -151,10 +151,10 @@ AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], - # Those are only valid for GCC - if test "$GCC" = yes; then - if test "$ENABLE_DEBUG" = "yes"; then -- CFLAGS="${CFLAGS} ${FCCFLAGS} -g -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Wno-unused-parameter -Wno-cast-qual" -+ CFLAGS="${CFLAGS} ${FCCFLAGS} -g -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Wno-cast-qual" - AC_DEFINE(DEBUG, 1, [Define to activate debugging message]) - else -- CFLAGS="${CFLAGS} ${FCCFLAGS} -O2 -fomit-frame-pointer -funroll-all-loops -finline-functions -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Winline -Wno-unused-parameter -Wno-cast-qual" -+ CFLAGS="${CFLAGS} ${FCCFLAGS} -O2 -fomit-frame-pointer -funroll-all-loops -finline-functions -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Winline -Wno-cast-qual" - AC_DEFINE(DEBUG, 0, [Define to activate debugging message]) - fi - fi --- -2.14.2 -