Sox: Difference between revisions

From VoIPmonitor.org
Jump to navigation Jump to search
No edit summary
No edit summary
Line 14: Line 14:


# now grab sox and its dependencies
# now grab sox and its dependencies
  mkdir -p deps mkdir -p deps/unpacked mkdir -p deps/built mkdir -p deps/built/libmad mkdir -p deps/built/sox mkdir -p deps/built/lame wget -O deps/sox-14.4.1.tar.bz2 "http://downloads.sourceforge.net/project/sox/sox/14.4.1/sox-14.4.1.tar.bz2? r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fsox%2Ffiles%2Fsox%2F14.4.1%2F&ts=1416316415&use_mirror=heanet"  wget -O deps/libmad-0.15.1b.tar.gz "http://downloads.sourceforge.net/project/mad/libmad/0.15.1b/libmad-0.15.1b.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmad%2Ffiles%2Flibmad%2F0.15.1b%2F&ts=1416316482&use_mirror=heanet" wget -O deps/lame-3.99.5.tar.gz "http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Flame%2Ffiles%2Flame%2F3.99%2F&ts=1416316457&use_mirror=kent"
  mkdir -p deps  
# unpack the dependencies pushd deps/unpacked tar xvfpj ../sox-14.4.1.tar.bz2 tar xvfpz ../libmad-0.15.1b.tar.gz tar xvfpz ../lame-3.99.5.tar.gz popd
mkdir -p deps/unpacked  
# build libmad, statically pushd deps/unpacked/libmad-0.15.1b ./configure --disable-shared --enable-static --prefix=$(realpath ../../built/libmad) # Patch makefile to remove -fforce-mem sed s/-fforce-mem//g < Makefile > Makefile.patched cp Makefile.patched Makefile make make install popd
mkdir -p deps/built  
mkdir -p deps/built/libmad  
mkdir -p deps/built/sox  
mkdir -p deps/built/lame  
wget -O deps/sox-14.4.1.tar.bz2 "http://downloads.sourceforge.net/project/sox/sox/14.4.1/sox-14.4.1.tar.bz2? r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fsox%2Ffiles%2Fsox%2F14.4.1%2F&ts=1416316415&use_mirror=heanet"
  wget -O deps/libmad-0.15.1b.tar.gz "http://downloads.sourceforge.net/project/mad/libmad/0.15.1b/libmad-0.15.1b.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmad%2Ffiles%2Flibmad%2F0.15.1b%2F&ts=1416316482&use_mirror=heanet"  
wget -O deps/lame-3.99.5.tar.gz "http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Flame%2Ffiles%2Flame%2F3.99%2F&ts=1416316457&use_mirror=kent"
# unpack the dependencies pushd deps/unpacked  
tar xvfpj ../sox-14.4.1.tar.bz2  
tar xvfpz ../libmad-0.15.1b.tar.gz  
tar xvfpz ../lame-3.99.5.tar.gz
popd
# build libmad, statically pushd deps/unpacked/libmad-0.15.1b  
./configure --disable-shared --enable-static --prefix=$(realpath ../../built/libmad)  
# Patch makefile to remove -fforce-mem  
sed s/-fforce-mem//g < Makefile > Makefile.patched  
cp Makefile.patched Makefile  
make  
make  
install popd


# build lame, statically pushd deps/unpacked/lame-3.99.5 ./configure --disable-shared --enable-static --prefix=$(realpath ../../built/lame) make make install popd# build sox, statically pushd deps/unpacked/sox-14.4.1 ./configure --disable-shared --enable-static --prefix=$(realpath ../../built/sox) \    LDFLAGS="-L$(realpath ../../built/libmad/lib) -L$(realpath ../../built/lame/lib)" \    CPPFLAGS="-I$(realpath ../../built/libmad/include) -I$(realpath ../../built/lame/include)" \    --with-mad --with-lame --without-oss --without-sndfile --without-flac  --disable-gomp make -j8
# build lame, statically  
pushd deps/unpacked/lame-3.99.5  
./configure --disable-shared --enable-static --prefix=$(realpath ../../built/lame)  
make  
make install  
popd
# build sox, statically  
pushd deps/unpacked/sox-14.4.1  
./configure --disable-shared --enable-static --prefix=$(realpath ../../built/sox) \    LDFLAGS="-L$(realpath ../../built/libmad/lib) -L$(realpath ../../built/lame/lib)" \    CPPFLAGS="-I$(realpath ../../built/libmad/include) -I$(realpath ../../built/lame/include)" \    --with-mad --with-lame --without-oss --without-sndfile --without-flac  --disable-gomp make -j8
  cd src /bin/bash ../libtool --silent --tag=CC  --silent --mode=link gcc -Wtraditional-conversion  -g -O2 --static -D_FORTIFY_SOURCE=2 -Wall -W -Wmissing-prototypes -Wstrict-prototypes -pedantic  -L/usr/src/deps/built/libmad/lib -L/usr/src/deps/built/lame/lib -Wl,-z,defs -o sox sox.o  libsox.la          -lmad -lmp3lame      -lvorbisenc -lvorbisfile -lvorbis  -logg  -lm cd .. make install popd
  cd src /bin/bash ../libtool --silent --tag=CC  --silent --mode=link gcc -Wtraditional-conversion  -g -O2 --static -D_FORTIFY_SOURCE=2 -Wall -W -Wmissing-prototypes -Wstrict-prototypes -pedantic  -L/usr/src/deps/built/libmad/lib -L/usr/src/deps/built/lame/lib -Wl,-z,defs -o sox sox.o  libsox.la          -lmad -lmp3lame      -lvorbisenc -lvorbisfile -lvorbis  -logg  -lm cd .. make install popd
  cp deps/built/sox/bin/sox . rm -rf deps/built rm -rf deps/unpacked
  cp deps/built/sox/bin/sox . rm -rf deps/built rm -rf deps/unpacked

Revision as of 13:15, 30 November 2015

# First, create a debian wheezy chroot sudo debootstrap --arch=amd64 wheezy ./wheezy/ http://ftp.de.debian.org/debian/
sudo  mount -o bind /dev wheezy/dev
sudo mount -t proc none wheezy/proc
sudo chroot wheezy
cd /tmp # somewhere to do this


  1. update our debian system, and install libmad, which is what we need for mp3 support in sox apt-get update
apt-get install build-essential
apt-get install libmad0-dev
apt-get install realpath


  1. now grab sox and its dependencies
mkdir -p deps 
mkdir -p deps/unpacked 
mkdir -p deps/built 
mkdir -p deps/built/libmad 
mkdir -p deps/built/sox 
mkdir -p deps/built/lame 
wget -O deps/sox-14.4.1.tar.bz2 "http://downloads.sourceforge.net/project/sox/sox/14.4.1/sox-14.4.1.tar.bz2? r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fsox%2Ffiles%2Fsox%2F14.4.1%2F&ts=1416316415&use_mirror=heanet"  
wget -O deps/libmad-0.15.1b.tar.gz "http://downloads.sourceforge.net/project/mad/libmad/0.15.1b/libmad-0.15.1b.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmad%2Ffiles%2Flibmad%2F0.15.1b%2F&ts=1416316482&use_mirror=heanet" 
wget -O deps/lame-3.99.5.tar.gz "http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Flame%2Ffiles%2Flame%2F3.99%2F&ts=1416316457&use_mirror=kent"
  1. unpack the dependencies pushd deps/unpacked
tar xvfpj ../sox-14.4.1.tar.bz2 
tar xvfpz ../libmad-0.15.1b.tar.gz 
tar xvfpz ../lame-3.99.5.tar.gz
popd
# build libmad, statically pushd deps/unpacked/libmad-0.15.1b 
./configure --disable-shared --enable-static --prefix=$(realpath ../../built/libmad) 
# Patch makefile to remove -fforce-mem 
sed s/-fforce-mem//g < Makefile > Makefile.patched 
cp Makefile.patched Makefile 
make 
make 
install popd
  1. build lame, statically
pushd deps/unpacked/lame-3.99.5 
./configure --disable-shared --enable-static --prefix=$(realpath ../../built/lame) 
make 
make install 
popd
# build sox, statically 
pushd deps/unpacked/sox-14.4.1 
./configure --disable-shared --enable-static --prefix=$(realpath ../../built/sox) \    LDFLAGS="-L$(realpath ../../built/libmad/lib) -L$(realpath ../../built/lame/lib)" \    CPPFLAGS="-I$(realpath ../../built/libmad/include) -I$(realpath ../../built/lame/include)" \    --with-mad --with-lame --without-oss --without-sndfile --without-flac  --disable-gomp make -j8
cd src /bin/bash ../libtool --silent --tag=CC  --silent --mode=link gcc -Wtraditional-conversion  -g -O2 --static -D_FORTIFY_SOURCE=2 -Wall -W -Wmissing-prototypes -Wstrict-prototypes -pedantic  -L/usr/src/deps/built/libmad/lib -L/usr/src/deps/built/lame/lib -Wl,-z,defs -o sox sox.o  libsox.la          -lmad -lmp3lame      -lvorbisenc -lvorbisfile -lvorbis  -logg   -lm cd .. make install popd
cp deps/built/sox/bin/sox . rm -rf deps/built rm -rf deps/unpacked