Repository navigation
Expand file tree
/
Copy pathubuntu_debian
More file actions
131 lines (117 loc) · 4.85 KB
/
Copy pathubuntu_debian
File metadata and controls
131 lines (117 loc) · 4.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
ARG DIST="debian"
ARG SUITE="bullseye"
ARG QT_VERSION="6"
ARG REPOSITORY="https://github.com/hyperion-project"
ARG CMAKE_VERSION="3.28.3"
ARG DEBIAN_FRONTEND=noninteractive
FROM ${DIST}:${SUITE}
ARG DIST
ARG SUITE
ARG QT_VERSION
ARG REPOSITORY
ARG CMAKE_VERSION
ARG DEBIAN_FRONTEND
ARG TARGETPLATFORM
ENV QEMU_EXECVE=1
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
ENV DEBFULLNAME="Hyperion Project"
ENV DEBEMAIL="admin@hyperion-project.org"
# update
RUN apt-get update
# install qt5 or qt6 (qt6 is not available on ubuntu focal and debian buster)
# on debian bullseye add backports to install qt6
RUN if [ "$SUITE" != "buster" ] && [ "$SUITE" != "focal" ] && [ "$QT_VERSION" = "6" ]; then \
if [ "$SUITE" = "bullseye" ]; then \
echo "deb http://archive.debian.org/debian bullseye-backports main contrib non-free" | tee -a /etc/apt/sources.list; \
apt-get update; \
fi; \
if [ "$SUITE" = "jammy" ]; then SERIALPORT="libqt6serialport6-dev"; else SERIALPORT="qt6-serialport-dev"; fi; \
if [ "$SUITE" = "jammy" ]; then WEBSOCKETS="libqt6websockets6-dev"; else WEBSOCKETS="qt6-websockets-dev"; fi; \
apt-get -y install qt6-base-dev $SERIALPORT $WEBSOCKETS libqt6sql6-sqlite libxkbcommon-dev libvulkan-dev libgl1-mesa-dev; \
else \
apt-get -y install qtbase5-dev libqt5serialport5-dev libqt5websockets5-dev libqt5sql5-sqlite libqt5svg5-dev; \
fi
# install general deps (all platforms/arch/os)
RUN apt-get -y install \
devscripts \
fakeroot \
debhelper \
libdistro-info-perl \
git \
curl \
python3-dev \
build-essential \
ninja-build \
python3-jsonschema \
python3-jinja2 \
libusb-1.0-0-dev \
libcec-dev \
libp8-platform-dev \
libudev-dev \
libavahi-core-dev \
libavahi-compat-libdnssd-dev \
zlib1g-dev \
libasound2-dev \
libjpeg-dev \
libturbojpeg0-dev \
libmbedtls-dev \
libftdi1-dev \
libssl-dev \
libglib2.0-dev \
libdrm-dev \
libpipewire-0.3-dev \
libspa-0.2-dev
# Mark /source as safe directory for git (used in CI mounts)
RUN git config --system --add safe.directory /source
# install X11/XCB on Ubuntu for all arch and on Debian for amd64
# install libraspberrypi-dev on Debian for arm64/armhf
RUN if [ "$DIST" = "ubuntu" ] || [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
if [ "$QT_VERSION" = "5" ]; then \
apt-get -y install libqt5x11extras5-dev; \
fi; \
apt-get -y install libxcb-util0-dev libxcb-randr0-dev libxcb-shm0-dev libxcb-render0-dev libxcb-image0-dev libxrandr-dev libxrender-dev; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ] || [ "$TARGETPLATFORM" = "linux/arm/v7" ] && [ "$SUITE" != "trixie" ]; then \
apt-get -y install wget gpg dirmngr gpg-agent; \
echo "deb http://archive.raspberrypi.org/debian ${SUITE} main ui" >> /etc/apt/sources.list.d/raspi.list; \
apt-key adv --keyserver keyserver.ubuntu.com --recv-key 0x82B129927FA3303E; \
apt-get update && apt-get -y install libraspberrypi-dev; \
rm /etc/apt/sources.list.d/raspi.list; \
fi
# Install CMake on amd64 and arm64
# Compile and install CMake on armv7
ENV CMAKE_URL="https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}"
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
curl -OLs ${CMAKE_URL}-linux-x86_64.sh; \
chmod +x cmake-${CMAKE_VERSION}-linux-x86_64.sh; \
./cmake-${CMAKE_VERSION}-linux-x86_64.sh --skip-license --prefix="/usr"; \
rm -rf cmake-${CMAKE_VERSION}-linux-x86_64.sh; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
curl -OLs ${CMAKE_URL}-linux-aarch64.sh; \
chmod +x cmake-${CMAKE_VERSION}-linux-aarch64.sh; \
./cmake-${CMAKE_VERSION}-linux-aarch64.sh --skip-license --prefix="/usr"; \
rm -rf cmake-${CMAKE_VERSION}-linux-aarch64.sh; \
else \
mkdir -p /tmp/cmake; \
cd /tmp/cmake; \
curl -kL ${CMAKE_URL}.tar.gz | tar zxf - -C . --strip-components 1; \
./bootstrap --prefix=/usr; --parallel=`nproc`; \
make -j `nproc`; \
make install; \
cd && rm -rf /tmp/cmake; \
fi
# Show cmake version
RUN cmake --version
# download qemu
RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
curl -kL https://github.com/balena-io/qemu/releases/download/v7.0.0%2Bbalena1/qemu-7.0.0.balena1-aarch64.tar.gz | tar zxvf - -C . --strip-components 1 && mv qemu-aarch64-static /usr/bin/qemu-static; \
elif [ "$TARGETPLATFORM" = "linux/arm/v6" ] || [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \
curl -kL https://github.com/balena-io/qemu/releases/download/v7.0.0%2Bbalena1/qemu-7.0.0.balena1-arm.tar.gz | tar zxvf - -C . --strip-components 1 && mv qemu-arm-static /usr/bin/qemu-static; \
else \
printf '#!/bin/bash\nexec "$@"' > /usr/bin/qemu-static; \
fi
# set qemu exec flag
RUN chmod +x /usr/bin/qemu-static
# cleanup
RUN apt-get clean -q -y && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
# set entrypoint
ENTRYPOINT [ "/usr/bin/qemu-static" ]