Skip to content

Instantly share code, notes, and snippets.

@jtmoon79
Last active September 28, 2019 19:44
Show Gist options
  • Save jtmoon79/b915e11183e1546733ecc9eea5938d84 to your computer and use it in GitHub Desktop.
Save jtmoon79/b915e11183e1546733ecc9eea5938d84 to your computer and use it in GitHub Desktop.
build and install Air DC++ (airdcppd) on Raspberry Pi
# Build Air DC++ for Raspberry Pi Debian Stretch
# Uses a docker Raspberry Pi image to temporarily install necessary build tools and contain the mess
#
# This is not a script. This is shell commands that should be copy+pasted and tweaked to your setup
#
# This worked for using Raspberry Pi Debian Stretch and AirDC++ version 2.7.0b
# MMV
#
# run on Raspberry Pi
#
docker run --rm -it raspbian/stretch bash -l
#
# run within Debian Stretch docker instance on Raspberry Pi
#
# install most things ahead of time
export LANGUAGE=en_US
apt update
apt install \
cmake make git \
pkg-config \
gcc g++ build-essential \
wget \
unzip bzip2 libbz2-dev libz-dev \
openssl libssl-dev \
libmaxminddb0 libmaxminddb-dev mmdb-bin \
miniupnpc \
libtbb-dev
# build and install miniupnp
cd /tmp
wget -O miniupnpc-1.9.20160209.tar.gz 'http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.9.20160209.tar.gz'
gunzip miniupnpc-1.9.20160209.tar.gz
cd miniupnpc-1.9.20160209/
make
make install
# build and install leveldb
cd /tmp
apt install libsnappy-dev
wget https://github.com/google/leveldb/archive/v1.20.zip
unzip v1.20.zip
cd leveldb-1.20/
make
cp -va out-static/lib* out-shared/lib* /usr/local/lib/
cd include
cp -va leveldb /usr/local/include
ldconfig
# build and install websocketpp
cd /tmp
wget https://github.com/zaphoyd/websocketpp/archive/0.8.1.zip
unzip 0.8.1.zip
cd websocketpp-0.8.1/
cmake .
make install
# build and install airdcpp-webclient version 2.7.0b
cd /tmp
wget https://github.com/airdcpp-web/airdcpp-webclient/archive/2.7.0b.zip
unzip 2.7.0b.zip
cd airdcpp-webclient-2.7.0b
cmake .
make -j1 # force to confine to one CPU process, else will run out of RAM
#
# copy binaries needed out of docker instance onto Raspberry Pi host, in this case named "rapsberrypi.local"
# many ways to do this. this uses tar and scp to do so.
#
cd /
tar -vcpf /tmp/airdcpp-webclient-build.tar /usr/local/share/airdcpp /usr/local/lib/libairdcpp* /usr/local/bin/airdcppd
scp /tmp/airdcpp-webclient-build.tar root@rapsberrypi.local:/tmp/
tar -vcpf /tmp/miniupnpc-1.9.20160209-install.tar /usr/include/miniupnpc /usr/lib/libminiupnpc.* /usr/bin/upnpc /usr/bin/external-ip /usr/share/man/man3/miniupnpc.3.gz
scp /tmp/miniupnpc-1.9.20160209-install.tar root@rapsberrypi.local:/tmp/
tar -vpcf /tmp/leveldb-1.20-install.tar /usr/local/lib/libleveldb.* /usr/local/lib/libmemenv.a /usr/local/include/leveldb
scp /tmp/leveldb-1.20-install.tar root@rapsberrypi.local:/tmp/
# exit the docker instance
exit
#
# run on Raspberry Pi
# "install" the binaries that were built (just untar binaries from /)
#
cd /
tar -xvf /tmp/miniupnpc-1.9.20160209-install.tar
tar -xvf /tmp/leveldb-1.20-install.tar
tar -xvf /tmp/airdcpp-webclient-build.tar
ldconfig
apt install libsnappy-dev \
libtbb-dev \
libmaxminddb0 libmaxminddb-dev mmdb-bin
# run Air DC++
airdcppd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment