Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
RawStringFormats:
- Delimiter: pb
- Language: Cpp
Delimiters:
- pb
Language: TextProto
BasedOnStyle: google
ReflowComments: true
Expand Down
20 changes: 10 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# This describes an image that should be able to generate libsbp bindings.
# See the README.md for instructions on how to use it.

ARG UBUNTU_RELEASE=focal
ARG UBUNTU_RELEASE=jammy

FROM ubuntu:${UBUNTU_RELEASE}

Expand All @@ -23,8 +23,8 @@ ARG DEBIAN_FRONTEND=noninteractive
ENV NODE_VERSION=v22.13.1
ENV JAVA_VERSION=11.0.11.hs-adpt
ENV GRADLE_VERSION=7.1.1
ENV CC=gcc-7
ENV CXX=g++-7
ENV CC=gcc-10
ENV CXX=g++-10

ENV RUSTUP_HOME=/rust
ENV CARGO_HOME=/cargo
Expand Down Expand Up @@ -77,15 +77,15 @@ RUN \
doxygen \
graphviz \
imagemagick \
enchant \
clang-format-6.0 \
enchant-2 \
clang-format-11 \
python3 python3-dev python3-distutils \
python3.9 python3.9-dev python3.9-distutils \
python3.10 python3.10-dev python3.10-distutils \
python3.11 python3.11-dev python3.11-distutils \
dpkg-dev \
cmake-data=3.16.3-1ubuntu1.20.04.1 \
cmake=3.16.3-1ubuntu1.20.04.1 \
cmake=3.22.1-1ubuntu1 \
cmake-data=3.22.1-1ubuntu1 \
libjson-perl \
libdigest-crc-perl \
&& curl -sSL https://get.haskellstack.org/ | sh \
Expand Down Expand Up @@ -131,9 +131,9 @@ RUN \
# install perl runtime for kaitai struct
RUN \
cd /tmp \
&& curl -LO https://github.com/kaitai-io/kaitai_struct_perl_runtime/archive/refs/tags/0.10.zip \
&& unzip 0.10.zip \
&& cd kaitai_struct_perl_runtime-0.10 \
&& curl -LO https://github.com/kaitai-io/kaitai_struct_perl_runtime/archive/refs/tags/0.11.zip \
&& unzip 0.11.zip \
&& cd kaitai_struct_perl_runtime-0.11 \
&& perl Makefile.PL \
&& make install \
&& rm -rf /tmp/*
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ else
endif

verify-prereq-c: verify-prereq-generator
@command -v clang-format-6.0 1>/dev/null 2>/dev/null || { echo >&2 -e "I require \`clang-format-6.0\` but it's not installed. Aborting.\n\nHave you installed clang-format-6.0? See the C readme at \`c/README.md\` for setup instructions.\n"; exit 1; }
@command -v clang-format-11 1>/dev/null 2>/dev/null || { echo >&2 -e "I require \`clang-format-11\` but it's not installed. Aborting.\n\nHave you installed clang-format-11? See the C readme at \`c/README.md\` for setup instructions.\n"; exit 1; }
@command -v checkmk 1>/dev/null 2>/dev/null || { echo >&2 -e "I require \`checkmk\` but it's not installed. Aborting.\n\nHave you installed checkmk? See the C readme at \`c/README.md\` for setup instructions.\n"; exit 1; }
@command -v cmake 1>/dev/null 2>/dev/null || { echo >&2 -e "I require \`cmake\` but it's not installed. Aborting.\n\nHave you installed cmake? See the C readme at \`c/README.md\` for setup instructions.\n"; exit 1; }
@command -v pkg-config 1>/dev/null 2>/dev/null || { echo >&2 -e "I require \`pkg-config\` but it's not installed. Aborting.\n\nHave you installed pkg-config? See the C readme at \`c/README.md\` for setup instructions.\n"; exit 1; }
Expand Down
9 changes: 4 additions & 5 deletions c/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,17 @@ with no dependencies other than the standard C libraries.

## Installation

On Debian-based systems (including Ubuntu 12.10 or later) you can get
On Debian-based systems (including Ubuntu 22.04 or later) you can get
dependencies with:

```shell
sudo apt-get install build-essential pkg-config cmake doxygen check clang-format-6.0
sudo apt-get install build-essential pkg-config cmake doxygen check clang-format-11
```

On Mac:

```shell
brew tap swift-nav/swift-devs
brew install check cmake pkg-config doxygen clang-tools-6.0
brew install check cmake pkg-config doxygen clang-format@11
```

On other systems, you can obtain CMake from your operating system
Expand Down Expand Up @@ -57,6 +56,6 @@ https://github.com/swift-nav/sbp_tutorial.

## LICENSE

Copyright © 2015-2021 Swift Navigation
Copyright © 2015-2025 Swift Navigation

Distributed under MIT.
8 changes: 2 additions & 6 deletions c/scripts/clang-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@
set -e -x
# This only reformats the generated headers and tests
# as it is introduced as part of fixing the docs,
# and clang-format-6 would otherwise cause regressions
# and clang-format-11 would otherwise cause regressions
# in the Google style of hand-written code.
GENERATED_HEADERS=$(grep -rl --include="*.h" "Automatically generated" include/libsbp/* src/)
GENERATED_C_SOURCES=$(grep -rl --include="*.c" "Automatically generated" src/)
CLANG_FORMAT=clang-format-6.0
CLANG_FORMAT=clang-format-11
$CLANG_FORMAT -i $GENERATED_HEADERS $GENERATED_C_SOURCES test/*.c test/*.h test/auto* test/cpp/auto*

# clang-format-6 adds whitespace to blank lines inside comments
sed -i.bak 's/^ *$//' $GENERATED_HEADERS
rm ${GENERATED_HEADERS//.h/.h.bak}
Loading