-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move to ACAP 4 Native SDK and libmodbus version 3.1.11
This patchset moves to the ACAP 4 Native SDK. This means we drop support for (really) old devices. If you need to build with the ACAP 3 SDK for old devices, please use the previous commit as your base since that will work fine for that. With the move to ACAP 4 Native SDK, we can drop the support for this repo to be built with locally installed SDKs (that nobody uses these days anyway) and then move the build of libmodbus from Makefile into the Dockerfile instead. This patchset also bumps libmodbus from version 3.1.7 to 3.1.11. Change-Id: I9cfef8b6608c4c8ab897034799b54f8e2aae6fab Signed-off-by: Joakim Roubert <joakimr@axis.com>
- Loading branch information
1 parent
c3de675
commit c5e9695
Showing
3 changed files
with
42 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,45 @@ | ||
ARG ARCH=armv7hf | ||
ARG ACAP_SDK_VERSION=3.5 | ||
ARG SDK_IMAGE=axisecp/acap-sdk | ||
ARG BUILD_DIR=/usr/local/src/server-acap | ||
ARG ARCH=aarch64 | ||
ARG ACAP_SDK_VERSION=1.15 | ||
ARG SDK_IMAGE=axisecp/acap-native-sdk | ||
ARG LIBMODBUS_VERSION=3.1.11 | ||
ARG BUILD_DIR=/usr/local/src | ||
ARG ACAP_BUILD_DIR="$BUILD_DIR"/app | ||
ARG LIBMODBUS_BUILD_DIR="$BUILD_DIR"/libmodbus | ||
|
||
FROM $SDK_IMAGE:$ACAP_SDK_VERSION-$ARCH-ubuntu20.04 AS builder | ||
ARG BUILD_DIR | ||
WORKDIR "$BUILD_DIR" | ||
FROM $SDK_IMAGE:$ACAP_SDK_VERSION-$ARCH AS builder | ||
ARG ACAP_BUILD_DIR | ||
ARG LIBMODBUS_BUILD_DIR | ||
ARG LIBMODBUS_VERSION | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install additional build dependencies | ||
RUN apt-get update && apt-get install -y -f --no-install-recommends \ | ||
autoconf \ | ||
automake \ | ||
libtool | ||
|
||
# Build libmodbus | ||
WORKDIR "$LIBMODBUS_BUILD_DIR" | ||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
RUN curl -L https://github.com/stephane/libmodbus/archive/refs/tags/v$LIBMODBUS_VERSION.tar.gz | tar --strip-components=1 -xz | ||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
RUN . /opt/axis/acapsdk/environment-setup* && \ | ||
./autogen.sh && \ | ||
./configure --host=$ARCH --prefix=/usr --enable-static=yes --enable-shared=no && \ | ||
make -j $(nproc) install prefix=$SDKTARGETSYSROOT/usr | ||
|
||
# Build ACAP package | ||
WORKDIR "$ACAP_BUILD_DIR" | ||
COPY LICENSE \ | ||
Makefile \ | ||
manifest.json \ | ||
*.c \ | ||
*.h \ | ||
./ | ||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
RUN . /opt/axis/acapsdk/environment-setup* && \ | ||
acap-build . | ||
|
||
FROM scratch | ||
ARG BUILD_DIR | ||
COPY --from=builder "$BUILD_DIR"/*eap "$BUILD_DIR"/*LICENSE.txt / | ||
ARG ACAP_BUILD_DIR | ||
COPY --from=builder "$ACAP_BUILD_DIR"/*eap "$ACAP_BUILD_DIR"/*LICENSE.txt / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters