diff --git a/projects/facebook.com/folly/package.yml b/projects/facebook.com/folly/package.yml index a9ed39fb..b5bb5612 100644 --- a/projects/facebook.com/folly/package.yml +++ b/projects/facebook.com/folly/package.yml @@ -26,23 +26,28 @@ build: dependencies: cmake.org: ^3.0.2 freedesktop.org/pkg-config: ^0.29 - working-directory: - /tmp/xyz.tea.folly - # ^^ facebook use a shitty custom regex function to remove sources that - # shouldn’t be compiled from the library target. They start with *all sources* - # our default build directory has a `+` in it which breaks facebook’s - # piss awful code. - #TODO don’t use exotic characters in our build directories script: - - test -d xyz.tea.srcs && rm -rf xyz.tea.srcs - - mv $SRCROOT xyz.tea.srcs - - cmake $ARGS -DBUILD_SHARED_LIBS=ON -S xyz.tea.srcs -B shared + # folly uses the path to build as part of a regex, but out paths have "+"s in them. + # don't mess up the intentional newline + - run: | + sed -i.bak -E -f $PROP CMakeLists.txt + rm CMakeLists.txt.bak + prop: | + /^REMOVE_MATCHES_FROM_LISTS\(files hfiles/ { + i\\ + string(REPLACE "+" "\\\\\\\\+" ESCAPED_FOLLY_DIR "\\\${FOLLY_DIR}") + } + + s/\^\\\$\{FOLLY_DIR\}/^\\\$\{ESCAPED_FOLLY_DIR\}/g + + - cmake $ARGS -DBUILD_SHARED_LIBS=ON -S . -B shared - cmake --build shared - cmake --install shared - - cmake $ARGS -DBUILD_SHARED_LIBS=OFF -S xyz.tea.srcs -B static + - cmake $ARGS -DBUILD_SHARED_LIBS=OFF -S . -B static - cmake --build static - - run: cp /tmp/xyz.tea.folly/static/libfolly.a libfollybenchmark.a + + - run: cp $SRCROOT/static/libfolly.a libfollybenchmark.a working-directory: ${{prefix}}/static/folly - run: |