From f6d2bc0cc9e312e77e12187189bcfdd018b78161 Mon Sep 17 00:00:00 2001 From: Mikhail Novosyolov Date: Wed, 17 Oct 2018 15:19:11 +0300 Subject: [PATCH] Dynamically switch between system and Chromium's libc++ by glibc version. Restore jumbo. --- chromium-browser-stable.spec | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/chromium-browser-stable.spec b/chromium-browser-stable.spec index f1676dd..24ec5ec 100644 --- a/chromium-browser-stable.spec +++ b/chromium-browser-stable.spec @@ -352,6 +352,22 @@ cmp $FILE $FILE.orig && exit 1 mkdir -p third_party/node/linux/node-linux-x64/bin ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/node +# If system glibc is too old, use Chromium's built-in libc++, otherwise use system libc++. +# Shell does not or may not understand not integer values correctly, +# so remove the dot by sed to make the value of the glibc version an integer. +glibc_version="$(rpm -q --queryformat "%{VERSION}" glibc | sed -e 's/\.//g')" +# -lt means 'less than' +# glibc 2.27 is used as a stop point, because today (17.10.2018) Chromium +# is built with system glibc 2.27 in ALT Sisyphus, +# ROSA has glibc 2.25, and chromium 69 is unbuildable with it +if [ "$glibc_version" -lt 227 ] + then use_custom_libcxx='true' + else use_custom_libcxx='false' +fi +export use_custom_libcxx +echo "DEBUG: use_custom_libcxx = ${use_custom_libcxx}" +%define use_custom_libcxx %(echo ${use_custom_libcxx}) + %build %define use_gold true %if 0%{clang} @@ -417,24 +433,10 @@ CFLAGS="$CFLAGS -Wno-error=pointer-to-int-cast -Wno-error=int-to-pointer-cast" CXXFLAGS="$CXXFLAGS -Wno-error=attributes -Wno-error=comment -Wno-error=unused-variable -Wno-error=strict-overflow -Wno-error=deprecated-declarations" %endif -# If system glibc is too old, use Chromium's built-in libc++, otherwise use system libc++. -# Shell does not or may not understand not integer values correctly, -# so remove the dot by sed to make the value of the glibc version an integer. -glibc_version="$(rpm -q --queryformat "%{VERSION}" glibc | sed -e 's/\.//g')" -# -lt means 'less than' -# glibc 2.27 is used as a stop point, because today (17.10.2018) Chromium -# is built with system glibc 2.27 in ALT Sisyphus, -# ROSA has glibc 2.25, and chromium 69 is unbuildable with it -if [ "$glibc_version" -lt 227 ] - then use_custom_libcxx='true' - else use_custom_libcxx='false' -fi -echo "DEBUG: use_custom_libcxx = ${use_custom_libcxx}" - # v NO TABS IN HERE! %define gn_config use_sysroot=false \ system_libdir="%{_lib}" \ - use_custom_libcxx="${use_custom_libcxx}" \ + use_custom_libcxx="%{use_custom_libcxx}" \ icu_use_data_file=true \ enable_nacl=false \ optimize_webui=true \