mirror of
https://github.com/badaix/snapcast.git
synced 2025-07-23 19:38:31 +02:00
166 lines
4.9 KiB
Markdown
166 lines
4.9 KiB
Markdown
#Build Snapcast
|
|
Clone the Snapcast repository. To do this, you need git.
|
|
For Debian derivates (e.g. Raspbian, Debian, Ubuntu, Mint):
|
|
|
|
$ sudo apt-get install git
|
|
|
|
For Arch derivates:
|
|
|
|
$ pacman -S git
|
|
|
|
For FreeBSD:
|
|
|
|
$ sudo pkg install git
|
|
|
|
Clone Snapcast:
|
|
|
|
$ git clone https://github.com/badaix/snapcast.git
|
|
|
|
this creates a directory `snapcast`, in the following referred to as `<snapcast dir>`.
|
|
Next clone the external submodules:
|
|
|
|
$ cd <snapcast dir>/externals
|
|
$ git submodule update --init --recursive
|
|
|
|
|
|
##Linux (Native)
|
|
Install the build tools and required libs:
|
|
For Debian derivates (e.g. Raspbian, Debian, Ubuntu, Mint):
|
|
|
|
$ sudo apt-get install build-essential
|
|
$ sudo apt-get install libasound2-dev libvorbisidec-dev libvorbis-dev libflac-dev alsa-utils libavahi-client-dev avahi-daemon
|
|
|
|
Compilation requires gcc 4.8 or higher, so it's highly recommended to use Debian (Respbian) Jessie.
|
|
|
|
For Arch derivates:
|
|
|
|
$ pacman -S base-devel
|
|
$ pacman -S alsa-lib avahi libvorbis flac alsa-utils
|
|
|
|
###Build Snapclient and Snapserver
|
|
`cd` into the Snapcast src-root directory:
|
|
|
|
$ cd <snapcast dir>
|
|
$ make
|
|
|
|
Install Snapclient and/or Snapserver:
|
|
|
|
$ sudo make installserver
|
|
$ sudo make installclient
|
|
|
|
This will copy the client and/or server binary to `/usr/sbin` and update init.d/systemd to start the client/server as a daemon.
|
|
|
|
###Build Snapclient
|
|
`cd` into the Snapclient src-root directory:
|
|
|
|
$ cd <snapcast dir>/client
|
|
$ make
|
|
|
|
Install Snapclient
|
|
|
|
$ sudo make install
|
|
|
|
This will copy the client binary to `/usr/sbin` and update init.d/systemd to start the client as a daemon.
|
|
|
|
###Build Snapserver
|
|
`cd` into the Snapserver src-root directory:
|
|
|
|
$ cd <snapcast dir>/server
|
|
$ make
|
|
|
|
Install Snapserver
|
|
|
|
$ sudo make install
|
|
|
|
This will copy the server binary to `/usr/sbin` and update init.d/systemd to start the server as a daemon.
|
|
|
|
|
|
##FreeBSD (Native)
|
|
Install the build tools and required libs:
|
|
|
|
$ sudo pkg install gmake gcc bash avahi libogg libvorbis flac
|
|
|
|
###Build Snapserver
|
|
`cd` into the Snapserver src-root directory:
|
|
|
|
$ cd <snapcast dir>/server
|
|
$ gmake TARGET=FREEBSD
|
|
|
|
Install Snapserver
|
|
|
|
$ sudo gmake TARGET=FREEBSD install
|
|
|
|
This will copy the server binary to `/usr/local/sbin` and the startup script to `/usr/local/etc/rc.d/snapserver`. To enable the Snapserver, add this line to `/etc/rc.conf`:
|
|
|
|
snapserver_enable="YES"
|
|
|
|
For additional command line arguments, add in `/etc/rc.conf`:
|
|
|
|
snapserver_opts="<your custom options>"
|
|
|
|
Start and stop the server with `sudo service snapserver start` and `sudo service snapserver stop`.
|
|
|
|
##Android (Cross compile)
|
|
Cross compilation for Android is done with the [Android NDK](http://developer.android.com/tools/sdk/ndk/index.html) on a Linux host machine.
|
|
|
|
###Android NDK setup
|
|
http://developer.android.com/ndk/guides/standalone_toolchain.html
|
|
1. Download NDK: `http://dl.google.com/android/repository/android-ndk-r12b-linux-x86_64.zip`
|
|
2. Extract to: `/SOME/LOCAL/PATH/android-ndk-r12b`
|
|
3. Setup toolchain somewhere in your home dir (`<android-ndk dir>`):
|
|
|
|
````
|
|
$ cd /SOME/LOCAL/PATH/android-ndk-r10e/build/tools
|
|
$ ./make-standalone-toolchain.sh --arch=arm --platform=android-14 --install-dir=<android-ndk dir> --ndk-dir=/SOME/LOCAL/PATH/android-ndk-r12b
|
|
````
|
|
|
|
###Build Snapclient
|
|
Edit the first lines in `<snapcast dir>/client/build_android.sh` and in `<snapcast dir>/externals/build_externals_android.sh` to let `NDK_DIR` point to your `<android-ndk dir>`
|
|
Cross compile and install FLAC (only needed once):
|
|
|
|
$ cd <snapcast dir>/externals
|
|
$ ./build_externals_android.sh
|
|
|
|
Compile the Snapclient:
|
|
|
|
$ cd <snapcast dir>/client
|
|
$ ./build_android.sh
|
|
|
|
The binaries for `armeabi` and `armeabi-v7a` will be copied into the Android's assets directory (`<snapcast dir>/android/Snapcast/src/main/assets/bin/`) and will be part of the Snapcast App.
|
|
|
|
|
|
##OpenWrt (Cross compile)
|
|
Cross compilation for OpenWrt is done with the [OpenWrt build system](https://wiki.openwrt.org/about/toolchain) on a Linux host machine.
|
|
https://wiki.openwrt.org/doc/howto/build
|
|
|
|
###OpenWrt build system setup
|
|
https://wiki.openwrt.org/doc/howto/buildroot.exigence
|
|
|
|
Clone OpenWrt to some place in your home directory (`<buildroot dir>`)
|
|
|
|
$ git clone git://git.openwrt.org/15.05/openwrt.git
|
|
|
|
Download and install available feeds
|
|
|
|
$ cd <buildroot dir>
|
|
$ ./scripts/feeds update -a
|
|
$ ./scripts/feeds install -a
|
|
|
|
Build
|
|
|
|
$ make menuconfig
|
|
$ make
|
|
|
|
Within the OpenWrt directory create symbolic links to the Snapcast source directory and to the OpenWrt Makefile:
|
|
|
|
$ cd <buildroot dir>/package/sxx/snapcast
|
|
$ ln -s <snapcast dir>/openWrt/Makefile.openwrt Makefile
|
|
$ ln -s <snapcast dir> src
|
|
|
|
Build Snapcast:
|
|
|
|
$ cd <buildroot dir>
|
|
$ make package/sxx/snapcast/clean V=s
|
|
$ make package/sxx/snapcast/compile -j1 V=s
|
|
|
|
The packaged `ipk` files are in `<buildroot dir>/bin/ar71xx/packages/base/snap[client|server]_0.6.0_ar71xx.ipk`
|