diff --git a/CHANGELOG.md b/CHANGELOG.md index 6be51764..50f264ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ Until May 2022 (inclusive) no changelog was kept. We might try to reconstruct it ### Changed +* protobuf: Update to v33.5, migrate from autotools to CMake build * python: Require at least 3.12.12 in prefer_system_check * ROOT: Update to 6.36.08 * defaults-actstracking: Removed all overrides unrelated to ACTS or C++20. diff --git a/protobuf.sh b/protobuf.sh index 50ca00e9..42ba1bd8 100644 --- a/protobuf.sh +++ b/protobuf.sh @@ -1,39 +1,50 @@ package: protobuf version: "%(tag_basename)s" -tag: "v3.12.3" -source: https://github.com/google/protobuf +tag: "v33.5" +source: https://github.com/protocolbuffers/protobuf +requires: + - abseil build_requires: - - autotools + - CMake - "GCC-Toolchain:(?!osx)" + - alibuild-recipe-tools + - ninja prefer_system: "(?!slc5)" prefer_system_check: | which protoc || { echo "protoc missing"; exit 1; } printf "#include \"google/protobuf/any.h\"\nint main(){}" | c++ -I$(brew --prefix protobuf)/include -Wno-deprecated-declarations -xc++ - -o /dev/null +prepend_path: + PKG_CONFIG_PATH: "$PROTOBUF_ROOT/lib/pkgconfig" + CMAKE_PREFIX_PATH: "$PROTOBUF_ROOT/lib/cmake" --- +#!/bin/bash -e -rsync -av --delete --exclude="**/.git" $SOURCEDIR/ . -autoreconf -ivf -./configure --prefix="$INSTALLROOT" -make ${JOBS:+-j $JOBS} -make install +if [ -f $SOURCEDIR/cmake/CMakeLists.txt ]; then + ALIBUILD_CMAKE_SOURCE_DIR=$SOURCEDIR/cmake +else + ALIBUILD_CMAKE_SOURCE_DIR=$SOURCEDIR +fi -#ModuleFile +cmake -S "$ALIBUILD_CMAKE_SOURCE_DIR" \ + -G Ninja \ + -DCMAKE_INSTALL_PREFIX="$INSTALLROOT" \ + -Dprotobuf_BUILD_TESTS=NO \ + -Dprotobuf_MODULE_COMPATIBLE=YES \ + -Dprotobuf_BUILD_SHARED_LIBS=OFF \ + -Dprotobuf_ABSL_PROVIDER=package \ + ${ABSEIL_ROOT:+-Dabsl_DIR=$ABSEIL_ROOT/lib/cmake/absl} \ + -DCMAKE_INSTALL_LIBDIR=lib + +cmake --build . -- ${JOBS:+-j$JOBS} install + +# Fix header include issue +if [ -f "$INSTALLROOT/include/google/protobuf/io/coded_stream.h" ]; then + sed -i.bak 's|absl/log/absl_log.h|absl/log/vlog_is_on.h|' $INSTALLROOT/include/google/protobuf/io/coded_stream.h + rm -f $INSTALLROOT/include/google/protobuf/io/coded_stream.h.bak +fi + +# Modulefile MODULEDIR="$INSTALLROOT/etc/modulefiles" MODULEFILE="$MODULEDIR/$PKGNAME" mkdir -p "$MODULEDIR" -cat > "$MODULEFILE" < "$MODULEFILE"