<commit_before>tools_dir=$1

# change directory to the <build_dir>/tools directory
cd ${tools_dir}

echo "Download source code for ProteoWizard from their TeamCity server"
wget --no-verbose https://teamcity.labkey.org/guestAuth/repository/download/bt81/.lastSuccessful/VERSION
linux_pwiz=pwiz-src-without-tv-$(cat VERSION | sed 's/ /_/g')
# https://teamcity.labkey.org/viewType.html?buildTypeId=bt81
# without-tv: without tests and vendor reader
wget --no-verbose https://teamcity.labkey.org/guestAuth/repository/download/bt81/.lastSuccessful/${linux_pwiz}.tar.bz2

mkdir proteowizard
tar xf ${linux_pwiz}.tar.bz2 --directory proteowizard
cd proteowizard

if [[ "$OSTYPE" == "darwin"* ]] && [ -n "$CI" ]; then
  wget --no-verbose https://github.com/boostorg/atomic/commit/6e14ca24dab50ad4c1fa8c27c7dd6f1cb791b534.patch
  patch libraries/boost_1_67_0/boost/atomic/detail/ops_gcc_x86_dcas.hpp < 6e14ca24dab50ad4c1fa8c27c7dd6f1cb791b534.patch
fi

echo "Building ProteoWizard and Boost, this may take some time.."

# if you have more than 4GB of memory available, you could try to use more than 2 cores to speed things up
./quickbuild.sh -j2 --without-binary-msdata --prefix=../ \
                pwiz/data/common//pwiz_data_common \
                pwiz/data/identdata//pwiz_data_identdata \
                pwiz/data/identdata//pwiz_data_identdata_version \
                pwiz/data/msdata//pwiz_data_msdata \
                pwiz/data/msdata//pwiz_data_msdata_version \
                pwiz/data/proteome//pwiz_data_proteome \
                pwiz/utility/chemistry//pwiz_utility_chemistry \
                pwiz/utility/minimxml//pwiz_utility_minimxml \
                pwiz/utility/misc//SHA1 \
                pwiz/utility/misc//pwiz_utility_misc \
                /ext/zlib//z \
                /ext/boost//system \
                /ext/boost//thread \
                /ext/boost//chrono \
                /ext/boost//regex \
                /ext/boost//filesystem \
                /ext/boost//iostreams \
                /ext/boost//program_options \
                /ext/boost//serialization \
                libraries \<commit_msg>Untar boost first to apply patch<commit_after>tools_dir=$1

# change directory to the <build_dir>/tools directory
cd ${tools_dir}

echo "Download source code for ProteoWizard from their TeamCity server"
wget --no-verbose https://teamcity.labkey.org/guestAuth/repository/download/bt81/.lastSuccessful/VERSION
linux_pwiz=pwiz-src-without-tv-$(cat VERSION | sed 's/ /_/g')
# https://teamcity.labkey.org/viewType.html?buildTypeId=bt81
# without-tv: without tests and vendor reader
wget --no-verbose https://teamcity.labkey.org/guestAuth/repository/download/bt81/.lastSuccessful/${linux_pwiz}.tar.bz2

mkdir proteowizard
tar xf ${linux_pwiz}.tar.bz2 --directory proteowizard
cd proteowizard

if [[ "$OSTYPE" == "darwin"* ]] && [ -n "$CI" ]; then
  wget --no-verbose https://github.com/boostorg/atomic/commit/6e14ca24dab50ad4c1fa8c27c7dd6f1cb791b534.patch
  tar xf libraries/boost_1_67_0.tar.bz2 --directory libraries
  patch libraries/boost_1_67_0/boost/atomic/detail/ops_gcc_x86_dcas.hpp < 6e14ca24dab50ad4c1fa8c27c7dd6f1cb791b534.patch
fi

echo "Building ProteoWizard and Boost, this may take some time.."

# if you have more than 4GB of memory available, you could try to use more than 2 cores to speed things up
./quickbuild.sh -j2 --without-binary-msdata --prefix=../ \
                pwiz/data/common//pwiz_data_common \
                pwiz/data/identdata//pwiz_data_identdata \
                pwiz/data/identdata//pwiz_data_identdata_version \
                pwiz/data/msdata//pwiz_data_msdata \
                pwiz/data/msdata//pwiz_data_msdata_version \
                pwiz/data/proteome//pwiz_data_proteome \
                pwiz/utility/chemistry//pwiz_utility_chemistry \
                pwiz/utility/minimxml//pwiz_utility_minimxml \
                pwiz/utility/misc//SHA1 \
                pwiz/utility/misc//pwiz_utility_misc \
                /ext/zlib//z \
                /ext/boost//system \
                /ext/boost//thread \
                /ext/boost//chrono \
                /ext/boost//regex \
                /ext/boost//filesystem \
                /ext/boost//iostreams \
                /ext/boost//program_options \
                /ext/boost//serialization \
                libraries \
{'fraction_non_alphanumeric': 0.1121302453565696, 'fraction_numerical': 0.029121761063976154, 'mean_word_length': 2.274774774774775, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2633721', 'n_tokens_mistral': 1554, 'n_tokens_neox': 1425, 'n_words': 240}