# Maintainer: PktSurf <smlinux@pktsurf.in>
app=boost
sversion=1_81_0
version=1.81.0
build=1sml
homepage="https://www.boost.org/"
download="https://boostorg.jfrog.io/artifactory/main/release/$version/source/boost_$sversion.tar.bz2"
requires="bzip2 zlib findutils python3 icu xz"
desc="Huge collection of free peer-reviewed portable C++ source libraries"

prepbuilddir() {
  mkandenterbuilddir
  rm -rf "$app"_"$sversion"

  tar xf $srcdir/"$app"_"$sversion".tar.?z*
  cd "$app"_"$sversion" 
  # Our fixbuilddirpermissions is disliked by a couple of files in here
  chown -R root.root .
  touch ."$app-$version.extraction.complete"
}

build() {
  CC="$CC" \
  ./bootstrap.sh \
    --prefix="$pkg" --with-toolset=gcc --with-icu --with-python=python3 

  build_options="$MAKEFLAGS toolset=gcc threading=multi runtime-link=shared link=shared \
      cflags=-fno-strict-aliasing --without-graph_parallel --without-mpi"
  
  ./b2 $build_options
  ./b2 $build_options install

  install -Dm 755 b2 $pkg/bin/b2
  ( cd $pkg ; ln -s b2 bjam )

  cp LICENSE_1_0.txt $pkgdocs/LICENSE

  mkfinalpkg
}

sha512sums="
8f18972314e8dd5c952825fc52ca49d17b0e0b31db12bcc1cd0ba42c2d71c4f6ce5f5062fdbb65db029ec2c58ca93a32c32d0cdce62329556200dc8650a03fbf  boost_1_81_0.tar.gz
"
