├── .github
├── dependabot.yml
└── workflows
│ ├── package.yml
│ └── qt5_6.yml
├── README.md
├── debian-armv6
├── fedora
└── ubuntu_debian
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 |
4 | - package-ecosystem: "github-actions"
5 | directory: "/"
6 | schedule:
7 | interval: "monthly"
8 |
--------------------------------------------------------------------------------
/.github/workflows/package.yml:
--------------------------------------------------------------------------------
1 | name: Package Repository
2 | run-name: |
3 | ${{ github.event_name == 'schedule' && '⏰ Scheduled build' || '' }}
4 | ${{ github.event_name == 'push' && format('🌱 Push build - {0}', github.event.head_commit.message) || '' }}
5 |
6 | on:
7 | schedule:
8 | - cron: '0 0 * * 0'
9 | push:
10 | branches: [ master ]
11 |
12 | jobs:
13 |
14 | ubuntu_debian_fedora:
15 | name: 🐧 ${{ matrix.os.description }} Qt ${{ matrix.qt_version }}
16 | strategy:
17 | fail-fast: false
18 | matrix:
19 | os: [
20 | { distribution: ubuntu, codename: focal, description: Ubuntu 20.04 (Focal Fossa), target_platform: "['amd64', 'arm64', 'armv7']" },
21 | { distribution: ubuntu, codename: jammy, description: Ubuntu 22.04 (Jammy Jellyfish), target_platform: "['amd64', 'arm64', 'armv7']" },
22 | { distribution: ubuntu, codename: noble, description: Ubuntu 24.04 (Noble Numbat), target_platform: "['amd64', 'arm64', 'armv7']" },
23 | { distribution: ubuntu, codename: oracular, description: Ubuntu 24.10 (Oracular Oriole), target_platform: "['amd64', 'arm64', 'armv7']" },
24 | { distribution: ubuntu, codename: plucky, description: Ubuntu 25.04 (Plucky Puffin), target_platform: "['amd64', 'arm64', 'armv7']" },
25 | { distribution: debian, codename: buster, description: Debian 10.x (Buster), target_platform: "['amd64', 'arm64', 'armv6', 'armv7']" },
26 | { distribution: debian, codename: bullseye, description: Debian 11.x (Bullseye), target_platform: "['amd64', 'arm64', 'armv6', 'armv7']" },
27 | { distribution: debian, codename: bookworm, description: Debian 12.x (Bookworm), target_platform: "['amd64', 'arm64', 'armv6', 'armv7']" },
28 | { distribution: debian, codename: trixie, description: Debian 13.x (Trixie), target_platform: "['amd64', 'arm64', 'armv7']" },
29 | { distribution: fedora, codename: 39, description: Fedora 39, target_platform: "['amd64', 'arm64']" },
30 | { distribution: fedora, codename: 40, description: Fedora 40, target_platform: "['amd64', 'arm64']" },
31 | { distribution: fedora, codename: 41, description: Fedora 41, target_platform: "['amd64', 'arm64']" },
32 | { distribution: fedora, codename: 42, description: Fedora 42, target_platform: "['amd64', 'arm64']" }
33 | ]
34 | qt_version: [ 5, 6 ]
35 | exclude:
36 | # Qt6 is not available on Ubuntu Focal and Debian Buster
37 | # Qt6 on Debian Bullseye (only armv6) is excluded in reusable workflow qt5_6.yml because target_platform is passed as string to reusable workflow
38 | - os: { codename: focal }
39 | qt_version: 6
40 | - os: { codename: buster }
41 | qt_version: 6
42 |
43 | uses: ./.github/workflows/qt5_6.yml
44 | secrets: inherit
45 | with:
46 | distribution: ${{ matrix.os.distribution }}
47 | codename: ${{ matrix.os.codename }}
48 | qt_version: ${{ matrix.qt_version }}
49 | target_platform: ${{ matrix.os.target_platform }}
--------------------------------------------------------------------------------
/.github/workflows/qt5_6.yml:
--------------------------------------------------------------------------------
1 | name: GitHub Packages Qt5/6 Builds
2 |
3 | on:
4 | # Reusable from package.yml
5 | workflow_call:
6 | inputs:
7 | distribution:
8 | type: string
9 | default: 'ubuntu'
10 | required: false
11 | codename:
12 | type: string
13 | default: 'focal'
14 | required: false
15 | qt_version:
16 | type: string
17 | default: '5'
18 | required: false
19 | target_platform:
20 | type: string
21 | default: "['amd64']"
22 | required: false
23 |
24 | env:
25 | SECRET_DOCKER_CI: ${{ secrets.DOCKER_CI }}
26 | REPOSITORY: hyperion-project
27 | CMAKE_VERSION: 3.31.6
28 |
29 | jobs:
30 |
31 | build_and_push:
32 | name: 👷 Build ${{ matrix.target_platform }}
33 | runs-on: ${{ matrix.target_platform == 'amd64' && 'ubuntu-22.04' || 'ubuntu-22.04-arm' }}
34 | strategy:
35 | fail-fast: false
36 | matrix:
37 | target_platform: ${{ fromJson(inputs.target_platform) }}
38 | target_lookup: [{ 'amd64': 'linux/amd64', 'arm64': 'linux/arm64', 'armv6': 'linux/arm/v6', 'armv7': 'linux/arm/v7' }]
39 | isBullseyeQt6:
40 | - ${{ inputs.distribution == 'debian' && inputs.codename == 'bullseye' && inputs.qt_version == '6' }}
41 | exclude:
42 | - isBullseyeQt6: true
43 | target_platform: 'armv6'
44 |
45 | steps:
46 | - name: 👀 Checkout
47 | uses: actions/checkout@v4
48 |
49 | - name: ✅ Determine current Repository
50 | if: ${{ !startsWith(github.repository, env.REPOSITORY) }}
51 | run: echo "REPOSITORY=$(echo '${{ github.actor }}' | tr '[:upper:]' '[:lower:]')" >> ${GITHUB_ENV}
52 |
53 | - name: 🐳 Set up Docker Buildx
54 | uses: docker/setup-buildx-action@v3
55 |
56 | - name: 🐳 Set up Docker metadata
57 | id: meta
58 | uses: docker/metadata-action@v5
59 | with:
60 | images: ghcr.io/${{ env.REPOSITORY }}/${{ inputs.distribution }}
61 | tags: ${{ inputs.qt_version == '6' && format('{0}-qt6', inputs.codename) || inputs.codename }}
62 | labels: |
63 | org.opencontainers.image.description=Compilation environment to build Hyperion for ${{ inputs.distribution }} ${{ inputs.codename }}
64 | org.opencontainers.image.vendor=Hyperion Project
65 | org.opencontainers.image.authors=Hyperion Team
66 | org.opencontainers.image.url=${{ github.server_url }}/${{ env.REPOSITORY }}
67 | org.opencontainers.image.source=${{ github.server_url }}/${{ env.REPOSITORY }}/hyperion.docker-ci
68 | org.opencontainers.image.documentation=https://docs.hyperion-project.org
69 | org.opencontainers.image.licenses=MIT
70 | annotations: |
71 | org.opencontainers.image.description=Compilation environment to build Hyperion for ${{ inputs.distribution }} ${{ inputs.codename }}
72 | org.opencontainers.image.vendor=Hyperion Project
73 | org.opencontainers.image.authors=Hyperion Team
74 | org.opencontainers.image.url=${{ github.server_url }}/${{ env.REPOSITORY }}
75 | org.opencontainers.image.source=${{ github.server_url }}/${{ env.REPOSITORY }}/hyperion.docker-ci
76 | org.opencontainers.image.documentation=https://docs.hyperion-project.org
77 | org.opencontainers.image.licenses=MIT
78 |
79 | - name: 🔑 Login to GitHub Container Registry
80 | if: ${{ env.SECRET_DOCKER_CI != null }}
81 | uses: docker/login-action@v3
82 | with:
83 | registry: ghcr.io
84 | username: ${{ github.actor }}
85 | password: ${{ secrets.DOCKER_CI }}
86 |
87 | - name: 👷 Build and 🚀 Push digest to GitHub Container/Package Registry
88 | id: build
89 | uses: docker/build-push-action@v6
90 | with:
91 | context: .
92 | file: ${{ matrix.target_platform == 'armv6' && 'debian-armv6' || inputs.distribution == 'fedora' && 'fedora' || 'ubuntu_debian' }}
93 | platforms: ${{ matrix.target_lookup[format('{0}',matrix.target_platform)] }}
94 | labels: ${{ steps.meta.outputs.labels }}
95 | provenance: false
96 | outputs: type=image,name=ghcr.io/${{ env.REPOSITORY }}/${{ inputs.distribution }},push-by-digest=true,name-canonical=true,push=true
97 | build-args: |
98 | DIST=${{ inputs.distribution }}
99 | SUITE=${{ inputs.codename }}
100 | QT_VERSION=${{ inputs.qt_version }}
101 | REPOSITORY="${{ github.server_url }}/${{ env.REPOSITORY }}"
102 | CMAKE_VERSION=${{ env.CMAKE_VERSION }}
103 |
104 | - name: ⬇ Export digest
105 | run: |
106 | mkdir -p /tmp/digests
107 | digest="${{ steps.build.outputs.digest }}"
108 | touch "/tmp/digests/${digest#sha256:}"
109 |
110 | - name: 📦 Upload digest
111 | uses: actions/upload-artifact@v4
112 | with:
113 | name: ${{ inputs.distribution }}-${{ inputs.codename }}-qt${{ inputs.qt_version }}-${{ matrix.target_platform }}
114 | path: /tmp/digests/*
115 | if-no-files-found: error
116 | retention-days: 1
117 |
118 | merge:
119 | name: 👷 Merge and 🚀 Push
120 | needs: build_and_push
121 | runs-on: ubuntu-22.04
122 |
123 | steps:
124 | - name: 💾 Download digests
125 | uses: actions/download-artifact@v4
126 | with:
127 | path: /tmp/digests
128 | pattern: ${{ inputs.distribution }}-${{ inputs.codename }}-qt${{ inputs.qt_version }}-*
129 | merge-multiple: true
130 |
131 | - name: ✅ Determine current Repository
132 | if: ${{ !startsWith(github.repository, env.REPOSITORY) }}
133 | run: echo "REPOSITORY=$(echo '${{ github.actor }}' | tr '[:upper:]' '[:lower:]')" >> ${GITHUB_ENV}
134 |
135 | - name: 🐳 Set up Docker Buildx
136 | uses: docker/setup-buildx-action@v3
137 |
138 | - name: 🐳 Set up Docker metadata
139 | id: meta
140 | uses: docker/metadata-action@v5
141 | with:
142 | images: ghcr.io/${{ env.REPOSITORY }}/${{ inputs.distribution }}
143 | tags: ${{ inputs.qt_version == '6' && format('{0}-qt6', inputs.codename) || inputs.codename }}
144 | labels: |
145 | org.opencontainers.image.description=Compilation environment to build Hyperion for ${{ inputs.distribution }} ${{ inputs.codename }}
146 | org.opencontainers.image.vendor=Hyperion Project
147 | org.opencontainers.image.authors=Hyperion Team
148 | org.opencontainers.image.url=${{ github.server_url }}/${{ env.REPOSITORY }}
149 | org.opencontainers.image.source=${{ github.server_url }}/${{ env.REPOSITORY }}/hyperion.docker-ci
150 | org.opencontainers.image.documentation=https://docs.hyperion-project.org
151 | org.opencontainers.image.licenses=MIT
152 | annotations: |
153 | org.opencontainers.image.description=Compilation environment to build Hyperion for ${{ inputs.distribution }} ${{ inputs.codename }}
154 | org.opencontainers.image.vendor=Hyperion Project
155 | org.opencontainers.image.authors=Hyperion Team
156 | org.opencontainers.image.url=${{ github.server_url }}/${{ env.REPOSITORY }}
157 | org.opencontainers.image.source=${{ github.server_url }}/${{ env.REPOSITORY }}/hyperion.docker-ci
158 | org.opencontainers.image.documentation=https://docs.hyperion-project.org
159 | org.opencontainers.image.licenses=MIT
160 |
161 | - name: 🔑 Login to GitHub Container Registry
162 | if: ${{ env.SECRET_DOCKER_CI != null }}
163 | uses: docker/login-action@v3
164 | with:
165 | registry: ghcr.io
166 | username: ${{ github.actor }}
167 | password: ${{ secrets.DOCKER_CI }}
168 |
169 | - name: 📝 Create manifest list and 🚀 Push to GitHub Container/Package Registry
170 | working-directory: /tmp/digests
171 | run: |
172 | docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
173 | $(printf 'ghcr.io/${{ env.REPOSITORY }}/${{ inputs.distribution }}@sha256:%s ' *)
174 |
175 | - name: 👀 Inspect image
176 | run: |
177 | docker buildx imagetools inspect ${{ steps.meta.outputs.tags }}
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Docker Hyperion compilation
2 | [](https://github.com/orgs/hyperion-project/packages)
3 | Provides multi platform images to compile Hyperion inside a Docker container.
4 | Images are available at https://github.com/orgs/hyperion-project/packages
--------------------------------------------------------------------------------
/debian-armv6:
--------------------------------------------------------------------------------
1 | ARG SUITE="buster"
2 | ARG QT_VERSION="5"
3 | ARG REPOSITORY="https://github.com/hyperion-project"
4 | ARG CMAKE_VERSION="3.28.3"
5 |
6 | FROM balenalib/rpi-raspbian:${SUITE}
7 |
8 | ARG SUITE
9 | ARG QT_VERSION
10 | ARG REPOSITORY
11 | ARG CMAKE_VERSION
12 | ARG DEBIAN_FRONTEND=noninteractive
13 | ARG TARGETPLATFORM
14 |
15 | ENV QEMU_EXECVE=1
16 | ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/arm/v6}
17 |
18 | # update
19 | RUN apt-get update
20 |
21 | # install qt5 or qt6 (qt6 is not available on debian buster/bullseye)
22 | RUN if [ "$SUITE" = "bookworm" ] && [ "$QT_VERSION" = "6" ]; then \
23 | apt-get -y install qt6-base-dev libqt6sql6-sqlite qt6-serialport-dev qt6-websockets-dev libxkbcommon-dev libvulkan-dev libgl1-mesa-dev; \
24 | else \
25 | apt-get -y install qtbase5-dev libqt5serialport5-dev libqt5websockets5-dev libqt5sql5-sqlite libqt5svg5-dev; \
26 | fi
27 |
28 | # install deps
29 | RUN apt-get -y install \
30 | devscripts \
31 | fakeroot \
32 | debhelper \
33 | libdistro-info-perl \
34 | git \
35 | curl \
36 | python3-dev \
37 | build-essential \
38 | ninja-build \
39 | libusb-1.0-0-dev \
40 | libcec-dev \
41 | libp8-platform-dev \
42 | libudev-dev \
43 | libavahi-core-dev \
44 | libavahi-compat-libdnssd-dev \
45 | zlib1g-dev \
46 | libasound2-dev \
47 | libjpeg-dev \
48 | libturbojpeg0-dev \
49 | libmbedtls-dev \
50 | libftdi1-dev \
51 | libssl-dev \
52 | libraspberrypi-dev \
53 | libglib2.0-dev
54 |
55 | # Compile and install CMake
56 | ENV CMAKE_URL="https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}"
57 | RUN mkdir -p /tmp/cmake; \
58 | cd /tmp/cmake; \
59 | curl -kL ${CMAKE_URL}.tar.gz | tar zxf - -C . --strip-components 1; \
60 | sed -i -e 's/|aarch64//g' Source/Checks/cm_cxx_features.cmake; \
61 | ./bootstrap --prefix=/usr --parallel=`nproc`; \
62 | make -j `nproc`; \
63 | make install; \
64 | cd && rm -rf /tmp/cmake
65 |
66 | # Show cmake version
67 | RUN cmake --version
68 |
69 | # download qemu and set exec flag
70 | RUN 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
71 |
72 | # set qemu exec flag
73 | RUN chmod +x /usr/bin/qemu-static
74 |
75 | # set entrypoint
76 | ENTRYPOINT [ "/usr/bin/qemu-static" ]
77 |
--------------------------------------------------------------------------------
/fedora:
--------------------------------------------------------------------------------
1 | ARG DIST="fedora"
2 | ARG SUITE="39"
3 | ARG QT_VERSION="5"
4 | ARG REPOSITORY="https://github.com/hyperion-project"
5 | ARG CMAKE_VERSION="3.28.3"
6 |
7 | FROM ${DIST}:${SUITE}
8 |
9 | ARG DIST
10 | ARG SUITE
11 | ARG QT_VERSION
12 | ARG REPOSITORY
13 | ARG CMAKE_VERSION
14 | ARG TARGETPLATFORM
15 |
16 | ENV QEMU_EXECVE=1
17 | ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
18 |
19 | # update
20 | RUN dnf -y update
21 |
22 | # install qt5 or qt6
23 | RUN if [ "$QT_VERSION" = "6" ]; then \
24 | dnf -y install qt6-qtbase-devel qt6-qtserialport-devel qt6-qtwebsockets-devel libxkbcommon-devel; \
25 | else \
26 | dnf -y install qt5-qtbase-devel qt5-qtserialport-devel qt5-qtwebsockets-devel qt5-qtx11extras-devel; \
27 | fi
28 |
29 | # install general deps
30 | RUN dnf -y group install 'development-tools' 'c-development' 'rpm-development-tools' && \
31 | dnf -y install \
32 | ninja-build \
33 | curl \
34 | fedora-packager \
35 | python3-devel \
36 | libXrandr-devel \
37 | xcb-util-image-devel \
38 | turbojpeg-devel \
39 | libjpeg-turbo-devel \
40 | libusb1-devel \
41 | avahi-libs \
42 | avahi-compat-libdns_sd-devel \
43 | xcb-util-devel \
44 | dbus-devel \
45 | protobuf-devel \
46 | protobuf-compiler \
47 | flatbuffers-devel \
48 | flatbuffers-compiler \
49 | mbedtls-devel \
50 | openssl-devel \
51 | libcec-devel \
52 | alsa-lib-devel \
53 | libftdi-devel \
54 | systemd-devel
55 |
56 | # Install CMake on amd64 and arm64
57 | ENV CMAKE_URL="https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}"
58 | RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
59 | curl -OLs ${CMAKE_URL}-linux-x86_64.sh; \
60 | chmod +x cmake-${CMAKE_VERSION}-linux-x86_64.sh; \
61 | ./cmake-${CMAKE_VERSION}-linux-x86_64.sh --skip-license --prefix="/usr"; \
62 | rm -rf cmake-${CMAKE_VERSION}-linux-x86_64.sh; \
63 | elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
64 | curl -OLs ${CMAKE_URL}-linux-aarch64.sh; \
65 | chmod +x cmake-${CMAKE_VERSION}-linux-aarch64.sh; \
66 | ./cmake-${CMAKE_VERSION}-linux-aarch64.sh --skip-license --prefix="/usr"; \
67 | rm -rf cmake-${CMAKE_VERSION}-linux-aarch64.sh; \
68 | fi
69 |
70 | # Show cmake version
71 | RUN cmake --version
72 |
73 | # rpmdev-setuptree will create the ~/rpmbuild directory and a set of subdirectories (e.g. SPECS and BUILD)
74 | RUN rpmdev-setuptree
75 |
76 | # download qemu and set exec flag
77 | RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
78 | 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; \
79 | else \
80 | printf '#!/bin/bash\nexec "$@"' > /usr/bin/qemu-static; \
81 | fi
82 |
83 | # set qemu exec flag
84 | RUN chmod +x /usr/bin/qemu-static
85 |
86 | # set entrypoint
87 | ENTRYPOINT [ "/usr/bin/qemu-static" ]
88 |
--------------------------------------------------------------------------------
/ubuntu_debian:
--------------------------------------------------------------------------------
1 | ARG DIST="debian"
2 | ARG SUITE="buster"
3 | ARG QT_VERSION="5"
4 | ARG REPOSITORY="https://github.com/hyperion-project"
5 | ARG CMAKE_VERSION="3.28.3"
6 | ARG DEBIAN_FRONTEND=noninteractive
7 |
8 | FROM ${DIST}:${SUITE}
9 |
10 | ARG DIST
11 | ARG SUITE
12 | ARG QT_VERSION
13 | ARG REPOSITORY
14 | ARG CMAKE_VERSION
15 | ARG DEBIAN_FRONTEND
16 | ARG TARGETPLATFORM
17 |
18 | ENV QEMU_EXECVE=1
19 | ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
20 | ENV DEBFULLNAME="Hyperion Project"
21 | ENV DEBEMAIL="admin@hyperion-project.org"
22 |
23 | # update
24 | RUN apt-get update
25 |
26 | # install qt5 or qt6 (qt6 is not available on ubuntu focal and debian buster)
27 | # on debian bullseye add backports to install qt6
28 | RUN if [ "$SUITE" != "buster" ] && [ "$SUITE" != "focal" ] && [ "$QT_VERSION" = "6" ]; then \
29 | if [ "$SUITE" = "bullseye" ]; then \
30 | echo "deb http://deb.debian.org/debian bullseye-backports main contrib non-free" | tee -a /etc/apt/sources.list; \
31 | apt-get update; \
32 | fi; \
33 | if [ "$SUITE" = "jammy" ]; then SERIALPORT="libqt6serialport6-dev"; else SERIALPORT="qt6-serialport-dev"; fi; \
34 | if [ "$SUITE" = "jammy" ]; then WEBSOCKETS="libqt6websockets6-dev"; else WEBSOCKETS="qt6-websockets-dev"; fi; \
35 | apt-get -y install qt6-base-dev $SERIALPORT $WEBSOCKETS libqt6sql6-sqlite libxkbcommon-dev libvulkan-dev libgl1-mesa-dev; \
36 | else \
37 | apt-get -y install qtbase5-dev libqt5serialport5-dev libqt5websockets5-dev libqt5sql5-sqlite libqt5svg5-dev; \
38 | fi
39 |
40 | # install general deps (all platforms/arch/os)
41 | RUN apt-get -y install \
42 | devscripts \
43 | fakeroot \
44 | debhelper \
45 | libdistro-info-perl \
46 | git \
47 | curl \
48 | python3-dev \
49 | build-essential \
50 | ninja-build \
51 | libusb-1.0-0-dev \
52 | libcec-dev \
53 | libp8-platform-dev \
54 | libudev-dev \
55 | libavahi-core-dev \
56 | libavahi-compat-libdnssd-dev \
57 | zlib1g-dev \
58 | libasound2-dev \
59 | libjpeg-dev \
60 | libturbojpeg0-dev \
61 | libmbedtls-dev \
62 | libftdi1-dev \
63 | libssl-dev \
64 | libglib2.0-dev
65 |
66 | # install X11/XCB on Ubuntu for all arch and on Debian for amd64
67 | # install libraspberrypi-dev on Debian for arm64/armhf
68 | RUN if [ "$DIST" = "ubuntu" ] || [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
69 | if [ "$QT_VERSION" = "5" ]; then \
70 | apt-get -y install libqt5x11extras5-dev; \
71 | fi; \
72 | apt-get -y install libxcb-util0-dev libxcb-randr0-dev libxcb-shm0-dev libxcb-render0-dev libxcb-image0-dev libxrandr-dev libxrender-dev; \
73 | elif [ "$TARGETPLATFORM" = "linux/arm64" ] || [ "$TARGETPLATFORM" = "linux/arm/v7" ] && [ "$SUITE" != "trixie" ]; then \
74 | apt-get -y install wget gpg dirmngr gpg-agent; \
75 | echo "deb http://archive.raspberrypi.org/debian ${SUITE} main ui" >> /etc/apt/sources.list.d/raspi.list; \
76 | apt-key adv --keyserver keyserver.ubuntu.com --recv-key 0x82B129927FA3303E; \
77 | apt-get update && apt-get -y install libraspberrypi-dev; \
78 | rm /etc/apt/sources.list.d/raspi.list; \
79 | fi
80 |
81 | # Install CMake on amd64 and arm64
82 | # Compile and install CMake on armv7
83 | ENV CMAKE_URL="https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}"
84 | RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
85 | curl -OLs ${CMAKE_URL}-linux-x86_64.sh; \
86 | chmod +x cmake-${CMAKE_VERSION}-linux-x86_64.sh; \
87 | ./cmake-${CMAKE_VERSION}-linux-x86_64.sh --skip-license --prefix="/usr"; \
88 | rm -rf cmake-${CMAKE_VERSION}-linux-x86_64.sh; \
89 | elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
90 | curl -OLs ${CMAKE_URL}-linux-aarch64.sh; \
91 | chmod +x cmake-${CMAKE_VERSION}-linux-aarch64.sh; \
92 | ./cmake-${CMAKE_VERSION}-linux-aarch64.sh --skip-license --prefix="/usr"; \
93 | rm -rf cmake-${CMAKE_VERSION}-linux-aarch64.sh; \
94 | else \
95 | mkdir -p /tmp/cmake; \
96 | cd /tmp/cmake; \
97 | curl -kL ${CMAKE_URL}.tar.gz | tar zxf - -C . --strip-components 1; \
98 | ./bootstrap --prefix=/usr; --parallel=`nproc`; \
99 | make -j `nproc`; \
100 | make install; \
101 | cd && rm -rf /tmp/cmake; \
102 | fi
103 |
104 | # Show cmake version
105 | RUN cmake --version
106 |
107 | # download qemu
108 | RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
109 | 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; \
110 | elif [ "$TARGETPLATFORM" = "linux/arm/v6" ] || [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \
111 | 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; \
112 | else \
113 | printf '#!/bin/bash\nexec "$@"' > /usr/bin/qemu-static; \
114 | fi
115 |
116 | # set qemu exec flag
117 | RUN chmod +x /usr/bin/qemu-static
118 |
119 | # cleanup
120 | RUN apt-get clean -q -y && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
121 |
122 | # set entrypoint
123 | ENTRYPOINT [ "/usr/bin/qemu-static" ]
124 |
--------------------------------------------------------------------------------