Skip to content

Commit 4132085

Browse files
authored
Merge pull request #1792 from evoskuil/master
Regenerate artifacts.
2 parents f0b02b7 + cf417f0 commit 4132085

3 files changed

Lines changed: 63 additions & 72 deletions

File tree

install-cmake.sh

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,6 @@
88
# Script to build and install libbitcoin-system.
99
#
1010
# Script options:
11-
# --with-icu Compile with International Components for Unicode.
12-
# Since the addition of BIP-39 and later BIP-38
13-
# support, libbitcoin conditionally incorporates ICU
14-
# to provide BIP-38 and BIP-39 passphrase
15-
# normalization features. Currently
16-
# libbitcoin-explorer is the only other library that
17-
# accesses this feature, so if you do not intend to
18-
# use passphrase normalization this dependency can
19-
# be avoided.
20-
# --build-icu Builds ICU libraries.
2111
# --build-boost Builds Boost libraries.
2212
# --build-dir=<path> Location of downloaded and intermediate files.
2313
# --prefix=<absolute-path> Library install location (defaults to /usr/local).
@@ -61,11 +51,6 @@ BUILD_SRC_DIR="build-libbitcoin-system"
6151

6252
PRESUMED_CI_PROJECT_PATH=$(pwd)
6353

64-
# ICU archive.
65-
#------------------------------------------------------------------------------
66-
ICU_URL="https://github.com/unicode-org/icu/releases/download/release-78.2/icu4c-78.2-sources.tgz"
67-
ICU_ARCHIVE="icu4c-78.2-sources.tgz"
68-
6954
# Boost archive.
7055
#------------------------------------------------------------------------------
7156
BOOST_URL="https://archives.boost.io/release/1.86.0/source/boost_1_86_0.tar.bz2"
@@ -223,16 +208,6 @@ display_help()
223208
display_message "Usage: ./install.sh [OPTION]..."
224209
display_message "Manage the installation of libbitcoin-system."
225210
display_message "Script options:"
226-
display_message " --with-icu Compile with International Components for Unicode."
227-
display_message " Since the addition of BIP-39 and later BIP-38 "
228-
display_message " support, libbitcoin conditionally incorporates ICU "
229-
display_message " to provide BIP-38 and BIP-39 passphrase "
230-
display_message " normalization features. Currently "
231-
display_message " libbitcoin-explorer is the only other library that "
232-
display_message " accesses this feature, so if you do not intend to "
233-
display_message " use passphrase normalization this dependency can "
234-
display_message " be avoided."
235-
display_message " --build-icu Build ICU libraries."
236211
display_message " --build-boost Build Boost libraries."
237212
display_message " --build-secp256k1 Build libsecp256k1 libraries."
238213
display_message " --build-dir=<path> Location of downloaded and intermediate files."
@@ -261,10 +236,8 @@ parse_command_line_options()
261236
(--disable-static) DISABLE_STATIC="yes";;
262237

263238
# Common project options.
264-
(--with-icu) WITH_ICU="yes";;
265239

266240
# Custom build options.
267-
(--build-icu) BUILD_ICU="yes";;
268241
(--build-boost) BUILD_BOOST="yes";;
269242
(--build-secp256k1) BUILD_SECP256K1="yes";;
270243

@@ -388,12 +361,6 @@ handle_custom_options()
388361
export CMAKE_LIBRARY_PATH="${PREFIX}/lib:${CMAKE_LIBRARY_PATH}"
389362
fi
390363
fi
391-
392-
# Process ICU
393-
if [[ $WITH_ICU ]]; then
394-
CUMULATIVE_FILTERED_ARGS+=" --with-icu"
395-
CUMULATIVE_FILTERED_ARGS_CMAKE+=" -Dwith-icu=yes"
396-
fi
397364
}
398365

399366
remove_build_options()
@@ -468,8 +435,6 @@ display_configuration()
468435
display_message "CXXFLAGS : $CXXFLAGS"
469436
display_message "LDFLAGS : $LDFLAGS"
470437
display_message "LDLIBS : $LDLIBS"
471-
display_message "WITH_ICU : $WITH_ICU"
472-
display_message "BUILD_ICU : $BUILD_ICU"
473438
display_message "BUILD_BOOST : $BUILD_BOOST"
474439
display_message "BUILD_SECP256K1 : $BUILD_SECP256K1"
475440
display_message "BOOST_ROOT : $BOOST_ROOT"
@@ -913,11 +878,6 @@ build_from_tarball_boost()
913878
#==============================================================================
914879
build_all()
915880
{
916-
unpack_from_tarball "$ICU_ARCHIVE" "$ICU_URL" gzip "$BUILD_ICU"
917-
local SAVE_CPPFLAGS="$CPPFLAGS"
918-
export CPPFLAGS="$CPPFLAGS ${ICU_FLAGS[@]}"
919-
build_from_tarball "$ICU_ARCHIVE" source "$PARALLEL" "$BUILD_ICU" "${ICU_OPTIONS[@]}" $CUMULATIVE_FILTERED_ARGS
920-
export CPPFLAGS=$SAVE_CPPFLAGS
921881
unpack_from_tarball "$BOOST_ARCHIVE" "$BOOST_URL" bzip2 "$BUILD_BOOST"
922882
local SAVE_CPPFLAGS="$CPPFLAGS"
923883
export CPPFLAGS="$CPPFLAGS ${BOOST_FLAGS[@]}"
@@ -964,11 +924,6 @@ remove_install_options
964924

965925
# Define build flags.
966926
#==============================================================================
967-
# Define icu flags.
968-
#------------------------------------------------------------------------------
969-
ICU_FLAGS=(
970-
"-w")
971-
972927
# Define boost flags.
973928
#------------------------------------------------------------------------------
974929
BOOST_FLAGS=(
@@ -982,19 +937,6 @@ SECP256K1_FLAGS=(
982937

983938
# Define build options.
984939
#==============================================================================
985-
# Define icu options.
986-
#------------------------------------------------------------------------------
987-
ICU_OPTIONS=(
988-
"--enable-draft" \
989-
"--enable-rpath" \
990-
"--enable-tools" \
991-
"--disable-extras" \
992-
"--disable-icuio" \
993-
"--disable-layout" \
994-
"--disable-layoutex" \
995-
"--disable-tests" \
996-
"--disable-samples")
997-
998940
# Define boost options.
999941
#------------------------------------------------------------------------------
1000942
BOOST_OPTIONS=(

install-cmakepresets.sh

Lines changed: 61 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,6 @@
88
# Script to build and install libbitcoin-system.
99
#
1010
# Script options:
11-
# --with-icu Compile with International Components for Unicode.
12-
# Since the addition of BIP-39 and later BIP-38
13-
# support, libbitcoin conditionally incorporates ICU
14-
# to provide BIP-38 and BIP-39 passphrase
15-
# normalization features. Currently
16-
# libbitcoin-explorer is the only other library that
17-
# accesses this feature, so if you do not intend to
18-
# use passphrase normalization this dependency can
19-
# be avoided.
20-
# --build-icu Builds ICU libraries.
2111
# --build-boost Builds Boost libraries.
2212
# --build-dir=<path> Location of downloaded and intermediate files.
2313
# --preset=<label> CMakePreset label.
@@ -252,6 +242,8 @@ parse_command_line_options()
252242
(--disable-shared) DISABLE_SHARED="yes";;
253243
(--disable-static) DISABLE_STATIC="yes";;
254244

245+
# Common project options.
246+
255247
# Custom build options.
256248
(--build-boost) BUILD_BOOST="yes";;
257249
(--build-secp256k1) BUILD_SECP256K1="yes";;
@@ -407,7 +399,6 @@ handle_custom_options()
407399
export CMAKE_LIBRARY_PATH="${PREFIX}/lib:${CMAKE_LIBRARY_PATH}"
408400
fi
409401
fi
410-
411402
}
412403

413404
remove_build_options()
@@ -767,6 +758,23 @@ build_from_github_cmake()
767758
cmake_project_directory "$REPO" "$PRESET" "$JOBS" "$TEST" "${CONFIGURATION[@]}"
768759
}
769760

761+
# Because boost ICU static lib detection assumes in incorrect ICU path.
762+
circumvent_boost_icu_detection()
763+
{
764+
# Boost expects a directory structure for ICU which is incorrect.
765+
# Boost ICU discovery fails when using prefix, can't fix with -sICU_LINK,
766+
# so we rewrite the two 'has_icu_test.cpp' files to always return success.
767+
768+
local SUCCESS="int main() { return 0; }"
769+
local REGEX_TEST="libs/regex/build/has_icu_test.cpp"
770+
local LOCALE_TEST="libs/locale/build/has_icu_test.cpp"
771+
772+
printf "%s" "$SUCCESS" > $REGEX_TEST
773+
printf "%s" "$SUCCESS" > $LOCALE_TEST
774+
775+
# display_message "Hack: ICU detection modified, will always indicate found."
776+
}
777+
770778
# Because boost doesn't support autoconfig and doesn't like empty settings.
771779
initialize_boost_configuration()
772780
{
@@ -789,6 +797,32 @@ initialize_boost_configuration()
789797
fi
790798
}
791799

800+
# Because boost doesn't use pkg-config.
801+
# The hacks below are still required as of boost 1.72.0.
802+
initialize_boost_icu_configuration()
803+
{
804+
BOOST_ICU_ICONV="on"
805+
BOOST_ICU_POSIX="on"
806+
807+
if [[ $WITH_ICU ]]; then
808+
# Restrict other locale options when compiling boost with icu.
809+
BOOST_ICU_ICONV="off"
810+
BOOST_ICU_POSIX="off"
811+
812+
# Work around boost ICU static lib discovery bug.
813+
circumvent_boost_icu_detection
814+
815+
# Extract ICU prefix directory from package config variable.
816+
ICU_PREFIX=$(pkg-config icu-i18n --variable=prefix)
817+
818+
# Extract ICU libs from package config variables and augment with -ldl.
819+
ICU_LIBS="$(pkg-config icu-i18n --libs) -ldl"
820+
821+
# This is a hack for boost m4 scripts that fail with ICU dependency.
822+
export BOOST_ICU_LIBS=("${ICU_LIBS[@]}")
823+
fi
824+
}
825+
792826
# Because boost doesn't use autoconfig.
793827
build_from_tarball_boost()
794828
{
@@ -811,6 +845,7 @@ build_from_tarball_boost()
811845
push_directory "$TARGET"
812846

813847
initialize_boost_configuration
848+
initialize_boost_icu_configuration
814849

815850
guessed_toolset=`./tools/build/src/engine/build.sh --guess-toolset`
816851
CXXFLAGS="-w" ./tools/build/src/engine/build.sh ${guessed_toolset} --cxxflags="-w"
@@ -829,8 +864,12 @@ build_from_tarball_boost()
829864
display_message "boost cxxflags : $BOOST_CXXFLAGS"
830865
display_message "boost linkflags : $BOOST_LINKFLAGS"
831866
display_message "link : $BOOST_LINK"
867+
display_message "boost.locale.iconv : $BOOST_ICU_ICONV"
868+
display_message "boost.locale.posix : $BOOST_ICU_POSIX"
832869
display_message "-sNO_BZIP2 : 1"
833870
display_message "-sNO_ZSTD : 1"
871+
display_message "-sICU_PATH : $ICU_PREFIX"
872+
# display_message "-sICU_LINK : " "${ICU_LIBS[*]}"
834873
display_message "-j : $JOBS"
835874
display_message "-d0 : [supress informational messages]"
836875
display_message "-q : [stop at the first error]"
@@ -842,7 +881,14 @@ build_from_tarball_boost()
842881

843882
./bootstrap.sh \
844883
"--with-bjam=./b2" \
845-
"--prefix=$PREFIX"
884+
"--prefix=$PREFIX" \
885+
"--with-icu=$ICU_PREFIX"
886+
887+
# boost_regex:
888+
# As of boost 1.72.0 the ICU_LINK symbol is no longer supported and
889+
# produces a hard stop if WITH_ICU is also defined. Removal is sufficient.
890+
# github.com/libbitcoin/libbitcoin-system/issues/1192
891+
# "-sICU_LINK=${ICU_LIBS[*]}"
846892

847893
./b2 install \
848894
"cxxstd=20" \
@@ -853,8 +899,11 @@ build_from_tarball_boost()
853899
"$BOOST_LINKFLAGS" \
854900
"link=$BOOST_LINK" \
855901
"warnings=off" \
902+
"boost.locale.iconv=$BOOST_ICU_ICONV" \
903+
"boost.locale.posix=$BOOST_ICU_POSIX" \
856904
"-sNO_BZIP2=1" \
857905
"-sNO_ZSTD=1" \
906+
"-sICU_PATH=$ICU_PREFIX" \
858907
"-j $JOBS" \
859908
"-d0" \
860909
"-q" \

libbitcoin-system.pc.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ Version: @PACKAGE_VERSION@
2424
#==============================================================================
2525
# Dependencies that publish package configuration.
2626
#------------------------------------------------------------------------------
27-
Requires: @icu_i18n_PKG@ libsecp256k1 >= 0.5.1.0
27+
Requires: libsecp256k1 >= 0.5.1.0
2828

2929
# Include directory and any other required compiler flags.
3030
#------------------------------------------------------------------------------
31-
Cflags: -I${includedir} @icu@ @avx2@ @avx512@ @shani@ @sse41@ @boost_CPPFLAGS@
31+
Cflags: -I${includedir} @avx2@ @avx512@ @shani@ @sse41@ @boost_CPPFLAGS@
3232

3333
# Lib directory, lib and any required that do not publish pkg-config.
3434
#------------------------------------------------------------------------------

0 commit comments

Comments
 (0)