summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e5d6c048e8fef18dee19d984568486e9ab703cf6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Maintainer:  sandwich <sandwich at archworks dot co>
# Contributor: Clément POIRET <poiret dot clement at outlook dot fr>
# Contributor: Julian Poidevin <poidevin dot julian at gmail dot com>

_pkgname="hyprland"
pkgname="${_pkgname}-displaylink-git"
pkgver=0.38.1
pkgrel=4
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
  wlroots-displaylink-git
  xcb-proto
  xcb-util
  xcb-util-errors
  xcb-util-keysyms
  xcb-util-renderutil
  xcb-util-wm
  xorg-xinput
  xorg-xwayland
)
makedepends=(
  cmake
  gdb
  git
  jq
  meson
  ninja
  pkgconf
  xorgproto
)
source=(
  "${pkgname}::git+https://github.com/hyprwm/Hyprland.git#tag=v${pkgver}"
  "displaylink.patch"
  )
provides=("${pkgname%-displaylink-git}")
conflicts=("${pkgname%-displaylink-git}")
sha256sums=('180182843ed6385c63aba2472a7fd46be240d85a0f41d417d3375b299f7dd296'
            '8547270650479714b91dccb98aa8e4bf5095eff6acd6855a60a1929ccccc1eba')
options=(!makeflags !buildflags !strip)

prepare() {
    cd "$srcdir/$pkgname"
    git submodule update --init --recursive

    patch --directory="$srcdir/${pkgname}/subprojects/wlroots/" --forward --strip=1 \
        --input="$srcdir/displaylink.patch"
}

build() {
    cd "$srcdir/${pkgname}"

    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/${pkgname}"

  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 -f "$pkgdir/usr/lib/libwlroots.so.13"
  rm -rf "$pkgdir/usr/lib/pkgconfig"
  rm -rf "$pkgdir/usr/share/xdg-desktop-portal"

  # license
  install -Dm0644 -t "$pkgdir/usr/share/licenses/${pkgname}" LICENSE
}