fix(re2.versions)

This commit is contained in:
Jacob Heider 2024-06-09 06:23:55 -04:00 committed by Jacob Heider
parent a83a5d6a6a
commit 2c05904bf0

View file

@ -1,26 +1,36 @@
distributable: distributable:
url: https://github.com/google/re2/archive/refs/tags/{{version.major}}-0{{version.minor}}-0{{version.patch}}.tar.gz url: https://github.com/google/re2/archive/refs/tags/{{version.tag}}.tar.gz
strip-components: 1 strip-components: 1
versions: versions:
- 2023.3.1 # FIXME: the versions are "yyyy-mm-dd" but no idea how I can parse this without regex github: google/re2
dependencies:
abseil.io: ^20240116
build: build:
dependencies: dependencies:
cmake.org: '*' cmake.org: '*'
script: | script:
# escaping. sigh
- sed -i
-e 's/\$(includedir)#/$(subst +brewing,,$(includedir))#/'
-e 's/\$(libdir)#/$(subst +brewing,,\$(libdir))#/'
-e "s/sed -i ''/sed -i/g"
Makefile
# Run this for pkg-config files # Run this for pkg-config files
make common-install prefix={{prefix}} - make common-install prefix={{prefix}}
# Build and install static library # Build and install static library
cmake -B build-static $ARGS - cmake -B build-static $ARGS
make --jobs={{ hw.concurrency }} -C build-static - make --jobs={{ hw.concurrency }} -C build-static
make -C build-static install - make -C build-static install
# Build and install shared library # Build and install shared library
cmake -B build-shared -DBUILD_SHARED_LIBS=ON $ARGS - cmake -B build-shared -DBUILD_SHARED_LIBS=ON $ARGS
make --jobs={{ hw.concurrency }} -C build-shared - make --jobs={{ hw.concurrency }} -C build-shared
make -C build-shared install - make -C build-shared install
env: env:
ARGS: ARGS:
- -DCMAKE_BUILD_TYPE=Release - -DCMAKE_BUILD_TYPE=Release
@ -28,15 +38,19 @@ build:
- -DRE2_BUILD_TESTING=OFF - -DRE2_BUILD_TESTING=OFF
test: test:
fixture: | dependencies:
#include <re2/re2.h> linux:
#include <assert.h> gnu.org/gcc: '*' # version.h
int main() { script:
assert(!RE2::FullMatch("hello", "e")); - run: c++ -std=c++20 $FIXTURE -lre2 -o test
assert(RE2::PartialMatch("hello", "e")); fixture:
return 0; extname: cpp
} content: |
script: | #include <re2/re2.h>
mv $FIXTURE test.cpp #include <assert.h>
c++ -std=c++11 test.cpp -lre2 -o test int main() {
./test assert(!RE2::FullMatch("hello", "e"));
assert(RE2::PartialMatch("hello", "e"));
return 0;
}
- ./test