NAME="doxygen"
DESC="Documentation system for C++, C, Java, Objective-C, Corba IDL and to some extent PHP, C# and D"
VERSION="1.9.7"
FILES=("https://doxygen.nl/files/doxygen-$VERSION.src.tar.gz")
HASHES=("95008edf2d84aeefb7c65a6a4857dc2c")
DEPENDS=("cmake" "git")

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

  grep -rl '^#!.*python$' | xargs sed -i '1s/python/&3/'

  mkdir -v build
  cd       build

  cmake -G "Unix Makefiles"       \
      -DCMAKE_BUILD_TYPE=Release  \
      -DCMAKE_INSTALL_PREFIX=/usr \
      -Wno-dev ..
  make && make DESTDIR="$ROOTDIR" install
  mkdir -pv "$ROOTDIR/usr/share/man/man1"
  install -vm644 ../doc/*.1 "$ROOTDIR/usr/share/man/man1"

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