app=fmt
version=8.1.0
build=1sml
homepage="https://github.com/fmtlib/fmt"
download="https://github.com/fmtlib/fmt/archive/refs/tags/$version.tar.gz"
desc="Formatting library for C++"
requires="musl gcc-libs"

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

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

  mkdir smbuild && cd smbuild
  cmake .. \
    -DCMAKE_INSTALL_PREFIX="" \
    -DCMAKE_INSTALL_LIBDIR="/lib" \
    -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
    -DBUILD_SHARED_LIBS=ON \
    -Wno-dev

  make
  make install DESTDIR=$pkg

  install -m 644 ../LICENSE.rst $pkgdocs/LICENSE

  mkfinalpkg
}

sha512sums="
63d052c6ba7ca53978ca42b8a72d8548eabae04064832bb79010f44f0276b31d0a2fc02d99b09a350ce514931afc387d5fe13c121344cad6d87fe4d504810d9f  fmt-8.1.0.tar.gz
"
