2023-04-11 23:54:09 +03:00
|
|
|
distributable:
|
2023-10-02 03:41:57 +03:00
|
|
|
url: https://github.com/facebook/folly/releases/download/{{version.tag}}/folly-{{version.tag}}.tar.gz
|
|
|
|
strip-components: 0
|
2023-04-11 23:54:09 +03:00
|
|
|
|
|
|
|
versions:
|
|
|
|
github: facebook/folly
|
|
|
|
|
|
|
|
dependencies:
|
|
|
|
boost.org: '*'
|
|
|
|
gflags.github.io: '*'
|
2024-02-27 00:19:59 +03:00
|
|
|
google.com/glog: '<0.7'
|
2023-04-11 23:54:09 +03:00
|
|
|
libevent.org: '*'
|
|
|
|
lz4.org: 1
|
|
|
|
openssl.org: ^1.1
|
|
|
|
tukaani.org/xz: 5
|
|
|
|
facebook.com/zstd: 1
|
|
|
|
gnu.org/coreutils: 9
|
|
|
|
google.github.io/snappy: '*'
|
|
|
|
google.com/double-conversion: ^3
|
2024-01-02 18:33:59 +03:00
|
|
|
google.com/googletest: ^1
|
2024-05-23 02:52:33 +03:00
|
|
|
fmt.dev: ^10
|
2023-12-19 00:31:57 +03:00
|
|
|
zlib.net: ^1
|
2023-09-08 04:24:33 +03:00
|
|
|
darwin:
|
|
|
|
sourceware.org/bzip2: '*'
|
2024-05-16 00:52:32 +03:00
|
|
|
linux:
|
2024-06-04 23:13:48 +03:00
|
|
|
libcxx.llvm.org: ^18 # libunwind, since 2024.5.13.0
|
2024-05-16 00:52:32 +03:00
|
|
|
jemalloc.net: ^5 # since 2024.5.13.0
|
|
|
|
elfutils.org: ^0 # for dwarf.h, since 2024.5.13.0
|
2023-04-11 23:54:09 +03:00
|
|
|
|
|
|
|
build:
|
|
|
|
dependencies:
|
|
|
|
cmake.org: ^3.0.2
|
|
|
|
freedesktop.org/pkg-config: ^0.29
|
2023-08-14 22:06:41 +03:00
|
|
|
script:
|
2023-10-03 00:11:43 +03:00
|
|
|
- cmake $ARGS -DBUILD_SHARED_LIBS=ON -S . -B shared
|
2023-09-08 04:24:33 +03:00
|
|
|
- cmake --build shared
|
|
|
|
- cmake --install shared
|
|
|
|
|
2023-10-03 00:11:43 +03:00
|
|
|
- cmake $ARGS -DBUILD_SHARED_LIBS=OFF -S . -B static
|
2023-09-08 04:24:33 +03:00
|
|
|
- cmake --build static
|
2023-10-03 00:11:43 +03:00
|
|
|
|
|
|
|
- run: cp $SRCROOT/static/libfolly.a libfollybenchmark.a
|
2023-09-08 04:24:33 +03:00
|
|
|
working-directory: ${{prefix}}/static/folly
|
2023-05-02 05:50:30 +03:00
|
|
|
|
2023-08-14 22:06:41 +03:00
|
|
|
- run: |
|
|
|
|
sed -E -i.bak \
|
2023-10-02 04:27:27 +03:00
|
|
|
-e "s:{{pkgx.prefix}}:\$\{_IMPORT_PREFIX\}/../../..:g" \
|
2023-08-14 22:06:41 +03:00
|
|
|
-e '/^ INTERFACE_INCLUDE_DIRECTORIES/ s|/v([0-9]+)(\.[0-9]+)*[a-z]?/include|/v\1/include|g' \
|
2023-08-21 02:20:03 +03:00
|
|
|
-e '/^ INTERFACE_LINK_LIBRARIES/ s|/v([0-9]+)(\.[0-9]+)*[a-z]?/lib|/v\1/lib|g' \
|
2023-08-14 22:06:41 +03:00
|
|
|
folly-targets.cmake
|
|
|
|
rm folly-targets.cmake.bak
|
|
|
|
working-directory: ${{prefix}}/lib/cmake/folly
|
2023-05-02 05:50:30 +03:00
|
|
|
|
2023-08-14 22:06:41 +03:00
|
|
|
- run: |
|
|
|
|
sed -i.bak -e 's/-I[^ ]* *//g' libfolly.pc
|
|
|
|
rm libfolly.pc.bak
|
|
|
|
working-directory: ${{prefix}}/lib/pkgconfig
|
2023-09-11 17:40:54 +03:00
|
|
|
|
|
|
|
# folly has libs that end up with name @rpath/libfolly.{{version}}.dylib (offset 24)
|
|
|
|
# so we need to add @loader_path to the rpath
|
|
|
|
- run: |
|
|
|
|
for LIB in libfolly*.*.*.*-dev.dylib; do
|
|
|
|
install_name_tool -add_rpath @loader_path $LIB
|
|
|
|
done
|
|
|
|
working-directory: ${{prefix}}/lib
|
|
|
|
if: darwin
|
2023-04-11 23:54:09 +03:00
|
|
|
env:
|
|
|
|
ARGS:
|
|
|
|
- -DCMAKE_INSTALL_PREFIX={{prefix}}
|
|
|
|
- -DCMAKE_BUILD_TYPE=Release
|
|
|
|
- -DBUILD_TESTING=OFF
|
|
|
|
- -DCMAKE_VERBOSE_MAKEFILE=ON
|
2024-05-16 00:52:32 +03:00
|
|
|
- -DFOLLY_USE_JEMALLOC=OFF
|
2023-05-02 05:50:30 +03:00
|
|
|
linux/aarch64:
|
|
|
|
ARGS:
|
|
|
|
- -DCMAKE_C_FLAGS=-fPIC
|
|
|
|
- -DCMAKE_CXX_FLAGS=-fPIC
|
2024-05-16 00:52:32 +03:00
|
|
|
- -DCMAKE_EXE_LINKER_FLAGS=-Wl,-pie,-lrt,-lunwind
|
|
|
|
linux/x86-64:
|
|
|
|
ARGS:
|
|
|
|
- -DCMAKE_EXE_LINKER_FLAGS=-Wl,-pie,-lrt,-lunwind
|
2023-04-11 23:54:09 +03:00
|
|
|
|
|
|
|
test:
|
|
|
|
fixture: |
|
|
|
|
#include <folly/FBVector.h>
|
|
|
|
int main() {
|
|
|
|
folly::fbvector<int> numbers({0, 1, 2, 3});
|
|
|
|
numbers.reserve(10);
|
|
|
|
for (int i = 4; i < 10; i++) {
|
|
|
|
numbers.push_back(i * 2);
|
|
|
|
}
|
|
|
|
assert(numbers[6] == 12);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
script: |
|
|
|
|
mv $FIXTURE b.cc
|
2023-08-14 22:26:55 +03:00
|
|
|
c++ -std=c++17 b.cc -lfolly -ldl -lfmt -lglog
|
2023-04-11 23:54:09 +03:00
|
|
|
./a.out
|