mirror of
https://github.com/ivabus/pantry
synced 2024-11-10 10:35:17 +03:00
572fa511cb
* +wangle * fix cmake files * [wip] Add test * whole bunch of fixes * Darwin folly deps * Kills can fail * skip cleanup (breaks testing) * this is thorny * nevermind --------- Co-authored-by: Jacob Heider <jacob@tea.xyz>
55 lines
1.4 KiB
YAML
55 lines
1.4 KiB
YAML
distributable:
|
|
url: https://github.com/google/snappy/archive/refs/tags/{{version}}.tar.gz
|
|
strip-components: 1
|
|
|
|
versions:
|
|
github: google/snappy/tags
|
|
|
|
build:
|
|
dependencies:
|
|
tea.xyz/gx/cc: c99
|
|
tea.xyz/gx/make: '*'
|
|
freedesktop.org/pkg-config: '*'
|
|
cmake.org: '*'
|
|
gnu.org/patch: '*'
|
|
script:
|
|
# disable -Werror (because there are warnings lol)
|
|
- patch -p1 <props/CMakeLists.txt.patch
|
|
# disable no-rtti, since it messes up folly
|
|
- run: |
|
|
sed -i.bak -e '/# Disable RTTI./{N;N;d;}' CMakeLists.txt
|
|
rm CMakeLists.txt.bak
|
|
- cmake . $ARGS
|
|
- make install
|
|
- make clean
|
|
- cmake . -DBUILD_SHARED_LIBS=ON $ARGS
|
|
- make install
|
|
env:
|
|
ARGS:
|
|
- -DCMAKE_INSTALL_PREFIX={{prefix}}
|
|
- -DCMAKE_BUILD_TYPE=Release
|
|
- -DSNAPPY_BUILD_TESTS=OFF
|
|
- -DSNAPPY_BUILD_BENCHMARKS=OFF
|
|
|
|
test:
|
|
dependencies:
|
|
tea.xyz/gx/cc: c99
|
|
fixture: |
|
|
#include <assert.h>
|
|
#include <snappy.h>
|
|
#include <string>
|
|
using namespace std;
|
|
using namespace snappy;
|
|
int main() {
|
|
string source = "Hello World!";
|
|
string compressed, decompressed;
|
|
Compress(source.data(), source.size(), &compressed);
|
|
Uncompress(compressed.data(), compressed.size(), &decompressed);
|
|
assert(source == decompressed);
|
|
return 0;
|
|
}
|
|
script: |
|
|
mv $FIXTURE fixture.cpp
|
|
c++ fixture.cpp -lsnappy -std=c++11
|
|
./a.out
|