# Description: Brotli compression library
# URL: https://github.com/google/brotli
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on:

name=brotli
version=1.1.0
release=1
source=(https://github.com/google/$name/archive/v$version/$name-v$version.tar.gz)

build() {
  cmake -S $name-$version -B build -G Ninja \
    -D CMAKE_BUILD_TYPE=Release \
    -D CMAKE_INSTALL_PREFIX=/usr \
    -D CMAKE_INSTALL_LIBDIR=lib \
    -D BUILD_SHARED_LIBS=True

  cmake --build build
  DESTDIR=$PKG cmake --install build

  cd $name-$version
  /usr/bin/python3 setup.py build
  /usr/bin/python3 setup.py install \
    --prefix=/usr --root=$PKG --optimize=1
}
