Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
61 changes: 36 additions & 25 deletions protobuf.sh
Original file line number Diff line number Diff line change
@@ -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

Check warning on line 6 in protobuf.sh

View workflow job for this annotation

GitHub Actions / alidistlint

wrong indentation: expected 2 but found 1 [yl:indentation]
build_requires:
- autotools
- CMake

Check warning on line 8 in protobuf.sh

View workflow job for this annotation

GitHub Actions / alidistlint

wrong indentation: expected 2 but found 1 [yl:indentation]
- "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" <<EoF
#%Module1.0
proc ModulesHelp { } {
global version
puts stderr "ALICE Modulefile for $PKGNAME $PKGVERSION-@@PKGREVISION@$PKGHASH@@"
}
set version $PKGVERSION-@@PKGREVISION@$PKGHASH@@
module-whatis "ALICE Modulefile for $PKGNAME $PKGVERSION-@@PKGREVISION@$PKGHASH@@"
# Dependencies
module load BASE/1.0
# Our environment
setenv PROTOBUF_ROOT \$::env(BASEDIR)/$PKGNAME/\$version
prepend-path LD_LIBRARY_PATH \$::env(PROTOBUF_ROOT)/lib
$([[ ${ARCHITECTURE:0:3} == osx ]] && echo "prepend-path DYLD_LIBRARY_PATH \$::env(PROTOBUF_ROOT)/lib")
prepend-path PATH \$::env(PROTOBUF_ROOT)/bin
EoF
alibuild-generate-module --bin --lib > "$MODULEFILE"