Skip to content

Instantly share code, notes, and snippets.

@clementpoiret
Last active April 23, 2024 09:50
Show Gist options
  • Save clementpoiret/992d7b4c8cd3707b21461366c817db4d to your computer and use it in GitHub Desktop.
Save clementpoiret/992d7b4c8cd3707b21461366c817db4d to your computer and use it in GitHub Desktop.
hyprland-displaylink-git
# Maintainer: Clément POIRET <poiret dot clement at outlook dot fr>
_pkgname="hyprland"
pkgname="${_pkgname}-displaylink-git"
pkgver="0.38.1"
pkgrel=1
pkgdesc="A dynamic tiling Wayland compositor based on wlroots that doesn't sacrifice on its looks. (DisplayLink patch)"
arch=(any)
url="https://github.com/hyprwm/Hyprland"
license=('BSD')
depends=(
cairo
gcc-libs
glib2
glibc
glslang
hyprlang
hyprcursor
libdisplay-info
libdrm
libglvnd
libinput
libliftoff
libx11
libxcb
libxcomposite
libxfixes
libxkbcommon
libxrender
opengl-driver
pango
pixman
polkit
seatd
systemd-libs
tomlplusplus
wayland
wayland-protocols
xcb-proto
xcb-util
xcb-util-errors
xcb-util-keysyms
xcb-util-renderutil
xcb-util-wm
xorg-xinput
xorg-xwayland
)
depends+=(libdisplay-info.so)
makedepends=(
cmake
gdb
git
jq
meson
ninja
pkgconf
xorgproto
)
source=(
"${pkgname}-${pkgver}.tar.gz::https://github.com/hyprwm/Hyprland/releases/download/v${pkgver}/source-v${pkgver}.tar.gz"
"displaylink.patch"
)
conflicts=("${_pkgname}")
provides=(hyprland)
sha256sums=('1a86365cc006fca4bc96c6c41347d0bde048b6463c516e09b9c54cff58fb73ab'
'70c8f6af41ed252c2cee7b1fc0b29ff29c7f81932a9dd3014716571b0728e5ab')
options=(!makeflags !buildflags !strip)
prepare() {
cd "$srcdir/hyprland-source"
patch -d subprojects/wlroots -Np1 < ../displaylink.patch
}
build() {
cd "$srcdir/hyprland-source"
meson setup build \
--prefix /usr \
--libexecdir lib \
--sbindir bin \
--buildtype release \
--wrap-mode nodownload \
-D b_lto=true \
-D b_pie=true \
-D default_library=shared \
-D xwayland=enabled \
-D systemd=enabled
meson compile -C build
}
package() {
cd "$srcdir/hyprland-source"
meson install -C build \
--destdir "$pkgdir" \
--skip-subprojects hyprland-protocols
mkdir "$pkgdir/usr/include/hyprland/wlroots"
mv "$pkgdir/usr/include/wlr" "$pkgdir/usr/include/hyprland/wlroots"
# resolve conflicts with system wlr
rm -f "$pkgdir/usr/lib/libwlroots.so"
rm -rf "$pkgdir/usr/lib/pkgconfig"
# FIXME: remove after xdg-desktop-portal-hyprland disowns hyprland-portals.conf
rm -rf "$pkgdir/usr/share/xdg-desktop-portal"
# license
install -Dm0644 -t "$pkgdir/usr/share/licenses/${pkgname}" LICENSE
}
@clementpoiret
Copy link
Author

Okay, so now your hyprland setup works. I would say you may want to try few things:

  1. instead of the evdi package, try evdi-git or evdi-compat,
  2. try the same setup with and lts kernel,

Also, regularly nvidia drivers are breaking things. If you do not use your GPU, I'd suggest trying the nouveau driver. For my personal workflow, nouveau suits my needs on my laptop as I do not use CUDA and cuDNN on it. At least, if you try the nouveau driver and see that your screen is working, it means that's effectively an issue with nvidia, so you can try to temporarily downgrade your nvidia drivers. I got tired of nvidia breaking things randomly so I gave up and went the nouveau path :)

@dvrkoo
Copy link

dvrkoo commented Apr 23, 2024

Already tried using evdi-git and using lts kernel , unfortunately my workflow relies heavily on CUDA so I cannot really live without it, I'm just gonna stick with x11 in the meanwhile, thanks for your work

@clementpoiret
Copy link
Author

Hopefully one day this patch will be merged into wlroots, let's cross our fingers :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment