app=boost
sversion=1_69_0
version="$(echo $sversion | sed 's@_@.@g')"
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"

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

  tar xf $srcdir/"$app"_"$sversion".tar.?z*
  cd "$app"_"$sversion" 
  chown -R root.root .

  applypatch $srcdir/boost-execinfo.patch

  unset CXX
  # Also symlink <toolchain>-gcc-6.3.0 to gcc-6.3.0 and <toolchain>-g++ to g++-6.3.0

  CC="$CC" \
  ./bootstrap.sh \
    --prefix="$pkg" \

  ./b2 -j3 toolset=gcc-foo -d+2 stage threading=multi link=shared || true
  ./b2 -j3 -d+2 install threading=multi link=shared || true

  cp LICENSE_1_0.txt $pkgdocs/LICENSE

  mkfinalpkg
}

sha512sums="
d0e9bb858c44880d56c0291afef6a1b011a62f659a2d8f58dcb6147ea0899f9157bd8db3097896618fee0116847ebeac78b6d0f0fec8a92c3469500828bbe552  boost_1_69_0.tar.bz2
16d8d072adb9073f240e3f7ff73591d3867681c4ba47f6f9f7d064e367b45a97e1f757ff01e489d0d834382670f9e9658755754d0e0dce62b08e6045c1f8605a  boost-execinfo.patch
"
