2019-01-21 17:44:35 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -euxo pipefail
|
|
|
|
|
2019-01-22 14:52:53 +00:00
|
|
|
function cmakebuild() {
|
|
|
|
cd $1
|
2019-12-29 23:11:27 +00:00
|
|
|
if [[ ! -z "${2:-}" ]]; then
|
|
|
|
git checkout $2
|
|
|
|
fi
|
2019-01-22 14:52:53 +00:00
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
cmake ..
|
|
|
|
make
|
|
|
|
make install
|
|
|
|
cd ../..
|
|
|
|
rm -rf $1
|
|
|
|
}
|
2019-01-21 17:44:35 +00:00
|
|
|
|
2019-01-22 14:52:53 +00:00
|
|
|
cd /tmp
|
2019-01-21 17:02:58 +00:00
|
|
|
|
2019-01-22 14:52:53 +00:00
|
|
|
STATIC_PACKAGES="libusb"
|
|
|
|
BUILD_PACKAGES="git libusb-dev cmake make gcc musl-dev g++ linux-headers"
|
|
|
|
|
|
|
|
apk add --no-cache $STATIC_PACKAGES
|
|
|
|
apk add --no-cache --virtual .build-deps $BUILD_PACKAGES
|
|
|
|
|
2019-12-29 23:11:27 +00:00
|
|
|
git clone https://github.com/osmocom/rtl-sdr.git
|
|
|
|
cmakebuild rtl-sdr b5af355b1d833b3c898a61cf1e072b59b0ea3440
|
2019-01-22 14:52:53 +00:00
|
|
|
|
|
|
|
apk del .build-deps
|