-
Notifications
You must be signed in to change notification settings - Fork 7
/
fedora
101 lines (86 loc) · 3.11 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
ARG DIST="fedora"
ARG SUITE="39"
ARG QT_VERSION="5"
ARG REPOSITORY="https://github.com/hyperion-project"
FROM ${DIST}:${SUITE}
ARG DIST
ARG SUITE
ARG QT_VERSION
ARG REPOSITORY
ARG TARGETPLATFORM
LABEL maintainer="Hyperion Project <[email protected]>" \
org.opencontainers.image.title="${DIST} ${SUITE} ${TARGETPLATFORM} - QT ${QT_VERSION}" \
org.opencontainers.image.description="Compilation environment to build Hyperion for ${DIST} ${SUITE}" \
org.opencontainers.image.url="${REPOSITORY}" \
org.opencontainers.image.source="${REPOSITORY}/hyperion.docker-ci" \
org.opencontainers.image.vendor="Hyperion Project" \
org.opencontainers.image.documentation="https://docs.hyperion-project.org" \
org.opencontainers.image.licenses="MIT"
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
ENV QEMU_EXECVE=1
ENV DNF_INSTALL="dnf -y install"
# update
RUN dnf -y update
# install qt5 or qt6
RUN if [ "$QT_VERSION" = "6" ]; then \
$DNF_INSTALL qt6-qtbase-devel qt6-qtserialport-devel libxkbcommon-devel; \
else \
$DNF_INSTALL qt5-qtbase-devel qt5-qtserialport-devel qt5-qtx11extras-devel; \
fi
# install general deps
RUN dnf -y group install 'development-tools' 'c-development' 'rpm-development-tools' && \
$DNF_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
# Remove system CMake
RUN
# Install CMake on amd64 and arm64
ENV CMAKE_VERSION="3.28.3"
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
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
# cleanup
RUN dnf clean all && rm -rf /var/cache/dnf
# set entrypoint
ENTRYPOINT [ "/usr/bin/qemu-static" ]