mirror of
https://github.com/ivabus/pantry
synced 2024-11-29 11:45:07 +03:00
add snappy (#460)
Co-authored-by: Jacob Heider <jacob@tea.xyz> Co-authored-by: Max Howell <mxcl@me.com>
This commit is contained in:
parent
a69051b0b9
commit
312954076e
2 changed files with 72 additions and 0 deletions
23
projects/google.github.io/snappy/CMakeLists.txt.patch
Normal file
23
projects/google.github.io/snappy/CMakeLists.txt.patch
Normal file
|
@ -0,0 +1,23 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index c3062e2..0ed2c1c 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -61,18 +61,6 @@ else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
|
||||
endif(NOT CMAKE_CXX_FLAGS MATCHES "-Wall")
|
||||
|
||||
- # Use -Wextra for clang and gcc.
|
||||
- if(NOT CMAKE_CXX_FLAGS MATCHES "-Wextra")
|
||||
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
|
||||
- endif(NOT CMAKE_CXX_FLAGS MATCHES "-Wextra")
|
||||
-
|
||||
- # Use -Werror for clang only.
|
||||
- if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
- if(NOT CMAKE_CXX_FLAGS MATCHES "-Werror")
|
||||
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
||||
- endif(NOT CMAKE_CXX_FLAGS MATCHES "-Werror")
|
||||
- endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
-
|
||||
# Disable C++ exceptions.
|
||||
string(REGEX REPLACE "-fexceptions" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
|
49
projects/google.github.io/snappy/package.yml
Normal file
49
projects/google.github.io/snappy/package.yml
Normal file
|
@ -0,0 +1,49 @@
|
|||
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
|
||||
cmake . $ARGS
|
||||
make
|
||||
make install
|
||||
env:
|
||||
ARGS:
|
||||
- -DCMAKE_INSTALL_PREFIX={{prefix}}
|
||||
- -DCMAKE_BUILD_TYPE=Release
|
||||
- -DSNAPPY_BUILD_TESTS=OFF
|
||||
- -DSNAPPY_BUILD_BENCHMARKS=OFF
|
||||
- -DBUILD_SHARED_LIBS=ON
|
||||
|
||||
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
|
Loading…
Reference in a new issue