| 1 |
# This file is part of the bladeRF project: |
| 2 |
# http://www.github.com/nuand/bladeRF |
| 3 |
# |
| 4 |
# Copyright (c) 2025 Nuand LLC. |
| 5 |
# |
| 6 |
# Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 |
# of this software and associated documentation files (the "Software"), to deal |
| 8 |
# in the Software without restriction, including without limitation the rights |
| 9 |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 10 |
# copies of the Software, and to permit persons to whom the Software is |
| 11 |
# furnished to do so, subject to the following conditions: |
| 12 |
# |
| 13 |
# The above copyright notice and this permission notice shall be included in |
| 14 |
# all copies or substantial portions of the Software. |
| 15 |
# |
| 16 |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 |
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 |
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 |
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 |
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 |
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 22 |
# THE SOFTWARE. |
| 23 |
|
| 24 |
FROM ubuntu:xenial |
| 25 |
|
| 26 |
LABEL maintainer="Nuand LLC <[email protected]>" |
| 27 |
LABEL version="0.0.2" |
| 28 |
LABEL description="CI build environment for the bladeRF project" |
| 29 |
LABEL com.nuand.ci.distribution.name="Ubuntu" |
| 30 |
LABEL com.nuand.ci.distribution.codename="xenial" |
| 31 |
LABEL com.nuand.ci.distribution.version="16.04" |
| 32 |
|
| 33 |
# Install things |
| 34 |
RUN apt-get update \ |
| 35 |
&& apt-get install -y \ |
| 36 |
build-essential \ |
| 37 |
clang \ |
| 38 |
cmake \ |
| 39 |
doxygen \ |
| 40 |
git \ |
| 41 |
help2man \ |
| 42 |
libcurl4-openssl-dev \ |
| 43 |
libedit-dev \ |
| 44 |
libncurses5-dev \ |
| 45 |
libncurses-dev \ |
| 46 |
libncursesw5-dev \ |
| 47 |
libssl-dev \ |
| 48 |
libusb-1.0-0-dev \ |
| 49 |
pandoc \ |
| 50 |
pkg-config \ |
| 51 |
usbutils \ |
| 52 |
wget \ |
| 53 |
&& apt-get clean |
| 54 |
|
| 55 |
# Custom compile cmake because the version provided in the xenial repos is too old for our cmake scripts |
| 56 |
RUN version=3.28 \ |
| 57 |
&& build=1 \ |
| 58 |
&& mkdir ~/temp \ |
| 59 |
&& cd ~/temp \ |
| 60 |
&& wget -nv https://cmake.org/files/v$version/cmake-$version.$build.tar.gz \ |
| 61 |
&& tar -xzf cmake-$version.$build.tar.gz \ |
| 62 |
&& cd cmake-$version.$build/ \ |
| 63 |
&& ./bootstrap --parallel=$(nproc) --no-debugger \ |
| 64 |
&& make -j$(nproc) \ |
| 65 |
&& make install |
| 66 |
|
| 67 |
# Copy in our build context |
| 68 |
COPY --from=nuand/bladerf-buildenv:base /root/bladeRF /root/bladeRF |
| 69 |
COPY --from=nuand/bladerf-buildenv:base /root/.config /root/.config |
| 70 |
WORKDIR /root/bladeRF |
| 71 |
|
| 72 |
# Build arguments |
| 73 |
ARG compiler=gcc |
| 74 |
ARG buildtype=Release |
| 75 |
ARG taggedrelease=NO |
| 76 |
ARG parallel=1 |
| 77 |
|
| 78 |
RUN ${compiler} --version |
| 79 |
|
| 80 |
# Do the build! |
| 81 |
RUN cd /root/bladeRF/ \ |
| 82 |
&& mkdir -p build \ |
| 83 |
&& cd build \ |
| 84 |
&& cmake \ |
| 85 |
-DBUILD_DOCUMENTATION=ON \ |
| 86 |
-DCMAKE_C_COMPILER=${compiler} \ |
| 87 |
-DCMAKE_BUILD_TYPE=${buildtype} \ |
| 88 |
-DENABLE_FX3_BUILD=OFF \ |
| 89 |
-DENABLE_HOST_BUILD=ON \ |
| 90 |
-DTAGGED_RELEASE=${taggedrelease} \ |
| 91 |
../ \ |
| 92 |
&& make -j${parallel} \ |
| 93 |
&& make install \ |
| 94 |
&& ldconfig |
| 95 |
|