-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathfedora
86 lines (74 loc) · 2.54 KB
/
fedora
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
ARG DIST="fedora"
ARG SUITE="39"
ARG QT_VERSION="5"
ARG REPOSITORY="https://github.com/hyperion-project"
ARG CMAKE_VERSION="3.28.3"
FROM ${DIST}:${SUITE}
ARG DIST
ARG SUITE
ARG QT_VERSION
ARG REPOSITORY
ARG CMAKE_VERSION
ARG TARGETPLATFORM
ENV QEMU_EXECVE=1
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
# update
RUN dnf -y update
# install qt5 or qt6
RUN if [ "$QT_VERSION" = "6" ]; then \
dnf -y install qt6-qtbase-devel qt6-qtserialport-devel qt6-qtwebsockets-devel libxkbcommon-devel; \
else \
dnf -y install qt5-qtbase-devel qt5-qtserialport-devel qt5-qtwebsockets-devel qt5-qtx11extras-devel; \
fi
# install general deps
RUN dnf -y group install 'development-tools' 'c-development' 'rpm-development-tools' && \
dnf -y install \
ninja-build \
curl \
fedora-packager \
python3-devel \
libXrandr-devel \
xcb-util-image-devel \
turbojpeg-devel \
libjpeg-turbo-devel \
libusb1-devel \
avahi-libs \
avahi-compat-libdns_sd-devel \
xcb-util-devel \
dbus-devel \
protobuf-devel \
protobuf-compiler \
flatbuffers-devel \
flatbuffers-compiler \
mbedtls-devel \
openssl-devel \
libcec-devel \
alsa-lib-devel \
libftdi-devel
# Install CMake on amd64 and arm64
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; \
fi
# Show cmake version
RUN cmake --version
# rpmdev-setuptree will create the ~/rpmbuild directory and a set of subdirectories (e.g. SPECS and BUILD)
RUN rpmdev-setuptree
# download qemu and set exec flag
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; \
else \
printf '#!/bin/bash\nexec "$@"' > /usr/bin/qemu-static; \
fi
# set qemu exec flag
RUN chmod +x /usr/bin/qemu-static
# set entrypoint
ENTRYPOINT [ "/usr/bin/qemu-static" ]