Skip to content

Instantly share code, notes, and snippets.

@rememberlenny
Forked from chrisn/Dockerfile
Created November 4, 2021 18:57
Show Gist options
  • Save rememberlenny/0417623c6c2a99983a2130898d452d0e to your computer and use it in GitHub Desktop.
Save rememberlenny/0417623c6c2a99983a2130898d452d0e to your computer and use it in GitHub Desktop.
Compile audiowaveform in Docker for amazonlinux:1
#!/bin/sh
set -ex
# Build libid3tag
cd $HOME
wget https://netix.dl.sourceforge.net/project/mad/libid3tag/0.15.1b/libid3tag-0.15.1b.tar.gz
tar xzf libid3tag-0.15.1b.tar.gz
cd libid3tag-0.15.1b
sed -i 's/ -fforce-mem//' configure
./configure --disable-shared --prefix=/usr --libdir=/usr/lib64
make install
# Build libmad
cd $HOME
wget https://netix.dl.sourceforge.net/project/mad/libmad/0.15.1b/libmad-0.15.1b.tar.gz
tar xzf libmad-0.15.1b.tar.gz
cd libmad-0.15.1b
sed -i 's/ -fforce-mem//' configure
./configure --disable-shared --prefix=/usr --libdir=/usr/lib64
make install
# Build libogg
cd $HOME
wget http://downloads.xiph.org/releases/ogg/libogg-1.3.4.tar.gz
tar xf libogg-1.3.4.tar.gz
cd libogg-1.3.4
./configure --disable-shared --prefix=/usr --libdir=/usr/lib64
make install
# Build libvorbis
cd $HOME
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.6.tar.gz
tar xf libvorbis-1.3.6.tar.gz
cd libvorbis-1.3.6
./configure --disable-shared --prefix=/usr --libdir=/usr/lib64
make install
# Build libFLAC
cd $HOME
wget https://ftp.osuosl.org/pub/xiph/releases/flac/flac-1.3.3.tar.xz
tar xf flac-1.3.3.tar.xz
cd flac-1.3.3
./configure --disable-shared --prefix=/usr --libdir=/usr/lib64
make install
# Build libgd
cd $HOME
wget https://github.com/libgd/libgd/releases/download/gd-2.2.5/libgd-2.2.5.tar.gz
tar xzf libgd-2.2.5.tar.gz
cd libgd-2.2.5
mkdir build
cd build
cmake -DBUILD_STATIC_LIBS=1 -DENABLE_PNG=1 ..
make
make install
# Build libsndfile (Amazon repo only has earlier 1.0.25 release)
# Requires autogen, automake, and libtool packages
cd $HOME
wget https://github.com/erikd/libsndfile/archive/1.0.28.tar.gz
tar xzf 1.0.28.tar.gz
cd libsndfile-1.0.28
./autogen.sh
./configure --disable-shared --prefix=/usr --libdir=/usr/lib64
make install
# Build audiowaveform
cd $HOME
wget https://github.com/bbc/audiowaveform/archive/1.4.1.tar.gz
tar xzf 1.4.1.tar.gz
cd audiowaveform-1.4.1
sed -i 's/ -no-pie//' CMakeLists.txt
mkdir build
cd build
cmake -D ENABLE_TESTS=0 -D BUILD_STATIC=1 ..
make
strip audiowaveform
# Check dependencies
ldd audiowaveform
# Test
./audiowaveform -i ../test/data/test_file_stereo.flac -o test.dat -b 8
FROM amazonlinux:1
RUN yum -y update
RUN yum -y install make wget tar gcc gcc-c++ file diffutils
RUN wget https://cmake.org/files/v3.7/cmake-3.7.2.tar.gz && \
tar -xzvf cmake-3.7.2.tar.gz && cd cmake-3.7.2 && \
./bootstrap && make && make install
RUN yum -y install cmake autogen automake libtool \
gzip zip libcurl-devel zlib-static libpng-static xz git \
boost-static boost-devel \
bzip2-devel which gd-devel
COPY ./build.sh /root/build.sh
RUN chmod +x /root/build.sh
WORKDIR /root
RUN ./build.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment