Skip to content

Commit cab467b

Browse files
committed
Merge branch 'doublecrossed'
2 parents 9c6f8e7 + feb36d6 commit cab467b

5 files changed

Lines changed: 66 additions & 1 deletion

File tree

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
addons:
23
apt:
34
packages:
@@ -9,9 +10,12 @@ addons:
910
- gstreamer1.0-plugins-ugly
1011
- gstreamer1.0-libav
1112
- libgstrtspserver-1.0-dev
13+
update: true
14+
arch:
15+
- amd64
16+
- arm64 # while this technically isn't the RPi4 it's a nice proof of concept
1217
cache: cargo
1318
dist: bionic
1419
language: rust
1520
rust:
1621
- stable
17-

Cross.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[target.armv7-unknown-linux-gnueabihf]
2+
image = "rusty-engine:latest"

ci/build.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
if [ "${CARGO}" == "cross" ]; then
5+
sudo apt-get install -y qemu-user-static
6+
# set up docker
7+
echo Installing cross
8+
cargo install cross || true
9+
sudo systemctl start docker
10+
echo Building docker image
11+
$(pwd)/cross-build.sh
12+
fi
13+
eval "$CARGO $TASK --target $TARGET"

cross-build.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
# bind last argument in portable manner
5+
for last in "$@"; do :; done
6+
7+
docker_qemu="docker/qemu-arm-static"
8+
rm -f ${docker_qemu}
9+
cp $(which qemu-arm-static) ${docker_qemu}
10+
docker build -t rusty-engine:latest docker/
11+
rm ${docker_qemu}
12+
13+
if [ "${last}" == "run" ]; then
14+
docker run --rm --privileged \
15+
--volume "$(pwd)":/docking-bay \
16+
--name "opsi-rusty-engine-arm" \
17+
rusty-engine:latest \
18+
bash -e -o pipefail -c \
19+
"uname -a"
20+
fi

docker/Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM arm32v7/debian:buster
2+
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
5+
COPY qemu-arm-static /usr/bin/qemu-arm-static
6+
7+
RUN apt-get -y update
8+
# basics
9+
RUN apt-get install -y build-essential curl debhelper g++-arm-linux-gnueabihf libc6-dev-armhf-cross
10+
# rust
11+
ENV RUSTUP_HOME=/opt/rustup
12+
ENV CARGO_HOME=/opt/cargo
13+
RUN curl https://sh.rustup.rs -sSf | sh -s -- --profile minimal --default-toolchain stable -y
14+
ENV PATH="${PATH}:/opt/cargo/bin"
15+
ENV RUST_TOOLCHAIN="stable"
16+
RUN rustup toolchain install "${RUST_TOOLCHAIN}"
17+
RUN rustup default "${RUST_TOOLCHAIN}"
18+
# gstreamer
19+
RUN apt-get install --no-install-recommends -y libgstreamer1.0-dev \
20+
libgstreamer-plugins-base1.0-dev \
21+
gstreamer1.0-plugins-base \
22+
gstreamer1.0-plugins-good \
23+
gstreamer1.0-plugins-bad \
24+
gstreamer1.0-plugins-ugly \
25+
gstreamer1.0-libav:armhf \
26+
libgstrtspserver-1.0-dev

0 commit comments

Comments
 (0)