Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the build of v0.4.9.3 #37

Merged
merged 5 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AppImageBuilder.debian-bullseye.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ AppDir:
- libbluetooth3
- libgtk-3-0
- librsvg2-common
- python-is-python3
- python3-evdev
- python3-gi-cairo
- python3-pylibacl
Expand Down
1 change: 1 addition & 0 deletions AppImageBuilder.debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ AppDir:
- libbluetooth3
- libgtk-3-0
- librsvg2-common
- python-is-python3
- python3-evdev
- python3-gi-cairo
- python3-pylibacl
Expand Down
1 change: 1 addition & 0 deletions AppImageBuilder.ubuntu-focal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ AppDir:
- libbluetooth3
- libgtk-3-0
- librsvg2-common
- python-is-python3
- python3-evdev
- python3-gi-cairo
- python3-libusb1
Expand Down
1 change: 1 addition & 0 deletions AppImageBuilder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ AppDir:
- libbluetooth3
- libgtk-3-0
- librsvg2-common
- python-is-python3
- python3-evdev
- python3-gi-cairo
- python3-pylibacl
Expand Down
36 changes: 28 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,47 @@ FROM $BASE_OS:$BASE_CODENAME AS build-stage
RUN <<EOR
set -eu

# Workaround for outstanding fix of https://bugs.launchpad.net/ubuntu/+source/python-build/+bug/1992108
if grep -q ^UBUNTU_CODENAME=jammy /etc/os-release; then
echo >>/etc/apt/sources.list.d/jammy-proposed.list 'deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-proposed universe'
C0rn3j marked this conversation as resolved.
Show resolved Hide resolved
echo >>/etc/apt/sources.list.d/jammy-proposed.list 'deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ jammy-proposed universe'
fi

apt-get update
apt-get install -y --no-install-recommends \
gcc \
librsvg2-bin \
linux-headers-generic \
python3-dev \
python3-setuptools \
python-is-python3 \
python3-build \
python3-poetry \
python3-installer
python3-venv \
python-is-python3

# Workaround for Focal lacking an apt package for python3-build
dep=build
package="python3-${dep}"
if apt-cache search --names-only "^${package}$" | grep -q .; then
apt-get install -y --no-install-recommends "${package}"
else
apt-get install -y --no-install-recommends python3-pip
pip install "${dep}"
fi

apt-get clean && rm -rf /var/lib/apt/lists/*
EOR
# Prepare working directory and target
COPY . /work
WORKDIR /work
ARG TARGET=/build/usr
ARG TARGET=/build

# Build and install
RUN <<EOR
set -eu
python -m build --wheel
python -m installer --destdir="${TARGET}" dist/*.whl
python -m venv .env
.env/bin/pip install --prefix "${TARGET}/usr" dist/*.whl
# fix shebangs of scripts from '#!/work/.env/bin/python'
find "${TARGET}/usr/bin" -type f | xargs sed -i 's:work/.env:usr:'

# Provide input-event-codes.h as fallback for runtime systems without linux headers
cp -a \
Expand All @@ -41,13 +59,15 @@ RUN <<EOR
find "${TARGET}" -type f -path "*/site-packages/*${suffix}" \
| while read -r path; do ln -sfr "${path}" "${path%${suffix}}.so"; done

share="${TARGET}/usr/share"

# Put AppStream metadata to required location according to https://wiki.debian.org/AppStream/Guidelines
metainfo=/build/usr/share/metainfo
metainfo="${share}/metainfo"
mkdir -p "${metainfo}"
cp -a scripts/sc-controller.appdata.xml "${metainfo}"

# Convert icon to png format (required for icons in .desktop file)
iconpath="${TARGET}/share/icons/hicolor/512x512/apps"
iconpath="${share}/icons/hicolor/512x512/apps"
mkdir -p "${iconpath}"
rsvg-convert --background-color none -o "${iconpath}/sc-controller.png" images/sc-controller.svg
EOR
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ sc-controller = "scc.bin.sc_controller:main"

[project.scripts]
scc-daemon = "scc.bin.scc_daemon:main"
#scc = "scc.bin.scc:main"
C0rn3j marked this conversation as resolved.
Show resolved Hide resolved
scc = "scc.bin.scc:main"
scc-osd-dialog = "scc.bin.scc_osd_dialog:main"
scc-osd-keyboard = "scc.bin.scc_osd_keyboard:main"
scc-osd-launcher = "scc.bin.scc_osd_launcher:main"
Expand Down
File renamed without changes.