summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorkyechou2023-07-19 21:54:37 -0500
committerkyechou2023-07-19 21:54:37 -0500
commitde87121e638810f96af2a2ea2b20aca35b0cbdab (patch)
tree111a4f7ac2f92a95c129a63f1f75a7dffc222ed4 /PKGBUILD
parent0272473dbad64e80557ba085e3ddc5ccf724e47c (diff)
downloadaur-de87121e638810f96af2a2ea2b20aca35b0cbdab.tar.gz
Clean up and fix versioning
Changelog: - Use upstream wlroots patch for nvidia. - Fix dependency list. - Fix git tag versioning. - Separate prepare and build functions. - Install hyprland and wlroots headers. - Fix $srcdir reference. - Install protocol headers and the pkgconf file.
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD179
1 files changed, 106 insertions, 73 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 01388424065a..d5789eda8894 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -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"
}