Last active
March 10, 2025 22:33
-
-
Save mrinaldhillon/1ff4815870d3c80767efec7aa7b9cc5e to your computer and use it in GitHub Desktop.
displaylink install on asahi fedora
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
set -euo pipefail | |
ARCH=aarch64 | |
FEDORA_VERSION=$(grep -oP '(?<=VERSION_ID=)\d+' /etc/os-release) | |
MOCK_TARGET="fedora-${FEDORA_VERSION}-${ARCH}" | |
if ! command -v mock &>/dev/null; then | |
echo "Installing mock.." | |
sudo dnf5 install mock -y | |
sudo usermod -aG mock "$USER" | |
newgrp mock | |
fi | |
if ! command -v gh &>/dev/null; then | |
echo "Installing gh..." | |
sudo dnf5 install gh -y | |
fi | |
gh release download --repo displaylink-rpm/displaylink-rpm --pattern "fedora-${FEDORA_VERSION}-displaylink-*.src.rpm" -O "./displaylink.src.rpm" | |
rpm -i ./displaylink.src.rpm | |
# use xwayland if available | |
sed -i 's/^Requires:.*xorg-x11-server-Xorg.*/Requires: (xorg-x11-server-Xorg >= 1.16 or xorg-x11-server-Xwayland)/' ~/rpmbuild/SPECS/displaylink.spec | |
rpmbuild -bs ~/rpmbuild/SPECS/displaylink.spec | |
SRC_RPM=$(rpmbuild -bs ~/rpmbuild/SPECS/displaylink.spec | awk '/Wrote:/ {print $2}') | |
mock -r "$MOCK_TARGET" --rebuild "$SRC_RPM" | |
BUILT_RPM=$(find /var/lib/mock/"${MOCK_TARGET}"/result/displaylink-*."${ARCH}".rpm | head -n 1) | |
echo "RPM Build $BUILT_RPM" | |
sudo dnf5 install "$BUILT_RPM" -y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment