|
1 | 1 | ARG BASE_OS=ubuntu
|
2 |
| -ARG BASE_CODENAME=jammy |
| 2 | +ARG BASE_CODENAME=noble |
3 | 3 | FROM $BASE_OS:$BASE_CODENAME AS build-stage
|
4 | 4 |
|
5 | 5 | # Download build dependencies
|
6 |
| -RUN apt-get update && apt-get install -y --no-install-recommends \ |
7 |
| - gcc librsvg2-bin linux-headers-generic python3-dev python3-setuptools |
8 |
| - |
| 6 | +RUN <<EOR |
| 7 | +apt-get update |
| 8 | +apt-get install -y --no-install-recommends \ |
| 9 | + gcc \ |
| 10 | + librsvg2-bin \ |
| 11 | + linux-headers-generic \ |
| 12 | + python3-dev \ |
| 13 | + python3-setuptools \ |
| 14 | + python-is-python3 |
| 15 | +apt-get clean && rm -rf /var/lib/apt/lists/* |
| 16 | +EOR |
9 | 17 | # Prepare working directory and target
|
10 | 18 | COPY . /work
|
11 | 19 | WORKDIR /work
|
12 | 20 | ARG TARGET=/build/usr
|
13 | 21 |
|
14 | 22 | # Build and install
|
15 |
| -RUN python3 setup.py build --executable "/usr/bin/env python3" && \ |
16 |
| - python3 setup.py install --single-version-externally-managed --home "${TARGET}" --record /dev/null |
| 23 | +RUN <<EOR |
| 24 | +python setup.py build --executable "/usr/bin/env python3" |
| 25 | +python setup.py install --single-version-externally-managed --home "${TARGET}" --record /dev/null |
17 | 26 |
|
18 | 27 | # Provide input-event-codes.h as fallback for runtime systems without linux headers
|
19 |
| -RUN cp -a \ |
20 |
| - "$(find /usr -type f -name input-event-codes.h -print -quit)" \ |
21 |
| - "$(find "${TARGET}" -type f -name uinput.py -printf '%h\n' -quit)" |
| 28 | +cp -a \ |
| 29 | + "$(find /usr -type f -name input-event-codes.h -print -quit)" \ |
| 30 | + "$(find "${TARGET}" -type f -name uinput.py -printf '%h\n' -quit)" |
22 | 31 |
|
23 | 32 | # Create short name symlinks for static libraries
|
24 |
| -RUN suffix=".cpython-*-$(uname -m)-linux-gnu.so" && \ |
25 |
| - find "${TARGET}" -type f -path "*/site-packages/*${suffix}" \ |
26 |
| - | while read -r path; do ln -sfr "${path}" "${path%${suffix}}.so"; done |
| 33 | +suffix=".cpython-*-$(uname -m)-linux-gnu.so" |
| 34 | +find "${TARGET}" -type f -path "*/site-packages/*${suffix}" \ |
| 35 | + | while read -r path; do ln -sfr "${path}" "${path%${suffix}}.so"; done |
27 | 36 |
|
28 | 37 | # Put AppStream metadata to required location according to https://wiki.debian.org/AppStream/Guidelines
|
29 |
| -RUN metainfo=/build/usr/share/metainfo && \ |
30 |
| - mkdir -p "${metainfo}" && \ |
31 |
| - cp -a scripts/sc-controller.appdata.xml "${metainfo}" |
| 38 | +metainfo=/build/usr/share/metainfo |
| 39 | +mkdir -p "${metainfo}" |
| 40 | +cp -a scripts/sc-controller.appdata.xml "${metainfo}" |
32 | 41 |
|
33 | 42 | # Convert icon to png format (required for icons in .desktop file)
|
34 |
| -RUN iconpath="${TARGET}/share/icons/hicolor/512x512/apps" && \ |
35 |
| - mkdir -p "${iconpath}" && \ |
36 |
| - rsvg-convert --background-color none -o "${iconpath}/sc-controller.png" images/sc-controller.svg |
| 43 | +iconpath="${TARGET}/share/icons/hicolor/512x512/apps" |
| 44 | +mkdir -p "${iconpath}" |
| 45 | +rsvg-convert --background-color none -o "${iconpath}/sc-controller.png" images/sc-controller.svg |
| 46 | +EOR |
37 | 47 |
|
38 | 48 | # Store build metadata
|
39 | 49 | ARG TARGETOS TARGETARCH TARGETVARIANT
|
|
0 commit comments