-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
75 lines (65 loc) · 3.79 KB
/
Dockerfile
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
FROM ubuntu:20.04
LABEL maintainer="Johannes.Pohl90@gmail.com"
ENV TZ=Europe/Berlin
ADD mingw-w64-i686.cmake mingw-w64-x86_64.cmake /root/
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
&& apt-get -qq update \
&& apt-get -qq install git mingw-w64 mingw-w64-tools cmake wget p7zip-full file llvm \
&& mkdir -p /result/64 && mkdir -p /result/32 \
&& cp /usr/i686-w64-mingw32/lib/libwinpthread-1.dll /result/32 \
&& cp /usr/x86_64-w64-mingw32/lib/libwinpthread-1.dll /result/64 \
&& mkdir -p /libusb && cd libusb \
&& wget https://github.com/libusb/libusb/releases/download/v1.0.25/libusb-1.0.25.7z \
&& 7z x libusb-1.0.25.7z \
&& cp include/libusb-1.0/libusb.h /usr/i686-w64-mingw32/include/ \
&& cp include/libusb-1.0/libusb.h /usr/x86_64-w64-mingw32/include/ \
&& cp MinGW32/dll/libusb-1.0.dll* /usr/i686-w64-mingw32/lib/ \
&& cp MinGW32/dll/libusb-1.0.dll /result/32 \
&& cp MinGW64/dll/libusb-1.0.dll* /usr/x86_64-w64-mingw32/lib/ \
&& cp MinGW64/dll/libusb-1.0.dll /result/64
RUN git clone --depth 1 https://github.com/airspy/airspyone_host /airspy && cd /airspy \
&& mkdir build && cd build \
&& cmake -DCMAKE_TOOLCHAIN_FILE=~/mingw-w64-x86_64.cmake -DCMAKE_INSTALL_PREFIX=/result/64 .. \
&& make -j$(nproc) install \
&& cd .. && mkdir build32 && cd build32 \
&& cmake -DCMAKE_TOOLCHAIN_FILE=~/mingw-w64-i686.cmake -DCMAKE_INSTALL_PREFIX=/result/32 .. \
&& make -j$(nproc) install
RUN wget http://www.fftw.org/fftw-3.3.10.tar.gz \
&& tar xf fftw-3.3.10.tar.gz \
&& rm fftw-3.3.10.tar.gz \
&& cd fftw-3.3.10 \
&& mkdir build && cd build \
&& cmake -DCMAKE_TOOLCHAIN_FILE=~/mingw-w64-x86_64.cmake -DENABLE_FLOAT=OFF -DENABLE_LONG_DOUBLE=OFF -DENABLE_QUAD_PRECISION=OFF .. \
&& make -j$(nproc) \
&& cmake -DCMAKE_TOOLCHAIN_FILE=~/mingw-w64-x86_64.cmake -DENABLE_FLOAT=ON -DENABLE_LONG_DOUBLE=OFF -DENABLE_QUAD_PRECISION=OFF .. \
&& make -j$(nproc) \
&& cmake -DCMAKE_TOOLCHAIN_FILE=~/mingw-w64-x86_64.cmake -DENABLE_FLOAT=OFF -DENABLE_LONG_DOUBLE=ON -DENABLE_QUAD_PRECISION=OFF .. \
&& make -j$(nproc) \
&& cmake -DCMAKE_TOOLCHAIN_FILE=~/mingw-w64-x86_64.cmake -DENABLE_FLOAT=OFF -DENABLE_LONG_DOUBLE=OFF -DENABLE_QUAD_PRECISION=ON .. \
&& cp ../api/fftw3.h /usr/x86_64-w64-mingw32/include/ \
&& cp libfftw3* /usr/x86_64-w64-mingw32/lib/ \
&& cp libfftw3*.dll /result/64 \
&& cd .. \
&& mkdir build32 && cd build32 \
&& cmake -DCMAKE_TOOLCHAIN_FILE=~/mingw-w64-i686.cmake -DENABLE_FLOAT=OFF -DENABLE_LONG_DOUBLE=OFF -DENABLE_QUAD_PRECISION=OFF .. \
&& make -j$(nproc) \
&& cmake -DCMAKE_TOOLCHAIN_FILE=~/mingw-w64-i686.cmake -DENABLE_FLOAT=ON -DENABLE_LONG_DOUBLE=OFF -DENABLE_QUAD_PRECISION=OFF .. \
&& make -j$(nproc) \
&& cmake -DCMAKE_TOOLCHAIN_FILE=~/mingw-w64-i686.cmake -DENABLE_FLOAT=OFF -DENABLE_LONG_DOUBLE=ON -DENABLE_QUAD_PRECISION=OFF .. \
&& make -j$(nproc) \
&& cmake -DCMAKE_TOOLCHAIN_FILE=~/mingw-w64-i686.cmake -DENABLE_FLOAT=OFF -DENABLE_LONG_DOUBLE=OFF -DENABLE_QUAD_PRECISION=ON .. \
&& cp ../api/fftw3.h /usr/i686-w64-mingw32/include/ \
&& cp libfftw3* /usr/i686-w64-mingw32/lib/ \
&& cp libfftw3*.dll /result/32
RUN git clone --depth 1 https://github.com/greatscottgadgets/hackrf /hackrf && cd /hackrf/host \
&& mkdir build && cd build \
&& cmake -DCMAKE_TOOLCHAIN_FILE=~/mingw-w64-x86_64.cmake -DFFTW_LIBRARIES=/usr/x86_64-w64-mingw32/lib/ -DCMAKE_INSTALL_PREFIX=/result/64 .. \
&& make -j$(nproc) install \
&& cd .. && mkdir build32 && cd build32 \
&& cmake -DCMAKE_TOOLCHAIN_FILE=~/mingw-w64-i686.cmake -DFFTW_LIBRARIES=/usr/i686-w64-mingw32/lib/ -DCMAKE_INSTALL_PREFIX=/result/32 .. \
&& make -j$(nproc) install
ADD genlib.sh /
# generate libs
# gendef libhackrf.dll
# llvm-dlltool -m i386:x86-64 -d libhackrf.def -D libhackrf.dll -l libhackrf.lib
# https://stackoverflow.com/questions/9946322/how-to-generate-an-import-library-lib-file-from-a-dll/9946390