#!/usr/bin/env modbuild
pbuild::set_download_url "https://netcologne.dl.sourceforge.net/project/${P}/${P}/$V/${P}_${V_PKG//./_}.tar.gz"
#pbuild::set_download_url "https://dl.bintray.com/boostorg/release/${V_PKG}/source/${P}_${V_PKG//./_}.tar.gz"

pbuild::add_to_group 'Compiler'

BOOST_BUILD_PATH="${BUILD_DIR}"

TOOLSET=''

pbuild::pre_configure() {
	case "${COMPILER}" in
	gcc )
	        TOOLSET=gcc
	        ;;
	clang )
		TOOLSET=clang
		;;
	* )
	        std::die 1 "Unsupported compiler!"
	        ;;
	esac

        cd "${SRC_DIR}"
        ./bootstrap.sh \
                --prefix="${PREFIX}" \
                --with-toolset=${TOOLSET} \
                --without-libraries=python \
                || exit 1
        ./b2  \
                --build-dir="${BUILD_DIR}" \
                --layout=system \
                --without-python \
		--without-mpi \
                toolset=${TOOLSET} \
                variant=release \
                link=shared,static \
                threading=multi \
                install -j 3 \
                || exit 1
}

pbuild::compile() {
	:
}
pbuild::install() {
	:
}
