homebrew-core/Formula/sox.rb
Misty De Meo 1877c4376c sox: Fix compilation with ffmpeg >= 0.7
ffmpeg compilation broke against ffmpeg 0.7; this patch from the
official sox git repo lets it build against the version we use. The
patch should be able to be removed in the next version.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-09-01 13:00:54 -07:00

45 lines
1.1 KiB
Ruby

require 'formula'
class Sox < Formula
url 'http://downloads.sourceforge.net/project/sox/sox/14.3.2/sox-14.3.2.tar.gz'
homepage 'http://sox.sourceforge.net/'
md5 'e9d35cf3b0f8878596e0b7c49f9e8302'
depends_on 'pkg-config' => :build
depends_on 'libvorbis' => :optional
depends_on 'flac' => :optional
depends_on 'libao' => :optional
depends_on 'mad' # see commit message
def patches
# sox does not build against libav >= 0.7.0
# http://sox.git.sourceforge.net/git/gitweb.cgi?p=sox/sox;a=commitdiff;h=c81a45e9b54fdb8c1835aeb575e748ec6d7c921d
# Can be removed in the next release
DATA
end
def install
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--disable-gomp"
system "make install"
end
end
__END__
--- a/src/ffmpeg.c
+++ b/src/ffmpeg.c
@@ -50,6 +50,13 @@
#include <ctype.h>
#include "ffmpeg.h"
+#ifndef CODEC_TYPE_AUDIO
+#define CODEC_TYPE_AUDIO AVMEDIA_TYPE_AUDIO
+#endif
+#ifndef PKT_FLAG_KEY
+#define PKT_FLAG_KEY AV_PKT_FLAG_KEY
+#endif
+
/* Private data for ffmpeg files */
typedef struct {
int audio_index;