snapper-rs 0.1.0

A web-api frontend for libcamera
FROM ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf:main

COPY crossbuildhelpers/build-essential.sh /
RUN /build-essential.sh

# COPY crossbuildhelpers/vcpkg.sh /
# RUN /vcpkg.sh

# These are ordered from longest to shortest.
ARG VCKPKG_PROCESSOR=armhf
ARG PROCESSOR=arm
ARG SYSTEM=Linux
ARG TRIPLE=armelhf-unknown-linux-gnueabi
ARG QEMU=qemu-arm
ARG SYSROOT=/usr/arm-linux-gnueabihf
ARG CC=arm-linux-gnueabihf-gcc
ARG CXX=arm-linux-gnueabihf-g++
ARG AR=arm-linux-gnueabihf-ar
ARG STRIP=arm-linux-gnueabihf-strip

RUN mkdir -p /opt/cross/bin
RUN mkdir -p /root/.cargo/bin

# COPY crossbuildhelpers/vcpkg-triple.sh /
# RUN LINKAGE=static /vcpkg-triple.sh

COPY crossbuildhelpers/meson.sh /
RUN CPU_FAMILY=arm /meson.sh

# COPY crossbuildhelpers/conan.sh /
# RUN COMPILER=gcc COMPILER_VERSION="9" /conan.sh

# Copy some extra configuration data.
COPY crossbuildhelpers/conan/settings.yml /opt/conan/.conan/
COPY crossbuildhelpers/find /opt/cross/
COPY crossbuildhelpers/cmake /opt/cross/bin/

ENV PATH=/opt/cross/bin:$PATH \
    QEMU_RUNNER=$QEMU

# RUN curl --proto "=https" --tlsv1.2 --retry 3 -sSfL https://sh.rustup.rs | sh -s -- -y
# RUN source "${HOME}"/.cargo/env
# cargo install --path . --locked

# RUN echo ${PATH}
# RUN ls -lah /opt/**/**/**
# RUN ls -lah /root/.cargo/bin
# RUN /root/.cargo/bin/cargo --version
# RUN cargo --version

# Cross/Cargo/Rust install for this container
# Install rustup
ENV RUSTUP_HOME=/opt/rustup
ENV CARGO_HOME=/opt/cargo
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="${PATH}:/opt/cargo/bin"

# Specify the preinstalled toolchain (the tag should match this)
ENV RUST_TOOLCHAIN="stable"

# Install toolchain
RUN rustup toolchain install "${RUST_TOOLCHAIN}"
RUN rustup default "${RUST_TOOLCHAIN}"
RUN rustup target add armv7-unknown-linux-gnueabihf

# Install clippy and rustfmt
# RUN rustup component add clippy
# RUN rustup component add rustfmt

# Install cross (and a docker client as it will be needed)
# RUN curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
# RUN apt-get install -y software-properties-common apt-transport-https ca-certificates curl gnupg2
# RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian stretch stable"
# RUN apt-get update
# RUN apt-get install -y docker-ce docker-ce-cli containerd.io
# RUN cargo install cross

# Modify cross tool to be able to access rustup and cargo from spawned container
# RUN mv ${CARGO_HOME}/bin/cross ${CARGO_HOME}/bin/real-cross
# COPY crossbuildhelpers/cross ${CARGO_HOME}/bin/cross
# RUN chmod +x ${CARGO_HOME}/bin/cross