Skip to content

Commit 45bc37e

Browse files
author
Katie Hughes
committed
seems to work for amd
1 parent f5152b5 commit 45bc37e

5 files changed

Lines changed: 29 additions & 6 deletions

File tree

.devcontainer/Dockerfile.amd64

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM ubuntu:22.04
1+
ARG UBUNTU_VERSION=22.04
2+
FROM ubuntu:${UBUNTU_VERSION}
23

34
RUN apt-get update --fix-missing \
45
&& apt-get install -y --no-install-recommends \

.devcontainer/Dockerfile.arm64

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM arm64v8/ubuntu:22.04
1+
ARG UBUNTU_VERSION=22.04
2+
FROM arm64v8/ubuntu:${UBUNTU_VERSION}
23

34
RUN apt-get update --fix-missing \
45
&& apt-get install -y --no-install-recommends \

.devcontainer/build.sh

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,28 @@
11
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
UBUNTU_VERSION="22.04"
5+
6+
while [[ $# -gt 0 ]]; do
7+
case "$1" in
8+
--ubuntu)
9+
UBUNTU_VERSION="$2"
10+
shift 2
11+
;;
12+
*)
13+
echo "Usage: $0 [--ubuntu 22.04|24.04]" >&2
14+
exit 1
15+
;;
16+
esac
17+
done
18+
219
ARCH=$(dpkg --print-architecture)
20+
echo "Building Docker image for architecture: $ARCH with Ubuntu: $UBUNTU_VERSION"
321

422
if [ "$ARCH" == "amd64" ]; then
5-
docker build -t spot_builder -f Dockerfile.amd64 .
23+
docker build --build-arg UBUNTU_VERSION="$UBUNTU_VERSION" -t spot_builder -f Dockerfile.amd64 .
624
elif [ "$ARCH" == "arm64" ]; then
7-
docker build -t spot_builder -f Dockerfile.arm64 .
25+
docker build --build-arg UBUNTU_VERSION="$UBUNTU_VERSION" -t spot_builder -f Dockerfile.arm64 .
826
else
927
echo "Unknown architecture: $ARCH" > /dev/stderr
1028
exit 1

.devcontainer/entrypoint.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#!/usr/bin/env bash
2+
UBUNTU_VERSION=$(cat /etc/os-release | grep VERSION_ID | cut -d'"' -f2)
3+
24
cd /spot-cpp-sdk/cpp
35
if [ -d build ]; then
46
rm -r build
57
fi
68
mkdir build
79
cd build
8-
cmake .. -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=TRUE -DBUILD_CHOREOGRAPHY_LIBS=ON -DBUILD_SHARED_LIBS=ON
10+
cmake .. -DCMAKE_FIND_PACKAGE_PREFER_CONFIG=TRUE -DBUILD_CHOREOGRAPHY_LIBS=ON -DBUILD_SHARED_LIBS=ON -DDEB_NAME_SUFFIX="_ubuntu_$UBUNTU_VERSION"
911
make -j8 install package

cpp/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,8 @@ if (UNIX)
319319
# Packaging logic
320320
set(CPACK_GENERATOR "DEB")
321321
set(CPACK_PACKAGE_NAME "spot-cpp-sdk")
322-
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
322+
set(DEB_NAME_SUFFIX "" CACHE STRING "optional suffix appended to .deb filename")
323+
set(CPACK_DEBIAN_FILE_NAME "${CPACK_PACKAGE_NAME}_${PROJECT_VERSION}_${CMAKE_SYSTEM_PROCESSOR}${DEB_NAME_SUFFIX}.deb")
323324
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
324325
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libcli11-dev (>=2.1.2), libgrpc++-dev (>=1.30.2), libprotobuf-dev (>=3.12.4)") # not picked up by shlibdeps, thus listed explicitly
325326
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Boston Dynamics SDK Publisher <bd-sdk-publisher@bostondynamics.com>")

0 commit comments

Comments
 (0)