-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.arm64
95 lines (79 loc) · 3.93 KB
/
Dockerfile.arm64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
FROM ubuntu:16.04
# This is for 64-bit ARM Linux machine
ENV ARCH aarch64
ENV HOST arm-linux-gnueabihf
# The cross-compiling emulator
RUN apt-get update \
&& apt-get install -y \
qemu-user \
qemu-user-static \
&& apt-get clean --yes
RUN echo '# source urls for arm64 \n\
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ xenial main \n\
deb-src [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ xenial main \n\
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main \n\
deb-src [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main \n\
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ xenial-security main \n\
deb-src [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ xenial-security main \n # end arm64 section' >> /etc/apt/sources.list && \
sed -r 's/deb h/deb \[arch=amd64\] h/g' /etc/apt/sources.list > /tmp/sources-tmp.list && \
cp /tmp/sources-tmp.list /etc/apt/sources.list && \
sed -r 's/deb-src h/deb-src \[arch=amd64\] h/g' /etc/apt/sources.list > /tmp/sources-tmp.list && \
cat /etc/apt/sources.list && \
cp /tmp/sources-tmp.list /etc/apt/sources.list && \
echo "next"&&cat /etc/apt/sources.list
RUN dpkg --add-architecture arm64 && apt -y update && \
apt install -y \
g++-aarch64-linux-gnu gcc-aarch64-linux-gnu libudev-dev libudev-dev:arm64 pkg-config checkinstall ruby ruby-dev rubygems rpm git cmake automake libtool
# The CROSS_TRIPLE is a configured alias of the "aarch64-unknown-linux-gnueabi" target.
ENV CC aarch64-linux-gnu-gcc
ENV CXX aarch64-linux-gnu-g++
ENV QEMU_LD_PREFIX "${CROSS_ROOT}/${CROSS_TRIPLE}/sysroot"
ENV QEMU_SET_ENV "LD_LIBRARY_PATH=${CROSS_ROOT}/lib:${QEMU_LD_PREFIX}"
ENV BUILD_HOME /root/rtl_433
#ENV PKG_CONFIG_PATH /usr/lib/aarch64-linux-gnu/pkgconfig
ENV PKG_CONFIG_PATH $BUILD_HOME/build/lib/pkgconfig
RUN \
mkdir -p $BUILD_HOME/src && \
mkdir -p $BUILD_HOME/build && \
mkdir -p $BUILD_HOME/bin
RUN \
cd $BUILD_HOME/src && \
git clone https://github.com/libusb/libusb.git && \
cd $BUILD_HOME/src/libusb && \
./autogen.sh --prefix=$BUILD_HOME/build --enable-shared --enable-static --with-compiler=$ARCH --host=$HOST && \
make -j2 && \
make install
RUN \
cd $BUILD_HOME/src && \
git clone https://github.com/osmocom/rtl-sdr.git && \
cd $BUILD_HOME/src/rtl-sdr && \
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$BUILD_HOME/build" -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON -DCMAKE_SYSTEM_PROCESSOR=$ARCH && \
make -j2 && \
make install
RUN \
cd $BUILD_HOME/src && \
git clone https://github.com/pothosware/SoapySDR.git && \
cd $BUILD_HOME/src/SoapySDR && \
sed -i "s/(SoapySDR SHARED/(SoapySDR STATIC/" lib/CMakeLists.txt && \
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$BUILD_HOME/build" -DCMAKE_SYSTEM_PROCESSOR=$ARCH && \
make -j2 && \
make install
RUN \
cd $BUILD_HOME/build/lib && \
rm -rf *.so* && \
cd $BUILD_HOME/src && \
git clone https://github.com/merbanan/rtl_433.git && \
cd $BUILD_HOME/src/rtl_433 && \
mkdir build && \
cd build && \
cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=$BUILD_HOME/build -DLIBUSB_INCLUDE_DIR="$BUILD_HOME/build/include/libusb-1.0" -DENABLE_RTLSDR=ON -DENABLE_SOAPYSDR=ON -DCMAKE_SYSTEM_PROCESSOR=$ARCH .. && \
sed -i "s/-lstdc++//g" src/CMakeFiles/rtl_433.dir/link.txt && \
sed -i "s/$/ -lstdc++ -l:libudev.so/" src/CMakeFiles/rtl_433.dir/link.txt && \
make -j2
# make install
COPY ./description-pak $BUILD_HOME/src/rtl_433/build/description-pak
RUN \
gem install --no-ri --no-rdoc fpm && \
cd $BUILD_HOME/src/rtl_433/build && \
checkinstall --install=no --pkgname=rtl_433 --pkgversion=`date +%Y%m%d%H%M` --pkgarch=$ARCH --pkgrelease=git --pkglicense=GPL2 --pkggroup=Productivity/Hamradio/Other --maintainer="Gergely\ Kun\ \<kun.gergely\@kgservermanagement.com\>" --nodoc -y && \
fpm -s deb -t rpm rtl-433_`date +%Y%m%d%H%M`-git_$ARCH.deb