# Contributor: Natanael Copa # Maintainer: Natanael Copa pkgname=snappy pkgver=1.1.10 pkgrel=2 _googletest_commit=18f8200e3079b0e54fa00cb7ac55d4c39dcf6da6 pkgdesc="Fast compression and decompression library" url="https://github.com/google/snappy" arch="all" license="BSD-3-Clause" makedepends="cmake samurai" subpackages="$pkgname-dbg $pkgname-static $pkgname-dev $pkgname-doc" source="$pkgname-$pkgver.tar.gz::https://github.com/google/snappy/archive/$pkgver.tar.gz googletest-$_googletest_commit.tar.gz::https://github.com/google/googletest/archive/$_googletest_commit.tar.gz cmakelists.patch no-include-gtest.patch rtti.patch " prepare() { rmdir third_party/googletest ln -s "$srcdir"/googletest-$_googletest_commit third_party/googletest default_prepare } build() { if [ "$CBUILD" != "$CHOST" ]; then CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux" fi CFLAGS="$CFLAGS -O2 -flto=auto -ffat-lto-objects -DNDEBUG" \ CXXFLAGS="$CXXFLAGS -O2 -flto=auto -ffat-lto-objects -DNDEBUG" \ cmake -B build -G Ninja \ -DCMAKE_BUILD_TYPE=None \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_LIBDIR=/usr/lib \ -DBUILD_SHARED_LIBS=ON \ -DBUILD_STATIC_LIBS=ON \ -DSNAPPY_BUILD_BENCHMARKS=OFF \ -DSNAPPY_BUILD_TESTS=ON \ $CMAKE_CROSSOPTS cmake --build build } check() { cd build CTEST_OUTPUT_ON_FAILURE=TRUE ctest } package() { DESTDIR="$pkgdir" cmake --install build local file; for file in AUTHORS CONTRIBUTING.md COPYING NEWS README.md \ format_description.txt framing_format.txt; do install -m644 -D $file "$pkgdir"/usr/share/doc/$pkgname/$file done } sha512sums=" 3578597f1d4ec09104ce0296b825b013590351230dfe56c635081fd282ce7a13a34caf2c283ac77bd24065e2d27af6db068d1f84b98cec2fd39a0e37a0d77070 snappy-1.1.10.tar.gz f77c747218dc5ae4858b2b4c58a401eb895493adf470a331d6bac32cd20542533ff3a77081db653bbc18b9f55f6864be04e1739ef4afaed7db39d7c698abf880 googletest-18f8200e3079b0e54fa00cb7ac55d4c39dcf6da6.tar.gz 8a891edf2f0b267b05c67d54945f11d723b058ddab5ac3f27b4f00678759d4a52b617d0c5724c7170a285eb068ffa4ffbbc5a9efa250964979b3969fc8730eb3 cmakelists.patch 1e9ad24b9ab0adf82922cd7042cad7dd1709c147812b775870a8ef67f47ddc81ee3fe697a04a4cc54f78d17e74c45d2770976be10468a7df32e5205f50ca8e93 no-include-gtest.patch ec6a83d5e58deffd23f4b47e899b6645145548a823c2e1542812f05848a844839580a1b27aefa9beadba6b43f472abc38c42ea379db91da938837f4e69ae9cc0 rtti.patch "