diff options
-rw-r--r-- | .SRCINFO | 56 | ||||
-rw-r--r-- | PKGBUILD | 179 | ||||
-rw-r--r-- | nvidia.patch | 41 |
3 files changed, 132 insertions, 144 deletions
@@ -1,57 +1,53 @@ pkgbase = hyprland-nvidia-git pkgdesc = A dynamic tiling Wayland compositor based on wlroots that doesn't sacrifice on its looks. (NVIDIA patch) - pkgver = r3103.7091d4e5 - pkgrel = 3 + pkgver = 0.27.2.r7.g7091d4e5 + pkgrel = 1 url = https://github.com/hyprwm/Hyprland arch = any license = BSD - makedepends = git makedepends = cmake - makedepends = ninja - makedepends = gcc makedepends = gdb + makedepends = git makedepends = meson + makedepends = ninja makedepends = vulkan-headers - makedepends = wayland-protocols makedepends = xorgproto - depends = libxcb - depends = xcb-proto - depends = xcb-util - depends = xcb-util-keysyms - depends = libxfixes - depends = libx11 - depends = libxcomposite - depends = xorg-xinput - depends = libxrender - depends = pixman - depends = wayland-protocols depends = cairo - depends = pango - depends = polkit + depends = gcc-libs + depends = glibc depends = glslang + depends = libdisplay-info + depends = libdrm + depends = libglvnd depends = libinput + depends = libliftoff + depends = libx11 depends = libxcb + depends = libxcomposite + depends = libxfixes depends = libxkbcommon + depends = libxrender depends = opengl-driver + depends = pango depends = pixman + depends = polkit + depends = seatd + depends = systemd-libs + depends = vulkan-icd-loader + depends = vulkan-validation-layers depends = wayland + depends = wayland-protocols + depends = xcb-proto + depends = xcb-util depends = xcb-util-errors + depends = xcb-util-keysyms depends = xcb-util-renderutil depends = xcb-util-wm - depends = seatd - depends = vulkan-icd-loader - depends = vulkan-validation-layers + depends = xorg-xinput depends = xorg-xwayland - depends = libliftoff - depends = libdisplay-info provides = hyprland conflicts = hyprland - options = !makeflags - options = !buildflags - options = !strip - source = hyprland::git+https://github.com/hyprwm/Hyprland.git - source = nvidia.patch + source = hyprland-nvidia-git::git+https://github.com/hyprwm/Hyprland.git sha256sums = SKIP - sha256sums = 75d2a0158a42d1e3400e13242fe8f153069da6711faec688aa561f406b4e6fe7 pkgname = hyprland-nvidia-git @@ -1,92 +1,125 @@ # Maintainer: tohmais <callum.wishart@protonmail.com> +# Contributor: Kuan-Yen Chou <kuanyenchou@gmail.com> -_pkgname="hyprland" -pkgname="${_pkgname}-nvidia-git" -pkgver=r3103.7091d4e5 -pkgrel=3 +pkgname=hyprland-nvidia-git +pkgver=0.27.2.r7.g7091d4e5 +pkgrel=1 pkgdesc="A dynamic tiling Wayland compositor based on wlroots that doesn't sacrifice on its looks. (NVIDIA patch)" arch=(any) url="https://github.com/hyprwm/Hyprland" license=('BSD') depends=( - libxcb - xcb-proto - xcb-util - xcb-util-keysyms - libxfixes - libx11 - libxcomposite - xorg-xinput - libxrender - pixman - wayland-protocols - cairo - pango - polkit - glslang - libinput - libxcb - libxkbcommon - opengl-driver - pixman - wayland - xcb-util-errors - xcb-util-renderutil - xcb-util-wm - seatd - vulkan-icd-loader - vulkan-validation-layers - xorg-xwayland - libliftoff - libdisplay-info) + cairo + gcc-libs + glibc + glslang + libdisplay-info + libdrm + libglvnd + libinput + libliftoff + libx11 + libxcb + libxcomposite + libxfixes + libxkbcommon + libxrender + opengl-driver + pango + pixman + polkit + seatd + systemd-libs + vulkan-icd-loader + vulkan-validation-layers + wayland + wayland-protocols + xcb-proto + xcb-util + xcb-util-errors + xcb-util-keysyms + xcb-util-renderutil + xcb-util-wm + xorg-xinput + xorg-xwayland +) makedepends=( - git - cmake - ninja - gcc - gdb - meson - vulkan-headers - wayland-protocols - xorgproto) -source=("${_pkgname}::git+https://github.com/hyprwm/Hyprland.git" - "nvidia.patch") -conflicts=("${_pkgname}") + cmake + gdb + git + meson + ninja + vulkan-headers + xorgproto +) provides=(hyprland) -sha256sums=('SKIP' - '75d2a0158a42d1e3400e13242fe8f153069da6711faec688aa561f406b4e6fe7') -options=(!makeflags !buildflags !strip) +conflicts=(hyprland) +source=("$pkgname::git+https://github.com/hyprwm/Hyprland.git") +sha256sums=('SKIP') pkgver() { - cd "$_pkgname" - ( set -o pipefail - git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' || - printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" - ) + cd "$srcdir/$pkgname" + if git describe --long --tags >/dev/null 2>&1; then + git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' + else + printf 'r%s.%s' "$(git rev-list --count HEAD)" "$(git describe --always)" + fi +} + +prepare() { + cd "$srcdir/$pkgname" + git submodule update --init + make fixwlr + sed -i -e '/^release:/{n;s/-D/-DCMAKE_SKIP_RPATH=ON -D/}' Makefile + cd "$srcdir/$pkgname/subprojects/wlroots" + patch -Np1 < "$srcdir/$pkgname/nix/wlroots-nvidia.patch" } build() { - cd "${srcdir}/${_pkgname}" - git submodule update --init - make fixwlr - patch --directory="$srcdir/$_pkgname/subprojects/wlroots/" --forward --strip=0 \ - --input="${srcdir}/nvidia.patch" - cd "./subprojects/wlroots/" && meson build/ --prefix="${srcdir}/tmpwlr" --buildtype=release && ninja -C build/ && mkdir -p "${srcdir}/tmpwlr" && ninja -C build/ install && cd ../ - cd udis86 && cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -H./ -B./build -G Ninja && cmake --build ./build --config Release --target all -j$(shell nproc) && cd ../.. - make protocols + # Build wlroots + cd "$srcdir/$pkgname/subprojects/wlroots" + meson build/ --prefix="$srcdir/tmpwlr" --buildtype=release + ninja -C build/ + mkdir -p "$srcdir/tmpwlr" + ninja -C build/ install + + # Build udis86 + cd "$srcdir/$pkgname/subprojects/udis86" + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -G Ninja + cmake --build build --config Release --target all + + # Build hyprland + cd "$srcdir/$pkgname" + make protocols make release - cd ./hyprctl && make all && cd .. + make -C hyprctl all } package() { - cd "${srcdir}/${_pkgname}" - mkdir -p "${pkgdir}/usr/share/wayland-sessions" - mkdir -p "${pkgdir}/usr/share/hyprland" - install -Dm755 build/Hyprland -t "${pkgdir}/usr/bin" - install -Dm755 hyprctl/hyprctl -t "${pkgdir}/usr/bin" - install -Dm644 assets/*.png -t "${pkgdir}/usr/share/hyprland" - install -Dm644 example/hyprland.desktop -t "${pkgdir}/usr/share/wayland-sessions" - install -Dm644 example/hyprland.conf -t "${pkgdir}/usr/share/hyprland" - install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${_pkgname}" - install -Dm755 ../tmpwlr/lib/libwlroots.so.12032 -t "${pkgdir}/usr/lib" + # Install hyprland headers + cd "$srcdir/$pkgname/src" + find . -name '*.hpp' -exec install -Dm644 {} "$pkgdir/usr/include/hyprland/{}" \; + + # Fix $srcdir reference + sed -i -e "/ICONDIR/ s,$srcdir/tmpwlr,/usr," "$srcdir/$pkgname/subprojects/wlroots/build/include/config.h" + + # Install wlroots headers + cd "$srcdir/$pkgname/subprojects/wlroots/include" + find . -name '*.h' -exec install -Dm644 {} "$pkgdir/usr/include/hyprland/wlroots/{}" \; + cd "$srcdir/$pkgname/subprojects/wlroots/build/include" + find . -name '*.h' -exec install -Dm644 {} "$pkgdir/usr/include/hyprland/wlroots/{}" \; + + # Install hyprland + cd "$srcdir/$pkgname/build" + cmake -DCMAKE_INSTALL_PREFIX=/usr .. + cd "$srcdir/$pkgname" + install -Dm755 -t "$pkgdir/usr/bin" build/Hyprland + install -Dm755 -t "$pkgdir/usr/bin" hyprctl/hyprctl + install -Dm644 -t "$pkgdir/usr/include/hyprland/protocols" protocols/*-protocol.h + install -Dm644 -t "$pkgdir/usr/share/hyprland" assets/*.png + install -Dm644 -t "$pkgdir/usr/share/hyprland" example/hyprland.conf + install -Dm644 -t "$pkgdir/usr/share/licenses/hyprland" LICENSE + install -Dm644 -t "$pkgdir/usr/share/pkgconfig" build/hyprland.pc + install -Dm644 -t "$pkgdir/usr/share/wayland-sessions" example/hyprland.desktop + install -Dm755 -t "$pkgdir/usr/lib" "$srcdir/tmpwlr/lib/libwlroots.so.12032" } diff --git a/nvidia.patch b/nvidia.patch deleted file mode 100644 index f8f134f0e5b6..000000000000 --- a/nvidia.patch +++ /dev/null @@ -1,41 +0,0 @@ -diff --git /render/gles2/renderer.c /render/gles2/renderer.c -index 9fe934f7..9662d4ee 100644 ---- render/gles2/renderer.c -+++ render/gles2/renderer.c -@@ -176,7 +176,7 @@ static bool gles2_bind_buffer(struct wlr_renderer *wlr_renderer, - assert(wlr_egl_is_current(renderer->egl)); - - push_gles2_debug(renderer); -- glFlush(); -+ glFinish(); - glBindFramebuffer(GL_FRAMEBUFFER, 0); - pop_gles2_debug(renderer); - -diff --git /types/output/render.c /types/output/render.c -index a185d844..01df6ffc 100644 ---- types/output/render.c -+++ types/output/render.c -@@ -240,22 +240,7 @@ bool output_pick_format(struct wlr_output *output, - } - - uint32_t wlr_output_preferred_read_format(struct wlr_output *output) { -- struct wlr_renderer *renderer = output->renderer; -- assert(renderer != NULL); -- -- if (!renderer->impl->preferred_read_format || !renderer->impl->read_pixels) { -- return DRM_FORMAT_INVALID; -- } -- -- if (!wlr_output_attach_render(output, NULL)) { -- return false; -- } -- -- uint32_t fmt = renderer->impl->preferred_read_format(renderer); -- -- output_clear_back_buffer(output); -- -- return fmt; -+ return DRM_FORMAT_XRGB8888; - } - - struct wlr_render_pass *wlr_output_begin_render_pass(struct wlr_output *output, |