From 3ea25c50565d9f9d4059392cba8d89ed936e0588 Mon Sep 17 00:00:00 2001 From: Tres Finocchiaro Date: Tue, 21 Mar 2017 09:59:04 -0400 Subject: [PATCH] Add SF2 support for macOS (#3446) * Add SF2 support for macOS Closes #649 --- .travis/osx..install.sh | 8 +++++++- CMakeLists.txt | 1 - cmake/apple/fluid-synth.rb | 42 ++++++++++++++++++++++++++++++++++++++ plugins/CMakeLists.txt | 7 +------ 4 files changed, 50 insertions(+), 8 deletions(-) create mode 100644 cmake/apple/fluid-synth.rb diff --git a/.travis/osx..install.sh b/.travis/osx..install.sh index 3387399959d..371834575d4 100644 --- a/.travis/osx..install.sh +++ b/.travis/osx..install.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -PACKAGES="cmake pkgconfig fftw libogg libvorbis libsndfile libsamplerate jack sdl stk fluid-synth portaudio node fltk" +PACKAGES="cmake pkgconfig fftw libogg libvorbis libsndfile libsamplerate jack sdl stk portaudio node fltk" if [ $QT5 ]; then PACKAGES="$PACKAGES homebrew/versions/qt55" @@ -10,4 +10,10 @@ fi brew install $PACKAGES +# Recompile fluid-synth without CoreAudio per issues #649 +# Changes to fluid-synth.rb must be pushed to URL prior to use +url=$(git remote get-url origin) +branch=$(git symbolic-ref --short HEAD) +brew install --build-from-source $url/raw/$branch/cmake/apple/fluid-synth.rb + sudo npm install -g appdmg diff --git a/CMakeLists.txt b/CMakeLists.txt index 5750da4c14b..7b351b4691a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,7 +67,6 @@ OPTION(WANT_QT5 "Build with Qt5" OFF) IF(LMMS_BUILD_APPLE) - SET(WANT_SF2 OFF) SET(WANT_ALSA OFF) SET(WANT_PULSEAUDIO OFF) SET(WANT_VST OFF) diff --git a/cmake/apple/fluid-synth.rb b/cmake/apple/fluid-synth.rb new file mode 100644 index 00000000000..d05fb4d6579 --- /dev/null +++ b/cmake/apple/fluid-synth.rb @@ -0,0 +1,42 @@ +# Copyright (c) 2009-present, Homebrew contributors +# License: BSD 2-Clause + +class FluidSynth < Formula + desc "Real-time software synthesizer based on the SoundFont 2 specs" + homepage "http://www.fluidsynth.org" + url "https://downloads.sourceforge.net/project/fluidsynth/fluidsynth-1.1.6/fluidsynth-1.1.6.tar.gz" + sha256 "50853391d9ebeda9b4db787efb23f98b1e26b7296dd2bb5d0d96b5bccee2171c" + + bottle do + cellar :any + rebuild 1 + sha256 "ee86f0e263db0610a340592d725bd2c05bc5ed1bfa6eb496ae304297de261ae0" => :sierra + sha256 "dfe31491d27c3c29ff4686900984e5884f89cd249d82b3dba4ad077f7bbe9057" => :el_capitan + sha256 "6938c03a61b696870de92435dc0a6e6118fbb0d68adcd0d17ec8d30c2f7eee20" => :yosemite + sha256 "5c5e00f88e45dd661c15f0e13793f9cc96f285b08200145ce8b77982350a5625" => :mavericks + sha256 "83b972cf7aec57e78dc1c1a6b3e286d8b9bf2a2622e174bca42efa8576e36e5f" => :mountain_lion + end + + depends_on "pkg-config" => :build + depends_on "cmake" => :build + depends_on "glib" + depends_on "libsndfile" => :optional + depends_on "portaudio" => :optional + + def install + args = std_cmake_args + args << "-Denable-framework=OFF" << "-DLIB_SUFFIX=" + args << "-Denable-portaudio=ON" if build.with? "portaudio" + args << "-Denable-libsndfile=OFF" if build.without? "libsndfile" + args << "-Denable-coreaudio=OFF" # Per lmms/issues/649 + + mkdir "build" do + system "cmake", "..", *args + system "make", "install" + end + end + + test do + assert_match /#{version}/, shell_output("#{bin}/fluidsynth --version") + end +end diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 0241c3bc31c..8a464e3886d 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -67,6 +67,7 @@ IF("${PLUGIN_LIST}" STREQUAL "") peak_controller_effect GigPlayer ReverbSC + sf2_player sfxr sid SpectrumAnalyzer @@ -82,12 +83,6 @@ IF("${PLUGIN_LIST}" STREQUAL "") zynaddsubfx ) - IF(NOT LMMS_BUILD_APPLE) - SET(PLUGIN_LIST - ${PLUGIN_LIST} - sf2_player - ) - ENDIF() ENDIF("${PLUGIN_LIST}" STREQUAL "") FOREACH(PLUGIN ${PLUGIN_LIST})