NAME="polybar"
DESC="A fast and easy-to-use status bar"
VERSION="3.7.2"

FILES=("https://github.com/polybar/polybar/releases/download/${VERSION}/polybar-${VERSION}.tar.gz")
HASHES=("e2feacbd02e7c94baed7f50b13bcbf307d95df0325c3ecae443289ba5b56af29")

DEPENDS=(
  "libuv" "cairo" "xcb-util-image"
  "xcb-util-wm" "xcb-util-xrm" "xcb-util-cursor"
  "alsa-lib" "pulseaudio" "mpd"
  "libnl" "jsoncpp" "curl"
)
BUILD=(
  "cmake" "ninja" "pkg-config"
  "python3" "sphinx" "i3wm"
  "xcb-proto"
)

PACKAGE() {
  tar xf "polybar-${VERSION}.tar.gz"
  cd "${NAME}-${VERSION}"

  mkdir build
  cd    build

  cmake .. -GNinja              \
    -DCMAKE_BUILD_TYPE=Release  \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_DOC_HTML=OFF        \
    -DBUILD_TESTS=ON            \
    -DPYTHON_EXECUTABLE=/usr/bin/python3

  cmake --build .
  DESTDIR="${ROOTDIR}" cmake --install .

  cd ../.. && rm -r ${NAME}-${VERSION}
}
