From ddb754b03b4821b97393aef21a8034991d854475 Mon Sep 17 00:00:00 2001 From: Joe DeCapo <679017+JrGoodle@users.noreply.github.com> Date: Mon, 1 May 2023 21:50:30 -0500 Subject: [PATCH] +fizz (#1748) * +fizz * [wip] try PIC/pie * Add PIC/pie to fmt.dev --- projects/facebook.com/folly/package.yml | 12 ++++ projects/fmt.dev/package.yml | 11 +++- .../facebookincubator/fizz/package.yml | 63 +++++++++++++++++++ 3 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 projects/github.com/facebookincubator/fizz/package.yml diff --git a/projects/facebook.com/folly/package.yml b/projects/facebook.com/folly/package.yml index 7ef70db5..270d374f 100644 --- a/projects/facebook.com/folly/package.yml +++ b/projects/facebook.com/folly/package.yml @@ -36,12 +36,24 @@ build: mv $SRCROOT xyz.tea.srcs cmake $ARGS -S xyz.tea.srcs -B . make --jobs {{hw.concurrency}} install + + sed -i.bak "s:$TEA_PREFIX:\$\{_IMPORT_PREFIX\}/../../..:g" "{{prefix}}"/lib/cmake/folly/folly-targets.cmake + rm "{{prefix}}"/lib/cmake/folly/folly-targets.cmake.bak + + cd {{prefix}}/lib/pkgconfig + sed -i.bak -e 's/-I[^ ]* *//g' ./libfolly.pc + rm *.bak env: ARGS: - -DCMAKE_INSTALL_PREFIX={{prefix}} - -DCMAKE_BUILD_TYPE=Release - -DBUILD_TESTING=OFF - -DCMAKE_VERBOSE_MAKEFILE=ON + linux/aarch64: + ARGS: + - -DCMAKE_C_FLAGS=-fPIC + - -DCMAKE_CXX_FLAGS=-fPIC + - -DCMAKE_EXE_LINKER_FLAGS=-pie test: dependencies: diff --git a/projects/fmt.dev/package.yml b/projects/fmt.dev/package.yml index 63cbbada..17d2504d 100644 --- a/projects/fmt.dev/package.yml +++ b/projects/fmt.dev/package.yml @@ -13,8 +13,17 @@ build: working-directory: build script: | - cmake .. -DCMAKE_INSTALL_PREFIX="{{prefix}}" -DCMAKE_BUILD_TYPE=Release + cmake .. $ARGS make --jobs {{ hw.concurrency }} install + env: + ARGS: + - -DCMAKE_INSTALL_PREFIX="{{prefix}}" + - -DCMAKE_BUILD_TYPE=Release + linux/aarch64: + ARGS: + - -DCMAKE_C_FLAGS=-fPIC + - -DCMAKE_CXX_FLAGS=-fPIC + - -DCMAKE_EXE_LINKER_FLAGS=-pie test: dependencies: diff --git a/projects/github.com/facebookincubator/fizz/package.yml b/projects/github.com/facebookincubator/fizz/package.yml new file mode 100644 index 00000000..79d3202c --- /dev/null +++ b/projects/github.com/facebookincubator/fizz/package.yml @@ -0,0 +1,63 @@ +distributable: + url: https://github.com/facebookincubator/fizz/archive/refs/tags/v{{version.raw}}.tar.gz + strip-components: 1 + +versions: + github: facebookincubator/fizz/releases/tags + strip: /^v/ + +dependencies: + boost.org: '*' + google.com/double-conversion: ^3 + fmt.dev: ^9 + facebook.com/folly: '*' + gflags.github.io: '*' + google.com/glog: '*' + libevent.org: '*' + libsodium.org: '*' + lz4.org: 1 + openssl.org: ^1.1 + google.github.io/snappy: '*' + facebook.com/zstd: 1 + +provides: + - bin/fizz + +build: + dependencies: + tea.xyz/gx/cc: c99 + cmake.org: ^3 + ninja-build.org: ^1 + script: | + cmake -S fizz -B build $ARGS + cmake --build build + cmake --install build + env: + ARGS: + - -GNinja + - -DCMAKE_BUILD_TYPE=Release + - -DCMAKE_INSTALL_PREFIX="{{prefix}}" + - -DBUILD_TESTS=OFF + - -DBUILD_SHARED_LIBS=ON + - -DCMAKE_INSTALL_RPATH="{{prefix}}" + linux/aarch64: + ARGS: + - -DCMAKE_C_FLAGS=-fPIC + - -DCMAKE_CXX_FLAGS=-fPIC + - -DCMAKE_EXE_LINKER_FLAGS=-pie + +test: + dependencies: + tea.xyz/gx/cc: c99 + fixture: | + #include + #include + + int main() { + auto context = fizz::client::FizzClientContext(); + std::cout << toString(context.getSupportedVersions()[0]) << std::endl; + } + script: | + mv $FIXTURE test.cpp + c++ -std=c++14 test.cpp -lfizz -lfolly -lgflags -lglog -levent -lsodium -lcrypto -lssl -o fixture + test $(./fixture) = "TLS"