Skip to content

Commit

Permalink
maybe fix vendored version
Browse files Browse the repository at this point in the history
  • Loading branch information
paleolimbot committed Jun 18, 2024
1 parent 41a1e0e commit 76a094a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 27 deletions.
57 changes: 31 additions & 26 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -99,44 +99,49 @@ fi #AUTOBREW
# version will actually work; however, the version of abseil that included
# pkg-config files is about the same as the minimum version required here.
export PKG_CONFIG_PATH="${PKG_CONFIG_PATH}:`pwd`/tools/pkgconfig"

# Allow developers to set R_S2_ABSL_HOME in .Renviron to avoid building
# Abseil on every package rebuild. This can be built from this directory using
# tools/build_absl.sh path/to/dir (then R_S2_ABSL_HOME=path/to/dir in .Renviron)
if [ ! -z "${R_S2_ABSL_HOME}" ]; then
export PKG_CONFIG_PATH="{$R_S2_ABSL_HOME}/lib/pkgconfig:${PKG_CONFIG_PATH}"
fi

echo "** Using PKG_CONFIG_PATH=${PKG_CONFIG_PATH}"

if [ -z "${R_S2_ABSL_HOME}" ] && pkg-config absl_s2 --libs 2>/dev/null; then
if pkg-config absl_s2 --libs 2>/dev/null; then
echo "** Using abseil-cpp from pkg-config"

PKGCONFIG_CFLAGS=`pkg-config --cflags-only-I absl_s2`
PKGCONFIG_LIBS=`pkg-config --libs absl_s2`
PKG_CFLAGS="${PKGCONFIG_CFLAGS} ${PKG_CFLAGS}"
PKG_LIBS="${PKGCONFIG_LIBS} ${PKG_LIBS}"
else
# Allow developers to set R_S2_ABSL_HOME in .Renviron to avoid building
# Abseil on every package rebuild. This can be built from this directory using
# tools/build_absl.sh path/to/dir (then R_S2_ABSL_HOME=path/to/dir in .Renviron)
if [ -z "$R_S2_ABSL_HOME" ]; then
echo "** Building abseil-cpp using cmake"
CMAKE_INSTALL_PREFIX="`pwd`/tools/dist"
if tools/build_absl.sh "${CMAKE_INSTALL_PREFIX}"; then
echo "** Done!"
else
echo "** CMake build of Abseil failed"
echo "** Abseil can be installed with:"
echo "** - apt-get install libabsl-dev"
echo "** - dnf install abseil-cpp-devel"
echo "** - brew install abseil"
echo "** If a system install of Abseil is not possible, cmake is required to build"
echo "** the internal vendored copy."
exit 1
fi

# Clean up build directory
rm -rf tools/build

R_S2_ABSL_HOME="`pwd`/tools/dist"
echo "** Building abseil-cpp using cmake"
CMAKE_INSTALL_PREFIX="`pwd`/tools/dist"
if tools/build_absl.sh "${CMAKE_INSTALL_PREFIX}"; then
echo "** Done!"
else
echo "** CMake build of Abseil failed"
echo "** Abseil can be installed with:"
echo "** - apt-get install libabsl-dev"
echo "** - dnf install abseil-cpp-devel"
echo "** - brew install abseil"
echo "** If a system install of Abseil is not possible, cmake is required to build"
echo "** the internal vendored copy."
exit 1
fi

ABSL_LIBS="-labsl_flags_internal -labsl_flags_marshalling -labsl_flags_reflection -labsl_flags_private_handle_accessor -labsl_flags_commandlineflag -labsl_flags_commandlineflag_internal -labsl_flags_config -labsl_flags_program_name -labsl_cord -labsl_cordz_info -labsl_cord_internal -labsl_cordz_functions -labsl_cordz_handle -labsl_crc_cord_state -labsl_crc32c -labsl_crc_internal -labsl_crc_cpu_detect -labsl_raw_hash_set -labsl_hashtablez_sampler -labsl_exponential_biased -labsl_log_internal_check_op -labsl_log_internal_conditions -labsl_log_internal_message -labsl_examine_stack -labsl_log_internal_format -labsl_log_internal_proto -labsl_log_internal_nullguard -labsl_log_internal_log_sink_set -labsl_log_internal_globals -labsl_log_globals -labsl_hash -labsl_city -labsl_bad_variant_access -labsl_low_level_hash -labsl_vlog_config_internal -labsl_log_internal_fnmatch -labsl_bad_optional_access -labsl_log_sink -labsl_log_entry -labsl_synchronization -labsl_graphcycles_internal -labsl_kernel_timeout_internal -labsl_stacktrace -labsl_symbolize -labsl_malloc_internal -labsl_strerror -labsl_time -labsl_civil_time -labsl_time_zone -labsl_str_format_internal -labsl_strings -labsl_strings_internal -labsl_string_view -labsl_int128 -labsl_throw_delegate -labsl_demangle_internal -labsl_base -labsl_spinlock_wait -labsl_debugging_internal -labsl_raw_logging_internal -labsl_log_severity"
# Clean up build directory
rm -rf tools/build

R_S2_ABSL_HOME="`pwd`/tools/dist"
export PKG_CONFIG_PATH="${R_S2_ABSL_HOME}/lib/pkgconfig:${PKG_CONFIG_PATH}"
echo "** Using PKG_CONFIG_PATH=${PKG_CONFIG_PATH}"
PKGCONFIG_LIBS=`pkg-config --libs absl_s2`

PKG_CFLAGS="-I${R_S2_ABSL_HOME}/include ${PKG_CFLAGS}"
PKG_LIBS="-L${R_S2_ABSL_HOME}/lib ${ABSL_LIBS} ${PKG_LIBS}"
PKG_LIBS="${PKGCONFIG_LIBS} ${PKG_LIBS}"
fi

# From apache/arrow/r/configure:
Expand Down
2 changes: 1 addition & 1 deletion tools/pkgconfig/absl_s2.pc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ Name: absl_s2
Description: Abseil requirements
URL: https://github.com/r-spatial/s2
Version: 0.0
Requires: absl_base >= 20230802.0, absl_btree >= 20230802.0, absl_config >= 20230802.0, absl_core_headers >= 20230802.0, absl_dynamic_annotations >= 20230802.0, absl_endian >= 20230802.0, absl_fixed_array >= 20230802.0, absl_flags >= 20230802.0, absl_flat_hash_map >= 20230802.0, absl_flat_hash_set >= 20230802.0, absl_hash >= 20230802.0, absl_inlined_vector >= 20230802.0, absl_int128 >= 20230802.0, absl_log >= 20230802.0, absl_log_internal_check_impl >= 20230802.0, absl_log_severity >= 20230802.0, absl_memory >= 20230802.0, absl_span >= 20230802.0, absl_str_format >= 20230802.0, absl_strings >= 20230802.0, absl_type_traits >= 20230802.0, absl_utility >= 20230802.0, absl_demangle_internal >= 20230802.0, absl_debugging_internal >= 20230802.0
Requires: absl_base >= 20230802, absl_btree >= 20230802, absl_config >= 20230802, absl_core_headers >= 20230802, absl_dynamic_annotations >= 20230802, absl_endian >= 20230802, absl_fixed_array >= 20230802, absl_flags >= 20230802, absl_flat_hash_map >= 20230802, absl_flat_hash_set >= 20230802, absl_hash >= 20230802, absl_inlined_vector >= 20230802, absl_int128 >= 20230802, absl_log >= 20230802, absl_log_internal_check_impl >= 20230802, absl_log_severity >= 20230802, absl_memory >= 20230802, absl_span >= 20230802, absl_str_format >= 20230802, absl_strings >= 20230802, absl_type_traits >= 20230802, absl_utility >= 20230802, absl_demangle_internal >= 20230802, absl_debugging_internal >= 20230802
Libs:
Cflags:

0 comments on commit 76a094a

Please sign in to comment.