boost191: fix loongarch64-linux build (#560714)

This commit is contained in:
Weijia Wang
2026-09-07 17:08:30 +00:00
committed by GitHub
2 changed files with 34 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
lib,
stdenv,
fetchFromGitHub,
fetchpatch,
bison,
# boost derivation to use for the src and version.
# This is used by the boost derivation to build
@@ -34,6 +35,22 @@ stdenv.mkDerivation {
patches =
useBoost.boostBuildPatches or [ ]
++
lib.optional
(
useBoost ? version
&& lib.versionAtLeast useBoost.version "1.91"
&& lib.versionOlder useBoost.version "1.92"
&& stdenv.hostPlatform.isLoongArch64
)
# Fix crash in var_defines when define string is empty
# https://github.com/boostorg/boost/issues/1141
(
fetchpatch {
url = "https://github.com/boostorg/build/commit/708353cdeb6006757e7c6971283efb53f718ae25.patch";
hash = "sha256-9WWgQPyiKrvQY1ox6sdWoeksgNPDIy0DAbDOfQKJ5y0=";
}
)
++ lib.optional (
useBoost ? version
&& lib.versionAtLeast useBoost.version "1.81"

View File

@@ -269,7 +269,23 @@ stdenv.mkDerivation {
hash = "sha256-0IHK55JSujYcwEVOuLkwOa/iPEkdAKQlwVWR42p/X2U=";
}
)
++
lib.optional
(
lib.versionAtLeast version "1.91"
&& lib.versionOlder version "1.92"
&& stdenv.hostPlatform.isLoongArch64
)
# Fix crash in var_defines when define string is empty
# https://github.com/boostorg/boost/issues/1141
(
fetchpatch {
url = "https://github.com/boostorg/build/commit/708353cdeb6006757e7c6971283efb53f718ae25.patch";
stripLen = 1;
extraPrefix = "tools/build/";
hash = "sha256-uFdxuL3DXvr/jmz7jv/q76/S8JaNF//2ogTMwG/D2nY=";
}
)
++ lib.optionals (version == "1.87.0") [
# Fix operator<< for shared_ptr and intrusive_ptr
# https://github.com/boostorg/smart_ptr/issues/115