forked from alisw/alidist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
grpc.sh
60 lines (56 loc) · 1.95 KB
/
grpc.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package: grpc
version: "%(tag_basename)s"
tag: v1.19.1
requires:
- protobuf
- c-ares
- OpenSSL
- "GCC-Toolchain:(?!osx)"
build_requires:
- CMake
source: https://github.com/grpc/grpc
prefer_system: "(?!slc5)"
prefer_system_check: which grpc_cpp_plugin
incremental_recipe: |
make ${JOBS:+-j$JOBS} install
mkdir -p $INSTALLROOT/etc/modulefiles && rsync -a --delete etc/modulefiles/ $INSTALLROOT/etc/modulefiles
---
#!/bin/bash -e
pushd $SOURCEDIR
git checkout "$GIT_TAG"
git submodule update --init
popd
cmake $SOURCEDIR \
-DCMAKE_INSTALL_PREFIX=$INSTALLROOT \
-DgRPC_PROTOBUF_PACKAGE_TYPE="CONFIG" \
-DgRPC_BUILD_TESTS=OFF \
-DBUILD_SHARED_LIBS=ON \
-DgRPC_SSL_PROVIDER=package \
-DgRPC_ZLIB_PROVIDER=package \
-DgRPC_GFLAGS_PROVIDER=packet \
-DgRPC_PROTOBUF_PROVIDER=package \
-DgRPC_BENCHMARK_PROVIDER=packet \
-DgRPC_CARES_PROVIDER=package
make ${JOBS:+-j$JOBS} install
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 \\
${GCC_TOOLCHAIN_VERSION:+GCC-Toolchain/$GCC_TOOLCHAIN_VERSION-$GCC_TOOLCHAIN_REVISION} \\
${C_ARES_VERSION:+c-ares/$C_ARES_VERSION-$C_ARES_REVISION} \\
${PROTOBUF_VERSION:+protobuf/$PROTOBUF_VERSION-$PROTOBUF_REVISION}
# Our environment
set GRPC_ROOT \$::env(BASEDIR)/$PKGNAME/\$version
prepend-path PATH \$GRPC_ROOT/bin
prepend-path LD_LIBRARY_PATH \$GRPC_ROOT/lib
$([[ ${ARCHITECTURE:0:3} == osx ]] && echo "prepend-path DYLD_LIBRARY_PATH \$GRPC_ROOT/lib")
EoF