@@ -24,6 +24,18 @@ all_found() {
2424 done
2525}
2626
27+ found_ogg () {
28+ all_found " $1 " ' include/ogg/ogg.h' ' lib/libogg.a'
29+ }
30+
31+ found_vorbis () {
32+ all_found " $1 " \
33+ ' include/vorbis/vorbisenc.h' \
34+ ' include/vorbis/vorbisfile.h' \
35+ ' lib/libvorbis.a' \
36+ ' lib/libvorbisenc.a' \
37+ ' lib/libvorbisfile.a'
38+ }
2739
2840found_lame () {
2941 all_found " $1 " ' include/lame/lame.h' ' lib/libmp3lame.a'
@@ -57,6 +69,82 @@ found_sox() {
5769 all_found " $1 " ' include/sox.h' ' lib/libsox.a'
5870}
5971
72+ # libogg 1.3.4 has bug on mac OS.
73+ # https://trac.macports.org/ticket/58924
74+ OGG=" libogg-1.3.3"
75+ OGG_ARCHIVE=" ${OGG} .tar.gz"
76+
77+ get_ogg () {
78+ work_dir=" $1 "
79+ url=" https://ftp.osuosl.org/pub/xiph/releases/ogg/${OGG_ARCHIVE} "
80+ (
81+ cd " ${work_dir} "
82+ if [ ! -d " ${OGG} " ]; then
83+ if [ ! -f " ${OGG_ARCHIVE} " ]; then
84+ printf " Fetching libogg from %s\n" " ${url} "
85+ curl $CURL_OPTS -O " ${url} "
86+ fi
87+ fi
88+ )
89+ }
90+
91+ build_ogg () {
92+ work_dir=" $1 "
93+ install_dir=" $2 "
94+ (
95+ cd " ${work_dir} "
96+ if [ ! -d " ${OGG} " ]; then
97+ tar xfp " ${OGG_ARCHIVE} "
98+ fi
99+ cd " ${OGG} "
100+ printf " Building libogg\n"
101+ if [ ! -f Makefile ]; then
102+ ./configure ${CONFIG_OPTS} \
103+ --disable-shared --enable-static --prefix=" ${install_dir} " CFLAGS=-fPIC CXXFLAGS=-fPIC \
104+ --with-pic --disable-dependency-tracking
105+ fi
106+ make ${MAKE_OPTS} > make.log 2>&1
107+ make install
108+ )
109+ }
110+
111+ VORBIS=" libvorbis-1.3.6"
112+ VORBIS_ARCHIVE=" ${VORBIS} .tar.gz"
113+
114+ get_vorbis () {
115+ work_dir=" $1 "
116+ url=" https://ftp.osuosl.org/pub/xiph/releases/vorbis/${VORBIS_ARCHIVE} "
117+ (
118+ cd " ${work_dir} "
119+ if [ ! -d " ${VORBIS} " ]; then
120+ if [ ! -f " ${VORBIS_ARCHIVE} " ]; then
121+ printf " Fetching libvorbis from %s\n" " ${url} "
122+ curl $CURL_OPTS -O " ${url} "
123+ fi
124+ fi
125+ )
126+ }
127+
128+ build_vorbis () {
129+ work_dir=" $1 "
130+ install_dir=" $2 "
131+ (
132+ cd " ${work_dir} "
133+ if [ ! -d " ${VORBIS} " ]; then
134+ tar xfp " ${VORBIS_ARCHIVE} "
135+ fi
136+ cd " ${VORBIS} "
137+ printf " Building libvorbis\n"
138+ if [ ! -f Makefile ]; then
139+ ./configure ${CONFIG_OPTS} \
140+ --disable-shared --enable-static --prefix=" ${install_dir} " CFLAGS=-fPIC CXXFLAGS=-fPIC \
141+ --with-pic --disable-dependency-tracking
142+ fi
143+ make ${MAKE_OPTS} > make.log 2>&1
144+ make install
145+ )
146+ }
147+
60148LAME=" lame-3.99.5"
61149LAME_ARCHIVE=" ${LAME} .tar.gz"
62150
@@ -126,7 +214,7 @@ build_flac() {
126214 if [ ! -f Makefile ]; then
127215 ./configure ${CONFIG_OPTS} \
128216 --disable-shared --enable-static --prefix=" ${install_dir} " CFLAGS=-fPIC CXXFLAGS=-fPIC \
129- --with-pic --disable-debug --disable-dependency-tracking
217+ --with-pic --with-ogg= " ${install_dir} " -- disable-debug --disable-dependency-tracking
130218 fi
131219 make ${MAKE_OPTS} > make.log 2>&1
132220 make ${MAKE_OPTS} install
@@ -207,8 +295,8 @@ build_sox() {
207295 # it statically if we do.
208296 ./configure ${CONFIG_OPTS} --disable-shared --enable-static --prefix=" ${install_dir} " \
209297 LDFLAGS=" -L${install_dir} /lib" CPPFLAGS=" -I${install_dir} /include" \
210- --with-lame --with-flac --with-mad --without-alsa --without-coreaudio \
211- --without-png --without-oggvorbis --without- oss --without-sndfile \
298+ --with-lame --with-flac --with-mad --with-oggvorbis -- without-alsa --without-coreaudio \
299+ --without-png --without-oss --without-sndfile \
212300 CFLAGS=-fPIC CXXFLAGS=-fPIC --with-pic --disable-debug --disable-dependency-tracking
213301 fi
214302 make ${MAKE_OPTS} > make.log 2>&1
0 commit comments