mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
FludSynth: fix build for secondary arch
This commit is contained in:
@@ -8,18 +8,18 @@ ability to send audio data to a Raw or Wave file."
|
||||
HOMEPAGE="http://www.fluidsynth.org/"
|
||||
COPYRIGHT="2007-2018 Josh Green, Pedro Lopez-Cabanillas, David Henningsson"
|
||||
LICENSE="GNU LGPL v2.1"
|
||||
REVISION="1"
|
||||
REVISION="2"
|
||||
SOURCE_URI="https://github.com/FluidSynth/fluidsynth/archive/v$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="da8878ff374d12392eecf87e96bad8711b8e76a154c25a571dd8614d1af80de8"
|
||||
PATCHES="fluidsynth-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="?x86_gcc2 ?x86 x86_64"
|
||||
SECONDARY_ARCHITECTURES="?x86_gcc2 x86"
|
||||
ARCHITECTURES="!x86_gcc2 x86_64"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
PROVIDES="
|
||||
fluidsynth${secondaryArchSuffix} = $portVersion
|
||||
cmd:fluidsynth${secondaryArchSuffix}
|
||||
lib:libfluidsynth${secondaryArchSuffix} = 1.6.1 compat >= 1
|
||||
cmd:fluidsynth
|
||||
lib:libfluidsynth${secondaryArchSuffix} = 1.7.2 compat >= 1
|
||||
"
|
||||
REQUIRES="
|
||||
haiku${secondaryArchSuffix}
|
||||
@@ -36,7 +36,7 @@ REQUIRES="
|
||||
|
||||
PROVIDES_devel="
|
||||
fluidsynth${secondaryArchSuffix}_devel = $portVersion
|
||||
devel:libfluidsynth$secondaryArchSuffix = 1.6.1 compat >= 1
|
||||
devel:libfluidsynth$secondaryArchSuffix = 1.7.2 compat >= 1
|
||||
"
|
||||
REQUIRES_devel="
|
||||
fluidsynth$secondaryArchSuffix == $portVersion base
|
||||
@@ -68,7 +68,10 @@ BUILD()
|
||||
{
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake .. $cmakeDirArgs
|
||||
cmake .. \
|
||||
-DCMAKE_INSTALL_PREFIX=$prefix \
|
||||
-DLIB_INSTALL_DIR=$libDir \
|
||||
-DINCLUDE_INSTALL_DIR=$includeDir
|
||||
make $jobArgs
|
||||
}
|
||||
|
||||
@@ -77,9 +80,6 @@ INSTALL()
|
||||
cd build
|
||||
make install
|
||||
|
||||
mkdir -p $(dirname $includeDir)
|
||||
mv $prefix/include $includeDir
|
||||
mv $prefix/lib64 $libDir || true
|
||||
mkdir -p $(dirname $manDir)
|
||||
mv $prefix/share/man $manDir
|
||||
rm -rf $prefix/share
|
||||
|
||||
@@ -8,7 +8,7 @@ ability to send audio data to a Raw or Wave file."
|
||||
HOMEPAGE="http://www.fluidsynth.org/"
|
||||
COPYRIGHT="2007-2019 Josh Green, Pedro Lopez-Cabanillas, David Henningsson"
|
||||
LICENSE="GNU LGPL v2.1"
|
||||
REVISION="1"
|
||||
REVISION="2"
|
||||
SOURCE_URI="https://github.com/FluidSynth/fluidsynth/archive/v$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="2c065de87e9c9ba0311ebf2f4828a4fd76f1f5cc7d1d93dd80d7a048d7d2a76c"
|
||||
SOURCE_DIR="fluidsynth-$portVersion"
|
||||
@@ -19,7 +19,7 @@ SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
PROVIDES="
|
||||
fluidsynth2${secondaryArchSuffix} = $portVersion
|
||||
cmd:fluidsynth${secondaryArchSuffix}
|
||||
cmd:fluidsynth
|
||||
lib:libfluidsynth${secondaryArchSuffix} = 2.1.1 compat >= 2
|
||||
"
|
||||
REQUIRES="
|
||||
@@ -72,7 +72,10 @@ BUILD()
|
||||
{
|
||||
mkdir -p build
|
||||
cd build
|
||||
cmake .. $cmakeDirArgs
|
||||
cmake .. \
|
||||
-DCMAKE_INSTALL_PREFIX=$prefix \
|
||||
-DLIB_INSTALL_DIR=$libDir \
|
||||
-DINCLUDE_INSTALL_DIR=$includeDir
|
||||
make $jobArgs
|
||||
}
|
||||
|
||||
@@ -81,9 +84,6 @@ INSTALL()
|
||||
cd build
|
||||
make install
|
||||
|
||||
mkdir -p $(dirname $includeDir)
|
||||
mv $prefix/include $includeDir
|
||||
mv $prefix/lib64 $libDir || true
|
||||
mkdir -p $(dirname $manDir)
|
||||
mv $prefix/share/man $manDir
|
||||
rm -rf $prefix/share
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
From 413c2e913b7ce390490497bce402baa60beb0ed0 Mon Sep 17 00:00:00 2001
|
||||
From 1de2ce8007aa2c20613162d8b21896a9aaeadf73 Mon Sep 17 00:00:00 2001
|
||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||
Date: Sun, 14 Apr 2019 13:31:52 +1000
|
||||
Date: Sun, 14 Apr 2019 17:26:24 +1000
|
||||
Subject: Add Haiku MediaKit support
|
||||
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index b13d958..6d6b2c4 100644
|
||||
index b13d958..90d9876 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -20,7 +20,8 @@
|
||||
@@ -82,20 +82,6 @@ index b13d958..6d6b2c4 100644
|
||||
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
|
||||
@@ -206,10 +192,10 @@ index da77e1f..cd2a861 100644
|
||||
#endif
|
||||
diff --git a/src/drivers/fluid_haiku.cpp b/src/drivers/fluid_haiku.cpp
|
||||
new file mode 100644
|
||||
index 0000000..0c4243d
|
||||
index 0000000..26b6c34
|
||||
--- /dev/null
|
||||
+++ b/src/drivers/fluid_haiku.cpp
|
||||
@@ -0,0 +1,149 @@
|
||||
@@ -0,0 +1,151 @@
|
||||
+/* Haiku MediaKit Driver for FluidSynth
|
||||
+ *
|
||||
+ * Copyright (C) 2019 Gerasim Troeglazov
|
||||
@@ -234,6 +220,8 @@ index 0000000..0c4243d
|
||||
+#include <SupportKit.h>
|
||||
+
|
||||
+extern "C" {
|
||||
+//Hack for uint32 conflict
|
||||
+#define uint32 XXX
|
||||
+#include "fluid_synth.h"
|
||||
+#include "fluid_adriver.h"
|
||||
+#include "fluid_settings.h"
|
||||
@@ -372,21 +360,23 @@ index 7b5ece4..76d1e50 100644
|
||||
|
||||
settings = new_fluid_settings();
|
||||
diff --git a/src/synth/fluid_synth.c b/src/synth/fluid_synth.c
|
||||
index 6b5c951..0498e82 100644
|
||||
index 6b5c951..09ea964 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"
|
||||
@@ -20,6 +20,12 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+#include <FindDirectory.h>
|
||||
+//Hack for uint32 conflict
|
||||
+#define uint32 XXX
|
||||
+#endif
|
||||
+
|
||||
#ifdef TRAP_ON_FPE
|
||||
#define _GNU_SOURCE
|
||||
#include <fenv.h>
|
||||
@@ -186,8 +190,25 @@ void fluid_synth_settings(fluid_settings_t* settings)
|
||||
#include "fluid_synth.h"
|
||||
#include "fluid_sys.h"
|
||||
#include "fluid_chan.h"
|
||||
@@ -186,8 +192,25 @@ void fluid_synth_settings(fluid_settings_t* settings)
|
||||
FLUID_HINT_TOGGLED, NULL, NULL);
|
||||
fluid_settings_register_str(settings, "midi.portname", "", 0, NULL, NULL);
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
From 6c276fc426e1482c9f62155c6f3090353396192a Mon Sep 17 00:00:00 2001
|
||||
From a1e84fb39c3b2fbbd4e5cd9c84250467d01ec9d7 Mon Sep 17 00:00:00 2001
|
||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||
Date: Sun, 14 Apr 2019 11:09:51 +1000
|
||||
Subject: Add MediaKit support
|
||||
Date: Sun, 14 Apr 2019 17:27:45 +1000
|
||||
Subject: Add Haiku MediaKit support
|
||||
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index b759259..0e37e9f 100644
|
||||
index b759259..9622a62 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -20,7 +20,8 @@
|
||||
@@ -82,20 +82,6 @@ index b759259..0e37e9f 100644
|
||||
endif(NOT enable-pkgconfig)
|
||||
|
||||
unset ( AUFILE_SUPPORT CACHE )
|
||||
@@ -637,8 +655,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 e25a989..be77acc 100644
|
||||
--- a/cmake_admin/report.cmake
|
||||
@@ -191,10 +177,10 @@ index 5cfc688..ace6353 100644
|
||||
fluid_synth_t *synth);
|
||||
diff --git a/src/drivers/fluid_haiku.cpp b/src/drivers/fluid_haiku.cpp
|
||||
new file mode 100644
|
||||
index 0000000..31bfdea
|
||||
index 0000000..2871948
|
||||
--- /dev/null
|
||||
+++ b/src/drivers/fluid_haiku.cpp
|
||||
@@ -0,0 +1,139 @@
|
||||
@@ -0,0 +1,140 @@
|
||||
+/* Haiku MediaKit Driver for FluidSynth
|
||||
+ *
|
||||
+ * Copyright (C) 2019 Gerasim Troeglazov
|
||||
@@ -326,12 +312,13 @@ index 0000000..31bfdea
|
||||
+void delete_fluid_haiku_audio_driver(fluid_audio_driver_t *d)
|
||||
+{
|
||||
+ fluid_haiku_audio_driver_t *dev = (fluid_haiku_audio_driver_t *) d;
|
||||
+ if (dev->m_player) {
|
||||
+ 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);
|
||||
+}
|
||||
+
|
||||
diff --git a/src/synth/fluid_synth.c b/src/synth/fluid_synth.c
|
||||
@@ -391,31 +378,3 @@ index 9f2d6f6..f3d1464 100644
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
||||
From 3a61c410708d121233477c684494ef3f8f5d731d Mon Sep 17 00:00:00 2001
|
||||
From: Gerasim Troeglazov <3dEyes@gmail.com>
|
||||
Date: Sun, 14 Apr 2019 13:37:19 +1000
|
||||
Subject: Fix memory leaks
|
||||
|
||||
|
||||
diff --git a/src/drivers/fluid_haiku.cpp b/src/drivers/fluid_haiku.cpp
|
||||
index 31bfdea..2871948 100644
|
||||
--- a/src/drivers/fluid_haiku.cpp
|
||||
+++ b/src/drivers/fluid_haiku.cpp
|
||||
@@ -129,11 +129,12 @@ new_fluid_haiku_audio_driver(fluid_settings_t *settings, fluid_synth_t *synth)
|
||||
void delete_fluid_haiku_audio_driver(fluid_audio_driver_t *d)
|
||||
{
|
||||
fluid_haiku_audio_driver_t *dev = (fluid_haiku_audio_driver_t *) d;
|
||||
- if (dev->m_player) {
|
||||
+ 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);
|
||||
}
|
||||
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user