Skip to content

Instantly share code, notes, and snippets.

@rakkesh
Last active October 31, 2015 08:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rakkesh/ab4dfc7125bfb8f78fa5 to your computer and use it in GitHub Desktop.
Save rakkesh/ab4dfc7125bfb8f78fa5 to your computer and use it in GitHub Desktop.
Homebrew freeswitch recipe diff with commit f65e2e08205b48591d826af0748c3671f3018f28
diff --git a/Library/Formula/freeswitch.rb b/Library/Formula/freeswitch.rb
index 6322420..3babf80 100644
--- a/Library/Formula/freeswitch.rb
+++ b/Library/Formula/freeswitch.rb
@@ -2,8 +2,8 @@ class Freeswitch < Formula
desc "Telephony platform to route various communication protocols"
homepage "https://freeswitch.org"
url "https://freeswitch.org/stash/scm/fs/freeswitch.git",
- :tag => "v1.4.23",
- :revision => "aaef0e298730d0f1cc11f2573bb6e6d999b0242d"
+ :tag => "v1.6.2",
+ :revision => "643e3ff88fc96872fec3bd3c70fa2be74dbe974a"
head "https://freeswitch.org/stash/scm/fs/freeswitch.git"
@@ -17,12 +17,15 @@ class Freeswitch < Formula
option "without-sounds-en", "Do not install English (Callie) sounds"
option "with-sounds-fr", "Install French (June) sounds"
option "with-sounds-ru", "Install Russian (Elena) sounds"
+ option "with-opus", "Build with opus audio codec"
+ option "with-video-fsv", "Build with video support (mod_fsv) with libvpx and libyuv"
+ option "with-tts-flite", "Build with TTS support using libflite"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "pkg-config" => :build
- depends_on :apr => :build
+ depends_on "apr" => :build
depends_on "curl"
depends_on "jpeg"
@@ -31,6 +34,8 @@ class Freeswitch < Formula
depends_on "pcre"
depends_on "speex"
depends_on "sqlite"
+ depends_on "opus" if build.with? "opus"
+ depends_on "libvpx" if build.with? "video-fsv"
#----------------------- Begin sound file resources -------------------------
sounds_url_base = "https://files.freeswitch.org/releases/sounds"
@@ -137,7 +142,52 @@ class Freeswitch < Formula
#------------------------ End sound file resources --------------------------
+ # resource to support video - mod_fsv
+ resource "libyuv" do
+ url "https://freeswitch.org/stash/scm/sd/libyuv.git", :revision => "1ebf86795cb213a37f06eb1ef3713cff080568ea"
+ end if build.with? "video-fsv"
+
+ # resource to support TTS - mod_flite
+ resource "libflite" do
+ url "https://freeswitch.org/stash/scm/sd/libflite.git", :revision => "97e8b9a99ce6f9d0924e3f5f27e22b06a639af1f"
+ end if build.with? "tts-flite"
+
def install
+ vendor_dir="#{Formula["freeswitch"].prefix}/libexec/vendor"
+
+ # build resources, if requested.
+ if build.with? "video"
+ resource("libyuv").stage do
+ inreplace "Makefile", "PREFIX:=/usr", "PREFIX:=#{vendor_dir}"
+ system "make"
+ system "make", "install"
+ end
+ else
+ inreplace "build/modules.conf.in", "applications/mod_fsv", "#applications/mod_fsv"
+ inreplace "build/modules.conf.in", "codecs/mod_vpx", "#codecs/mod_vpx"
+ end
+
+ if build.with? "tts-flite"
+ resource("libflite").stage do
+ system "./configure", "--prefix=#{vendor_dir}"
+ system "make"
+ system "make", "install"
+ end
+ inreplace "build/modules.conf.in", "#asr_tts/mod_flite", "asr_tts/mod_flite"
+ end
+
+ if build.without? "opus"
+ inreplace "build/modules.conf.in", "codecs/mod_opus", "#codecs/mod_opus"
+ end
+
+ # these modules are enabled by default for current release 1.6.2, disable them.
+ inreplace "build/modules.conf.in", "codecs/mod_bv", "#codecs/mod_bv"
+ inreplace "build/modules.conf.in", "formats/mod_sndfile", "#formats/mod_sndfile"
+
+ ENV.append_path("PKG_CONFIG_PATH", "#{vendor_dir}/lib/pkgconfig")
+
+ # start of freeswitch build
system "./bootstrap.sh", "-j"
# tiff will fail to find OpenGL unless told not to use X
@@ -193,7 +243,7 @@ class Freeswitch < Formula
end
end
- plist_options :manual => "freeswitch -nc --nonat"
+ plist_options :manual => "freeswitch -ncwait -nonat"
def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment