-
Notifications
You must be signed in to change notification settings - Fork 181
Expand file tree
/
Copy pathabseil.sh
More file actions
51 lines (48 loc) · 1.69 KB
/
abseil.sh
File metadata and controls
51 lines (48 loc) · 1.69 KB
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
package: abseil
version: "%(tag_basename)s"
tag: "20240722.0"
requires:
- "GCC-Toolchain:(?!osx)"
license: Apache v2
build_requires:
- CMake
- ninja
- alibuild-recipe-tools
- ninja
source: https://github.com/abseil/abseil-cpp
#prefer_system: "osx"
#prefer_system_check: |
# printf '#include <absl/container/flat_hash_map.h>' | c++ -std=c++20 -I"$(brew --prefix abseil)/include" -c -xc++ - >/dev/null
# printf "alibuild_system_replace: abseil-brew-$(brew info --json abseil | jq -r '.[0].installed[0].version')"
# brew info --json abseil | jq -r '.[0].installed[0].version'
# exit 1
#prefer_system_replacement_specs:
# "abseil-brew.*":
# version: "%(key)s"
# env:
# ABSEIL_ROOT: $(brew --prefix abseil)
# ABSEIL_VERSION: $(brew info --json abseil | jq -r '.[0].installed[0].version')
# ABSEIL_REVISION: "1"
# prepend_path:
# PKG_CONFIG_PATH: "$ABSEIL_ROOT/lib/pkgconfig"
incremental_recipe: |
cmake --build . -- ${JOBS:+-j$JOBS} install
mkdir -p $INSTALLROOT/etc/modulefiles && rsync -a --delete etc/modulefiles/ $INSTALLROOT/etc/modulefiles
prepend_path:
PKG_CONFIG_PATH: "$ABSEIL_ROOT/lib/pkgconfig"
---
#!/bin/bash -e
mkdir -p $INSTALLROOT
cmake $SOURCEDIR \
-G Ninja \
${CXXSTD:+-DCMAKE_CXX_STANDARD=$CXXSTD} \
-DCMAKE_INSTALL_LIBDIR=lib \
-DBUILD_TESTING=OFF \
-DCMAKE_IGNORE_PATH="/opt/homebrew/include" \
-DCMAKE_INSTALL_PREFIX=$INSTALLROOT
cmake --build . -- ${JOBS:+-j$JOBS} install
# Modulefile
MODULEDIR="$INSTALLROOT/etc/modulefiles"
MODULEFILE="$MODULEDIR/$PKGNAME"
mkdir -p "$MODULEDIR"
alibuild-generate-module --lib --bin --cmake > "$MODULEFILE"