diff --git a/Containerfile b/Containerfile index 2f462dd..306912f 100644 --- a/Containerfile +++ b/Containerfile @@ -9,6 +9,13 @@ ARG FEDORA_MAJOR_VERSION=38 # Warning: changing this might not do anything for you. Read comment above. ARG BASE_IMAGE_URL=ghcr.io/ublue-os/silverblue-main +# This is to install xboxdrv for the Xbox 360 controller. +FROM registry.fedoraproject.org/fedora:${FEDORA_MAJOR_VERSION} as xboxdrv-bin + +COPY scripts/install-xboxdrv.sh /tmp/scripts/install-xboxdrv.sh + +RUN /tmp/scripts/install-xboxdrv.sh + FROM ${BASE_IMAGE_URL}:${FEDORA_MAJOR_VERSION} # The default recipe set to the recipe's default filename @@ -34,6 +41,8 @@ COPY --from=docker.io/mikefarah/yq /usr/bin/yq /usr/bin/yq # Install cosign for verifying signatures for images. COPY --from=gcr.io/projectsigstore/cosign /ko-app/cosign /usr/bin/cosign +COPY --from=xboxdrv-bin /usr/bin/xboxdrv /usr/bin/xboxdrv + # Copy the build script and all custom scripts. COPY scripts /tmp/scripts diff --git a/scripts/install-xboxdrv.sh b/scripts/install-xboxdrv.sh new file mode 100755 index 0000000..6e329c1 --- /dev/null +++ b/scripts/install-xboxdrv.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -oue pipefail + +dnf install git gcc-c++ pkgconfig libusb1-devel boost-devel systemd-devel dbus-devel python3-scon +cd ~ +mkdir src +cd src +git clone https://gitlab.com/xboxdrv/xboxdrv.git +cd xboxdrv +git checkout stable +git submodule update --init --recursive +scons +make install \ No newline at end of file