mirror of
https://github.com/ivabus/pantry
synced 2024-11-22 16:35:07 +03:00
+re2
This commit is contained in:
parent
ddb754b03b
commit
0e2e62d9e7
1 changed files with 46 additions and 0 deletions
46
projects/github.com/google/re2/package.yml
Normal file
46
projects/github.com/google/re2/package.yml
Normal file
|
@ -0,0 +1,46 @@
|
|||
distributable:
|
||||
url: https://github.com/google/re2/archive/refs/tags/{{version.major}}-0{{version.minor}}-0{{version.patch}}.tar.gz
|
||||
strip-components: 1
|
||||
|
||||
versions:
|
||||
- 2023.3.1 # FIXME: the versions are "yyyy-mm-dd" but no idea how I can parse this without regex
|
||||
|
||||
build:
|
||||
dependencies:
|
||||
cmake.org: '*'
|
||||
tea.xyz/gx/cc: c99
|
||||
tea.xyz/gx/make: '*'
|
||||
script: |
|
||||
# Run this for pkg-config files
|
||||
make common-install prefix={{prefix}}
|
||||
|
||||
# Build and install static library
|
||||
cmake -B build-static $ARGS
|
||||
make --jobs={{ hw.concurrency }} -C build-static
|
||||
make -C build-static install
|
||||
|
||||
# Build and install shared library
|
||||
cmake -B build-shared -DBUILD_SHARED_LIBS=ON $ARGS
|
||||
make --jobs={{ hw.concurrency }} -C build-shared
|
||||
make -C build-shared install
|
||||
env:
|
||||
ARGS:
|
||||
- -DCMAKE_BUILD_TYPE=Release
|
||||
- -DCMAKE_INSTALL_PREFIX={{prefix}}
|
||||
- -DRE2_BUILD_TESTING=OFF
|
||||
|
||||
test:
|
||||
dependencies:
|
||||
tea.xyz/gx/cc: c99
|
||||
fixture: |
|
||||
#include <re2/re2.h>
|
||||
#include <assert.h>
|
||||
int main() {
|
||||
assert(!RE2::FullMatch("hello", "e"));
|
||||
assert(RE2::PartialMatch("hello", "e"));
|
||||
return 0;
|
||||
}
|
||||
script: |
|
||||
mv $FIXTURE test.cpp
|
||||
c++ -std=c++11 test.cpp -lre2 -o test
|
||||
./test
|
Loading…
Reference in a new issue