Skip to content

Commit e544c2e

Browse files
committed
Add some convenience packaging scripts
1 parent 6a79d40 commit e544c2e

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

packaging/Containerfile.fedora

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM fedora:41
2+
3+
RUN dnf install -y gcc gcc-c++ cmake ninja-build rpm-build opencv-devel SDL2-devel SDL2_mixer-devel
4+

packaging/Containerfile.ubuntu

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM ubuntu:24.04
2+
3+
RUN apt-get update && \
4+
apt-get install -y \
5+
build-essential cmake g++ wget unzip ninja-build \
6+
libsdl2-dev libsdl2-mixer-dev \
7+
libopencv-dev \
8+
libgl1-mesa-dev
9+

packaging/package.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
3+
IMAGE="vision-rc"
4+
APP_DIR=$(dirname "$0")
5+
EXEC_CMD="docker exec --user $UID"
6+
7+
for distro in ubuntu fedora; do
8+
# Make sure there's not any images with our build image names yet
9+
docker rmi ${IMAGE}:${distro}
10+
# Build the image
11+
docker build -t ${IMAGE}:${distro} -f Containerfile.${distro} .
12+
# Start a container with the built image
13+
docker run -dt -v ${APP_DIR}:/app --name vision-rc-ubuntu ${IMAGE}:${distro} cat
14+
15+
# Configure, build, and package
16+
${EXEC_CMD} vision-rc-${distro} cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCPACK_SYSTEM_NAME=${distro} -B build -S app
17+
${EXEC_CMD} vision-rc-${distro} cmake --build build --target all
18+
${EXEC_CMD} vision-rc-${distro} cmake --build build --target package
19+
${EXEC_CMD} vision-rc-${distro} cmake --build build --target package_source
20+
${EXEC_CMD} vision-rc-${distro} mv /build/*.deb /build/*.rpm /build/*.tar.gz /app
21+
22+
# Stop the container and clean up
23+
docker stop vision-rc-${distro}
24+
docker rm vision-rc-${distro}
25+
done
26+

0 commit comments

Comments
 (0)