pkgname=waybar
pkgver=0.14.0
pkgdesc="Highly customizable Wayland bar for Sway and Wlroots based compositors"
homepage="https://github.com/Alexays/Waybar"
license=("MIT")
BDEPEND="
    >=app-text/scdoc-1.9.2
    dev-util/gdbus-codegen
    dev-util/wayland-scanner
    virtual/pkgconfig
"
RDEPEND="
    dev-cpp/cairomm:0
    dev-cpp/glibmm:2
    dev-cpp/gtkmm:3.0
    dev-libs/glib:2
    dev-libs/jsoncpp:=
    dev-libs/libsigc++:2
    >=dev-libs/libfmt-8.1.1:=
    >=dev-libs/spdlog-1.10.0:=
    dev-libs/date:=
    dev-libs/wayland
    >=gui-libs/gtk-layer-shell-0.9.0
    media-video/pipewire:=
    x11-libs/gtk+:3[wayland]
    x11-libs/libxkbcommon
    evdev? ( dev-libs/libevdev )
    gps? ( sci-geosciences/gpsd:= )
    jack? ( virtual/jack )
    libinput? ( dev-libs/libinput:= )
    logind? (
        || ( sys-apps/systemd
             sys-auth/elogind )
    )
    mpd? ( media-libs/libmpdclient )
    mpris? ( >=media-sound/playerctl-2 )
    network? ( dev-libs/libnl:3 )
    pipewire? ( media-video/wireplumber:0/0.5 )
    pulseaudio? ( media-libs/libpulse )
    sndio? ( media-sound/sndio:= )
    systemd? ( sys-apps/systemd:= )
    tray? (
        dev-libs/libayatana-appindicator
        dev-libs/libdbusmenu[gtk3]
    )
    udev? ( virtual/libudev:= )
    upower? ( sys-power/upower:= )
    wifi? ( sys-apps/util-linux )
"
DEPEND="${RDEPEND}
    dev-libs/wayland-protocols
    test? ( dev-cpp/catch:0 )
"
sources=("${pkgname}-${pkgver}.tar.gz")
urls=("https://github.com/Alexays/${pkgname}/archive/${pkgver}.tar.gz")
sha512sums=("dc3d18f7117be8cce5979029110770699b0d9d737337c3cf27361d6ceda6fcde33dac9781e406a70eb24c9e0e95e3801d47e81d44bfb61c311510fb30dd975a7")

src_prepare() {
  tar -xf ${distdir}/${sources[0]} --strip-components=1
}

src_build() {
  local meson_args=(
    --prefix=/usr
    --buildtype=release
    --wrap-mode=nodownload
    -D python.bytecompile=1
    -D man-pages=disabled
    -D cava=disabled # depends on LukashonakV/cava fork, but media-sound/cava is karlstav/cava
    -D libevdev=disabled
    -D gps=disabled
    -D jack=disabled
    -D libinput=enabled
    -D logind=enabled
    -D mpd=disabled
    -D mpris=disabled
    -D libnl=enabled
    -D pulseaudio=enabled
    -D wireplumber=enabled
    -D pipewire=enabled
    -D sndio=disabled
    -D systemd=enabled
    -D tests=disabled
    -D dbusmenu-gtk=enabled
    -D libudev=enabled
    -D upower_glib=disabled
    -D rfkill=disabled
    -D login-proxy=false
    -D experimental=false
    -D niri=false
  )
  meson setup build "${meson_args[@]}"
  meson configure build --no-pager
  meson compile -C build
}

src_install() {
    meson install -C build --destdir "$pkgdir"
}

# vim:ft=sh syn=sh et sw=2:
