-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #915 from matty0ung/usability
Fix Boost install on Linux
- Loading branch information
Showing
2 changed files
with
44 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/usr/bin/env python3 | ||
#----------------------------------------------------------------------------------------------------------------------- | ||
# scripts/buildTool.py is part of Brewtarget, and is copyright the following authors 2022-2024: | ||
# scripts/buildTool.py is part of Brewtarget, and is copyright the following authors 2022-2025: | ||
# • Matt Young <[email protected]> | ||
# | ||
# Brewtarget is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License | ||
|
@@ -582,8 +582,9 @@ def installDependencies(): | |
# | ||
# Although things should compile with 1.79.0, if we're going to all the bother of installing Boost manually, | ||
# we'll install a more recent one. | ||
# | ||
minBoostVersion = packaging.version.parse('1.79.0') | ||
boostVersionToInstall = packaging.version.parse('1.84.0') # NB: This _must_ have the patch version | ||
boostVersionToInstall = packaging.version.parse('1.87.0') # NB: This _must_ have the patch version | ||
maxBoostVersionFound = packaging.version.parse('0') | ||
possibleBoostVersionHeaders = [pathlib.Path('/usr/include/boost/version.hpp'), | ||
pathlib.Path('/usr/local/include/boost/version.hpp')] | ||
|
@@ -656,6 +657,22 @@ def installDependencies(): | |
# cd ~ | ||
# sudo rm -rf ~/boost-tmp | ||
# | ||
# EXCEPT that, from time to time, the jfrog link stops working. (AIUI, JFrog provides hosting to Boost at | ||
# no cost, but sometimes usage limit is exceeded on their account.) | ||
# | ||
# Instead, you can download Boost more reliably from GitHub: | ||
# | ||
# cd ~ | ||
# mkdir ~/boost-tmp | ||
# cd ~/boost-tmp | ||
# wget https://github.com/boostorg/boost/releases/download/boost-1.87.0/boost-1.87.0-b2-nodocs.tar.xz | ||
# tar -xf boost-1.87.0-b2-nodocs.tar.xz | ||
# cd boost-1.87.0 | ||
# ./bootstrap.sh | ||
# sudo ./b2 install | ||
# cd ~ | ||
# sudo rm -rf ~/boost-tmp | ||
# | ||
# We can handle the temporary directory stuff more elegantly (ie RAII style) in Python however | ||
# | ||
# NOTE: On older versions of Linux, there are problems building some of the Boost libraries that I haven't | ||
|
@@ -715,15 +732,22 @@ def installDependencies(): | |
previousWorkingDirectory = pathlib.Path.cwd().as_posix() | ||
os.chdir(tmpDirName) | ||
log.debug('Working directory now ' + pathlib.Path.cwd().as_posix()) | ||
boostBaseName = 'boost-' + str(boostVersionToInstall) | ||
boostUnderscoreName = 'boost_' + str(boostVersionToInstall).replace('.', '_') | ||
# downloadFile( | ||
# 'https://boostorg.jfrog.io/artifactory/main/release/' + str(boostVersionToInstall) + '/source/' + | ||
# boostUnderscoreName + '.tar.bz2' | ||
# ) | ||
downloadFile( | ||
'https://boostorg.jfrog.io/artifactory/main/release/' + str(boostVersionToInstall) + '/source/' + | ||
boostUnderscoreName + '.tar.bz2' | ||
'https://github.com/boostorg/boost/releases/download/' + | ||
boostBaseName + '/' + boostBaseName + '-b2-nodocs.tar.xz' | ||
) | ||
log.debug('Boost download completed') | ||
shutil.unpack_archive(boostUnderscoreName + '.tar.bz2') | ||
# shutil.unpack_archive(boostUnderscoreName + '.tar.bz2') | ||
shutil.unpack_archive(boostBaseName + '-b2-nodocs.tar.xz') | ||
log.debug('Boost archive extracted') | ||
os.chdir(boostUnderscoreName) | ||
# os.chdir(boostUnderscoreName) | ||
os.chdir(boostBaseName) | ||
log.debug('Working directory now ' + pathlib.Path.cwd().as_posix()) | ||
btUtils.abortOnRunFail(subprocess.run(['./bootstrap.sh', '--with-python=python3'])) | ||
log.debug('Boost bootstrap finished') | ||
|
@@ -1666,8 +1690,18 @@ def doPackage(): | |
) | ||
|
||
# | ||
# The source tarball and its checksum end up in the meson-dist subdirectory of mbuild, so we just move them into the | ||
# packages/source directory (first making sure the latter exists and is empty!). | ||
# The compressed source tarball and its checksum end up in the meson-dist subdirectory of mbuild, so we just move | ||
# them into the packages/source directory (first making sure the latter exists and is empty!). | ||
# | ||
# The filename of the compressed tarball etc generated by Meson are always: | ||
# [project_name]-[project_version].tar.xz | ||
# [project_name]-[project_version].tar.xz.sha256sum | ||
# | ||
# We would prefer the names to be: | ||
# [project_name]-[project_version]-Source_Code.tar.xz | ||
# [project_name]-[project_version]-Source_Code.tar.xz.sha256sum | ||
# | ||
# TODO We should do this renaming and regenerate the sha256sum file (so it contains the new filename) | ||
# | ||
# We are only talking about 2 files, so some of this is overkill, but it's easier to be consistent with what we do | ||
# for the other subdirectories of mbuild/packages | ||
|