NAME="libgit2"
DESC="Linkable library implementation of Git that you can use in your application"
VERSION="1.8.0"
FILES=("https://github.com/libgit2/libgit2/archive/refs/tags/v$VERSION.tar.gz")
HASHES=("9e1d6a880d59026b675456fbb1593c724c68d73c34c0d214d6eb848e9bbd8ae4")
DEPENDS=("gcc-libs" "glibc" "zlib" "http-parser")

PACKAGE() {
  tar xf v$VERSION.tar.gz
  cd $NAME-$VERSION

  mkdir build
  cd    build

  cmake -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DREGEX_BACKEND=pcre2 \
    -DUSE_HTTP_PARSER=system \
    -DUSE_SSH=ON \
    -S "$VERSION" \
    -Wno-dev ..
  cmake --build .
  DESTDIR="$ROOTDIR" cmake --install .

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