2023-12-17 04:06:28 +00:00
|
|
|
FROM ubuntu:22.04 as blah2_env
|
2024-01-01 16:58:20 +00:00
|
|
|
LABEL maintainer="30hours <nathan@30hours.dev>"
|
2024-02-16 02:34:52 +00:00
|
|
|
LABEL org.opencontainers.image.source https://github.com/30hours/blah2
|
2023-05-04 11:25:37 +00:00
|
|
|
|
2024-01-01 16:58:20 +00:00
|
|
|
WORKDIR /blah2
|
2023-05-04 11:25:37 +00:00
|
|
|
ADD lib lib
|
2024-01-14 12:05:58 +00:00
|
|
|
RUN apt-get update && apt-get install -y software-properties-common \
|
|
|
|
&& apt-add-repository ppa:ettusresearch/uhd \
|
|
|
|
&& apt-get update \
|
|
|
|
&& DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y \
|
|
|
|
g++ make cmake git curl zip unzip doxygen graphviz \
|
2024-04-08 12:29:53 +00:00
|
|
|
libfftw3-dev pkg-config gfortran libhackrf-dev \
|
2024-01-14 12:05:58 +00:00
|
|
|
libuhd-dev=4.6.0.0-0ubuntu1~jammy1 \
|
|
|
|
uhd-host=4.6.0.0-0ubuntu1~jammy1 \
|
2024-05-11 14:03:26 +00:00
|
|
|
libusb-dev libusb-1.0.0-dev \
|
2024-01-02 02:52:58 +00:00
|
|
|
&& apt-get autoremove -y \
|
|
|
|
&& apt-get clean -y \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2023-10-25 13:18:03 +00:00
|
|
|
|
2024-01-01 16:58:20 +00:00
|
|
|
# install dependencies from vcpkg
|
2024-05-14 13:26:53 +00:00
|
|
|
ENV VCPKG_ROOT=/opt/vcpkg
|
|
|
|
RUN export PATH="/opt/vcpkg:${PATH}" \
|
|
|
|
&& git clone https://github.com/microsoft/vcpkg /opt/vcpkg \
|
|
|
|
&& if [ "$(uname -m)" = "aarch64" ]; then export VCPKG_FORCE_SYSTEM_BINARIES=1; fi \
|
|
|
|
&& /opt/vcpkg/bootstrap-vcpkg.sh -disableMetrics \
|
|
|
|
&& cd /blah2/lib && vcpkg integrate install \
|
2024-01-01 16:58:20 +00:00
|
|
|
&& vcpkg install --clean-after-build
|
|
|
|
|
|
|
|
# install SDRplay API
|
2024-05-14 13:26:53 +00:00
|
|
|
RUN export ARCH=$(uname -m) \
|
2024-05-27 12:12:40 +00:00
|
|
|
&& export MAJVER="3.15" \
|
|
|
|
&& export MINVER="1" \
|
2024-05-14 13:26:53 +00:00
|
|
|
&& export VER=${MAJVER}.${MINVER} \
|
|
|
|
&& cd /blah2/lib/sdrplay-${VER} \
|
|
|
|
&& chmod +x SDRplay_RSP_API-Linux-${VER}.run \
|
|
|
|
&& ./SDRplay_RSP_API-Linux-${MAJVER}.${MINVER}.run --tar -xvf -C /blah2/lib/sdrplay-${VER} \
|
|
|
|
&& cp ${ARCH}/libsdrplay_api.so.${MAJVER} /usr/local/lib/libsdrplay_api.so \
|
|
|
|
&& cp ${ARCH}/libsdrplay_api.so.${MAJVER} /usr/local/lib/libsdrplay_api.so.${MAJVER} \
|
|
|
|
&& cp inc/* /usr/local/include \
|
|
|
|
&& chmod 644 /usr/local/lib/libsdrplay_api.so /usr/local/lib/libsdrplay_api.so.${MAJVER} \
|
2024-01-14 12:05:58 +00:00
|
|
|
&& ldconfig
|
2023-05-04 11:25:37 +00:00
|
|
|
|
2024-01-12 05:36:02 +00:00
|
|
|
# install UHD API
|
2024-01-14 12:05:58 +00:00
|
|
|
RUN uhd_images_downloader
|
2024-01-12 05:36:02 +00:00
|
|
|
|
2024-05-11 14:03:26 +00:00
|
|
|
# install RTL-SDR API
|
|
|
|
RUN git clone https://github.com/krakenrf/librtlsdr /opt/librtlsdr \
|
|
|
|
&& cd /opt/librtlsdr && mkdir build && cd build \
|
2024-05-30 13:53:25 +00:00
|
|
|
&& cmake ../ -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON && make && make install && ldconfig
|
2024-05-11 14:03:26 +00:00
|
|
|
|
2023-05-04 11:25:37 +00:00
|
|
|
FROM blah2_env as blah2
|
2024-01-01 16:58:20 +00:00
|
|
|
LABEL maintainer="30hours <nathan@30hours.dev>"
|
2023-05-04 11:25:37 +00:00
|
|
|
|
2024-01-01 16:58:20 +00:00
|
|
|
ADD src src
|
|
|
|
ADD test test
|
2024-01-02 09:14:30 +00:00
|
|
|
ADD CMakeLists.txt CMakePresets.json Doxyfile /blah2/
|
2024-01-02 02:52:58 +00:00
|
|
|
RUN mkdir -p build && cd build && cmake -S . --preset prod-release \
|
2024-05-14 13:26:53 +00:00
|
|
|
-DCMAKE_PREFIX_PATH=$(echo /blah2/lib/vcpkg_installed/*/share) .. \
|
2024-01-02 02:52:58 +00:00
|
|
|
&& cd prod-release && make
|
2023-05-04 11:25:37 +00:00
|
|
|
RUN chmod +x bin/blah2
|