APP=libical
VERSION=3.0.8
BUILD=2sml
HOMEPAGE='https://github.com/libical/libical'
DOWNLOAD='https://github.com/libical/libical/archive/refs/tags/v3.0.8.tar.gz'
DESC="iCAL calendaring and scheduling protocol implementation"
REQUIRES="gcc-libs icu"

build() {
  mkandenterbuilddir
  rm -rf $APP-$VERSION

  tar xf $SRCDIR/$APP-$VERSION.tar.?z*
  cd $APP-$VERSION
  fixbuilddirpermissions

  # Thanks gentoo linux
  patch -p1 < $SRCDIR/icu-68.patch
  
  mkdir -p smbuild && cd smbuild
  cmake .. \
    -DCMAKE_INSTALL_PREFIX="" \
    -DLIB_SUFFIX=lib \
    -DINCLUDE_INSTALL_DIR=include \
    -DCMAKE_BUILD_TYPE=Release \
    -DENABLE_GTK_DOC=OFF \
    -DSHARED_ONLY=ON

  make
  make install DESTDIR=$PKG

  cp ../{LICENSE,ReadMe.txt,ReleaseNotes.txt,THANKS,TODO} $PKGDOCS/ 

  mkfinalpkg
}

SHA512SUMS="
4c195f96d5c1d0dbd3c2c4c46dda2a4675c65e2cffa6b0ce7ee71d656a32dc75a6bb4d2b111395a1c01dfa7f1a0ccf579221fb63da72af7e4b9ac4b966debc29  libical-3.0.8.tar.lz
98b0b685676e7aa54e49050ec8adab4bb6cd3827fcd3977c156d841a527268cb47b3227852036f4bb195931ae8295fa6761bc96f4d4042f059193ab6f75aa27a  icu-68.patch
"
