app=cmake
version=3.17.3
build=1sml
homepage="http://www.cmake.org"
download="https://cmake.org/files/v$version/cmake-$version.tar.gz"
desc="Cross-platform, open-source make system"
requires="gcc-libs openssl libunistring libidn2"

build() {
  mkandenterbuilddir
  rm -rf $app-$version

  tar xf $srcdir/$app-$version.tar.?z*
  cd $app-$version
  fixbuilddirpermissions

  para="$(echo $MAKEFLAGS | sed 's/-j//')"

  ./bootstrap \
    --prefix="" \
    --no-system-curl \
    --no-system-expat \
    --no-system-jsoncpp \
    --no-system-zlib \
    --no-system-bzip2 \
    --no-system-libarchive \
    --no-qt-gui \
    --parallel="$para"

  make
  make install DESTDIR=$pkg

  cp Licenses/* Copyright.txt $pkgdocs/

  mkfinalpkg
}

sha512sums="
e68eb80a294a4ee441f5e29b95a6450677ef8d7a8aa40e29e7475db9aa7566edd903ce4bfb57a0795f8e31dd29f16620f588b81b5fd9f74e80f996de980bccd3  cmake-3.17.3.tar.lz
"
