diff --git a/.github/workflows/macos-build.yml b/.github/workflows/macos-build.yml index 5aae854ab1..73b9a2f6e1 100644 --- a/.github/workflows/macos-build.yml +++ b/.github/workflows/macos-build.yml @@ -16,8 +16,8 @@ jobs: build: runs-on: macos-latest env: - boost_version: 1.83.0 - BOOST_ROOT: ${{ github.workspace }}/deps/boost_1_83_0 + boost_version: 1.84.0 + BOOST_ROOT: ${{ github.workspace }}/deps/boost-1.84.0 RIME_PLUGINS: ${{ inputs.rime_plugins }} steps: - name: Checkout last commit @@ -43,14 +43,17 @@ jobs: uses: actions/cache@v3 with: path: | - ${{ env.BOOST_ROOT }}.tar.bz2 + ${{ env.BOOST_ROOT }}.tar.xz key: ${{ runner.os }}-boost-${{ env.boost_version }} - name: Extract Boost source tarball if: steps.cache-boost.outputs.cache-hit == 'true' run: | pushd deps - tar --bzip2 -xf ${{ env.BOOST_ROOT }}.tar.bz2 + tar -xJf ${{ env.BOOST_ROOT }}.tar.xz + cd ${{ env.BOOST_ROOT }} + ./bootstrap.sh + ./b2 headers popd - name: Install Boost diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index a7b4c5f89c..f5f1a12948 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -20,8 +20,8 @@ jobs: - { compiler: msvc, cc: cl, cxx: cl } - { compiler: clang, cc: clang, cxx: clang++ } env: - boost_version: 1.83.0 - BOOST_ROOT: ${{ github.workspace }}\deps\boost_1_83_0 + boost_version: 1.84.0 + BOOST_ROOT: ${{ github.workspace }}\deps\boost-1.84.0 RIME_PLUGINS: ${{ inputs.rime_plugins }} steps: @@ -36,7 +36,6 @@ jobs: $envfile = ".\env.bat" $envcontent = @" set RIME_ROOT=%CD% - if not defined BOOST_ROOT set BOOST_ROOT=%RIME_ROOT%\deps\boost_1_83_0 set CXX=${{ matrix.cxx }} set CC=${{ matrix.cc }} set CMAKE_GENERATOR=Ninja @@ -74,12 +73,15 @@ jobs: - name: Download Boost source if: steps.cache-boost-src.outputs.cache-hit != 'true' run: | - aria2c https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.7z -d deps + aria2c /~https://github.com/boostorg/boost/releases/download/boost-${{ env.boost_version }}/boost-${{ env.boost_version }}.7z -d deps - name: Extract Boost source tarball run: | pushd deps 7z x ${{ env.BOOST_ROOT }}.7z + cd ${{ env.BOOST_ROOT }} + .\bootstrap.bat + .\b2 headers popd - name: Cache dependencies diff --git a/README-mac.md b/README-mac.md index 9c10a4e786..59b8a38ec0 100644 --- a/README-mac.md +++ b/README-mac.md @@ -21,7 +21,7 @@ third-party dependencies separately. ## Install Boost C++ libraries Boost is a third-party library which librime code heavily depend on. -These dependencies include a few compiled (non-header-only) Boost libraries. +These dependencies include a few header-only Boost libraries. **Option 1 (recommended):** Download and build Boost from source. @@ -31,14 +31,13 @@ bash install-boost.sh ``` The make script will download Boost source tarball, extract it to -`librime/deps/boost_` and create needed static libraries -for building macOS uinversal binary. +`librime/deps/boost-`. -Set shell variable `BOOST_ROOT` to the path to `boost_` directory prior +Set shell variable `BOOST_ROOT` to the path to `boost-` directory prior to building librime. ``` sh -export BOOST_ROOT="$(pwd)/deps/boost_1_83_0" +export BOOST_ROOT="$(pwd)/deps/boost-1.84.0" ``` **Option 2:** Install Boost libraries from Homebrew. diff --git a/env.bat.template b/env.bat.template index a687714957..432e887224 100644 --- a/env.bat.template +++ b/env.bat.template @@ -3,7 +3,7 @@ rem Customize your build environment and save the modified copy to env.bat set RIME_ROOT=%CD% rem REQUIRED: path to Boost source directory -if not defined BOOST_ROOT set BOOST_ROOT=%RIME_ROOT%\deps\boost_1_83_0 +if not defined BOOST_ROOT set BOOST_ROOT=%RIME_ROOT%\deps\boost-1.84.0 rem architecture, Visual Studio version and platform toolset set ARCH=Win32 diff --git a/env.vs2019.bat b/env.vs2019.bat index a687714957..432e887224 100644 --- a/env.vs2019.bat +++ b/env.vs2019.bat @@ -3,7 +3,7 @@ rem Customize your build environment and save the modified copy to env.bat set RIME_ROOT=%CD% rem REQUIRED: path to Boost source directory -if not defined BOOST_ROOT set BOOST_ROOT=%RIME_ROOT%\deps\boost_1_83_0 +if not defined BOOST_ROOT set BOOST_ROOT=%RIME_ROOT%\deps\boost-1.84.0 rem architecture, Visual Studio version and platform toolset set ARCH=Win32 diff --git a/env.vs2022.bat b/env.vs2022.bat index 0dda233551..d4fa93178d 100644 --- a/env.vs2022.bat +++ b/env.vs2022.bat @@ -3,7 +3,7 @@ rem Customize your build environment and save the modified copy to env.bat set RIME_ROOT=%CD% rem REQUIRED: path to Boost source directory -if not defined BOOST_ROOT set BOOST_ROOT=%RIME_ROOT%\deps\boost_1_83_0 +if not defined BOOST_ROOT set BOOST_ROOT=%RIME_ROOT%\deps\boost-1.84.0 rem architecture, Visual Studio version and platform toolset set ARCH=Win32 diff --git a/install-boost.bat b/install-boost.bat index ab7b486d7e..5203bbe0fc 100644 --- a/install-boost.bat +++ b/install-boost.bat @@ -2,17 +2,19 @@ setlocal if not defined RIME_ROOT set RIME_ROOT=%CD% -if not defined boost_version set boost_version=1.83.0 -set boost_x_y_z=%boost_version:.=_% +if not defined boost_version set boost_version=1.84.0 -if not defined BOOST_ROOT set BOOST_ROOT=%RIME_ROOT%\deps\boost_%boost_x_y_z% +if not defined BOOST_ROOT set BOOST_ROOT=%RIME_ROOT%\deps\boost-%boost_version% -if exist "%BOOST_ROOT%\boost" goto boost_found +if exist "%BOOST_ROOT%\libs" goto boost_found for %%I in ("%BOOST_ROOT%\.") do set src_dir=%%~dpI rem download boost source -aria2c https://boostorg.jfrog.io/artifactory/main/release/%boost_version%/source/boost_%boost_x_y_z%.7z -d %src_dir% +aria2c /~https://github.com/boostorg/boost/releases/download/boost-%boost_version%/boost-%boost_version%.7z -d %src_dir% pushd %src_dir% -7z x boost_%boost_x_y_z%.7z +7z x boost-%boost_version%.7z +cd boost-%boost_version% +.\bootstrap.bat +.\b2 headers popd :boost_found diff --git a/install-boost.sh b/install-boost.sh index ef442a371d..f3ac91bbbf 100755 --- a/install-boost.sh +++ b/install-boost.sh @@ -3,15 +3,13 @@ set -ex RIME_ROOT="$(cd "$(dirname "$0")"; pwd)" -boost_version="${boost_version=1.83.0}" -boost_x_y_z="${boost_version//./_}" +boost_version="${boost_version=1.84.0}" -BOOST_ROOT="${BOOST_ROOT=${RIME_ROOT}/deps/boost_${boost_x_y_z}}" +BOOST_ROOT="${BOOST_ROOT=${RIME_ROOT}/deps/boost-${boost_version}}" -boost_tarball="boost_${boost_x_y_z}.tar.bz2" -download_url="https://boostorg.jfrog.io/artifactory/main/release/${boost_version}/source/${boost_tarball}" -boost_tarball_sha256sum_1_83_0='6478edfe2f3305127cffe8caf73ea0176c53769f4bf1585be237eb30798c3b8e boost_1_83_0.tar.bz2' -boost_tarball_sha256sum="${boost_tarball_sha256sum=${boost_tarball_sha256sum_1_83_0}}" +boost_tarball="boost-${boost_version}.tar.xz" +download_url="/~https://github.com/boostorg/boost/releases/download/boost-${boost_version}/${boost_tarball}" +boost_tarball_sha256sum="2e64e5d79a738d0fa6fb546c6e5c2bd28f88d268a2a080546f74e5ff98f29d0e ${boost_tarball}" download_boost_source() { cd "${RIME_ROOT}/deps" @@ -19,7 +17,7 @@ download_boost_source() { curl -LO "${download_url}" fi echo "${boost_tarball_sha256sum}" | shasum -a 256 -c - tar --bzip2 -xf "${boost_tarball}" + tar -xJf "${boost_tarball}" [[ -f "${BOOST_ROOT}/bootstrap.sh" ]] } @@ -29,4 +27,7 @@ if [[ $# -eq 0 || " $* " =~ ' --download ' ]]; then else echo "found boost at ${BOOST_ROOT}" fi + cd "${BOOST_ROOT}" + ./bootstrap.sh + ./b2 headers fi