pantry/projects/github.com/google/re2/package.yml

57 lines
1.4 KiB
YAML
Raw Normal View History

2023-05-02 04:19:30 +03:00
distributable:
2024-06-09 13:23:55 +03:00
url: https://github.com/google/re2/archive/refs/tags/{{version.tag}}.tar.gz
2023-05-02 04:19:30 +03:00
strip-components: 1
versions:
2024-06-09 13:23:55 +03:00
github: google/re2
dependencies:
abseil.io: ^20240116
2023-05-02 04:19:30 +03:00
build:
dependencies:
cmake.org: '*'
2024-06-09 13:23:55 +03:00
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
2023-05-02 04:19:30 +03:00
# Run this for pkg-config files
2024-06-09 13:23:55 +03:00
- make common-install prefix={{prefix}}
2023-05-02 04:19:30 +03:00
# Build and install static library
2024-06-09 13:23:55 +03:00
- cmake -B build-static $ARGS
- make --jobs={{ hw.concurrency }} -C build-static
- make -C build-static install
2023-05-02 04:19:30 +03:00
# Build and install shared library
2024-06-09 13:23:55 +03:00
- cmake -B build-shared -DBUILD_SHARED_LIBS=ON $ARGS
- make --jobs={{ hw.concurrency }} -C build-shared
- make -C build-shared install
2023-05-02 04:19:30 +03:00
env:
ARGS:
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX={{prefix}}
- -DRE2_BUILD_TESTING=OFF
test:
2024-06-09 13:23:55 +03:00
dependencies:
linux:
gnu.org/gcc: '*' # version.h
script:
- run: c++ -std=c++20 $FIXTURE -lre2 -o test
fixture:
extname: cpp
content: |
#include <re2/re2.h>
#include <assert.h>
int main() {
assert(!RE2::FullMatch("hello", "e"));
assert(RE2::PartialMatch("hello", "e"));
return 0;
}
- ./test