Skip to content

Commit

Permalink
Update hyprland PKGBUILD
Browse files Browse the repository at this point in the history
  • Loading branch information
AOx0 committed Oct 16, 2023
1 parent 8040512 commit 748ed60
Showing 1 changed file with 108 additions and 77 deletions.
185 changes: 108 additions & 77 deletions hyprland-git/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,90 +1,121 @@
# Maintainer: ThatOneCalculator <[email protected]>
# Maintainer: FabioLolix
# Maintainer: éclairevoyant
# Contributor: ThatOneCalculator <kainoa at t1c dot dev>

_pkgname="hyprland"
pkgname="${_pkgname}-git"
pkgver=r3423.ffacd2ef
pkgname=hyprland-git
pkgver=0.30.0.r90.962a0de0
pkgrel=1
pkgdesc="A dynamic tiling Wayland compositor based on wlroots that doesn't sacrifice on its looks."
arch=(any)
arch=(x86_64 aarch64)
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
pango)
makedepends=(
git
cmake
ninja
gcc
gdb
meson
vulkan-headers
wayland-protocols
xorgproto)
source=("${_pkgname}::git+https://github.com/hyprwm/Hyprland.git")
conflicts=("${_pkgname}")
provides=(hyprland)
sha256sums=('SKIP')
options=(!makeflags !buildflags !strip)
license=(BSD)
depends=(cairo
gcc-libs
glib2
glibc
glslang
libdisplay-info
libdrm
libglvnd
libinput
libliftoff
libx11
libxcb
libxcomposite
libxfixes
libxkbcommon
libxrender
opengl-driver
pango
pixman
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)
depends+=(libdisplay-info.so)
makedepends=(cmake
gdb
git
meson
ninja
vulkan-headers
xorgproto)
provides=("hyprland=${pkgver%%.r*}")
conflicts=(hyprland)
source=("git+https://github.com/hyprwm/Hyprland.git"
"git+https://gitlab.freedesktop.org/wlroots/wlroots.git"
"git+https://github.com/hyprwm/hyprland-protocols.git"
"git+https://github.com/canihavesomecoffee/udis86.git"
"git+https://github.com/wolfpld/tracy.git")
b2sums=('SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP')

pick_mr() {
git pull origin pull/$1/head --no-edit
}

prepare() {
cd Hyprland
git submodule init
git config submodule.wlroots.url "$srcdir/wlroots"
git config submodule.subprojects/hyprland-protocols.url "$srcdir/hyprland-protocols"
git config submodule.subprojects/udis86.url "$srcdir/udis86"
git config submodule.subprojects/tracy.url "$srcdir/tracy"
git -c protocol.file.allow=always submodule update

if [[ -z "$(git config --get user.name)" ]]; then
git config user.name local && git config user.email '<>' && git config commit.gpgsign false
fi
# Pick pull requests from github using `pick_mr <pull request number>`.

pushd subprojects/wlroots
patch -p1 < ../packagefiles/wlroots-meson-build.patch
popd
}

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)"
)
git -C Hyprland describe --long --tags | sed 's/^v//;s/\([^-]*-\)g/r\1/;s/-/./g'
}

build() {
cd "${srcdir}/${_pkgname}"
git submodule update --init
make fixwlr
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
make release
cd ./hyprctl && make all && cd ..
cd Hyprland

arch-meson build --buildtype=release -Db_pch=false -Ddefault_library=shared
ln -sf wlroots build/subprojects/wlroots/include/wlr
meson compile -C build
}

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"
}
cd Hyprland

meson install -C build --destdir "$pkgdir"

rm -rf "$pkgdir/usr/include/hyprland/wlroots/wlr"
ln -sf . "$pkgdir/usr/include/hyprland/wlroots/wlr"
# resolve conflicts with system wlr
rm "$pkgdir/usr/lib/libwlroots.so"
rm "$pkgdir/usr/lib/pkgconfig/wlroots.pc"
# resolve conflicts with xdg-desktop-portal-hyprland from repo
rm -rf "$pkgdir/usr/share/xdg-desktop-portal"
# FIXME: meson.build shall install version.h
install -Dm0644 -t "$pkgdir/usr/include/hyprland/src" src/version.h

# license
install -Dm0644 -t "$pkgdir/usr/share/licenses/${pkgname}" LICENSE
}
# vi: et ts=2 sw=2

0 comments on commit 748ed60

Please sign in to comment.