diff options
-rwxr-xr-x | .SRCINFO | 25 | ||||
-rwxr-xr-x | PKGBUILD | 68 | ||||
-rw-r--r-- | cmake_add_pkgconfig.patch | 24 | ||||
-rw-r--r-- | snappy.pc.in | 10 |
4 files changed, 88 insertions, 39 deletions
@@ -1,22 +1,23 @@ -# Generated by mksrcinfo v8 -# Tue Mar 15 00:27:06 UTC 2016 pkgbase = snappy-git pkgdesc = A fast compressor/decompressor library - pkgver = 1.1.3.r8.g2b9152d - pkgrel = 2 - url = https://google.github.io/snappy/ - arch = any + pkgver = 1.1.10_r345.g27f34a5 + pkgrel = 1 + url = https://github.com/google/snappy + arch = x86_64 license = BSD checkdepends = zlib makedepends = git - depends = glibc - depends = gcc-libs + makedepends = cmake + makedepends = clang + makedepends = gtest + makedepends = benchmark provides = snappy conflicts = snappy - conflicts = snappy-git - replaces = snappy source = git+https://github.com/google/snappy.git - md5sums = SKIP + source = snappy.pc.in + source = cmake_add_pkgconfig.patch + sha256sums = SKIP + sha256sums = 134f06ca0584a1026538d0fb972fc141c008390ecae1806184b721eca1abbc75 + sha256sums = 2a204d7d35509ffc290d80c641fcb7e8488c67ca550aa1695493cff12c53156b pkgname = snappy-git - @@ -1,38 +1,54 @@ -# Maintainer: GreenRaccoon23 <GreenRaccoon a t gmail d o t com> +# Merged with official ABS snappy PKGBUILD by João, 2023/06/03 (all respective contributors apply herein) +# Maintainer: João Figueiredo & chaotic-aur <islandc0der@chaotic.cx> +# Contributor: GreenRaccoon23 <GreenRaccoon a t gmail d o t com> pkgname=snappy-git -pkgver=1.1.3.r8.g2b9152d -pkgrel=2 +pkgver=1.1.10_r345.g27f34a5 +pkgrel=1 pkgdesc='A fast compressor/decompressor library' -arch=('any') -url="https://google.github.io/snappy/" -license=('BSD') -depends=('glibc' 'gcc-libs') -replaces=("${pkgname%-*}") -conflicts=("${pkgname%-*}" "${pkgname}") -checkdepends=('zlib') -makedepends=('git') -provides=('snappy') -source=("git+https://github.com/google/${pkgname%-*}.git") -md5sums=('SKIP') +arch=($CARCH) +url="https://github.com/google/${pkgname%-git}" +license=(BSD) +checkdepends=(zlib) +makedepends=(git cmake clang gtest benchmark) +conflicts=(${pkgname%-git}) +provides=(${pkgname%-git}) +source=("git+$url.git" "snappy.pc.in" "cmake_add_pkgconfig.patch") +sha256sums=('SKIP' + '134f06ca0584a1026538d0fb972fc141c008390ecae1806184b721eca1abbc75' + '2a204d7d35509ffc290d80c641fcb7e8488c67ca550aa1695493cff12c53156b') pkgver() { - cd "$srcdir/${pkgname%-*}" - ( set -o pipefail - git describe --long --tags 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' || - printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" - ) + cd ${pkgname%-git} + _ver="$(git describe --tags | sed 's/^v//;s/-.*//')" + echo "${_ver}_r$(git rev-list --count HEAD).g$(git rev-parse --short HEAD)" } -build() { - cd "${pkgname%-*}" +prepare() { + cd "${pkgname%-git}" + cp ../snappy.pc.in . + patch -p1 < ../cmake_add_pkgconfig.patch # https://bugs.archlinux.org/task/71246 +# patch -p1 < ../system_gtest.patch # https://github.com/google/snappy/pull/132 +# patch -p1 < ../reenable_rtti.patch # https://bugs.archlinux.org/task/72058 +# patch -p1 < ../fix_inline.patch # https://github.com/google/snappy/pull/128 +} - ./autogen.sh +build() { + cd "${pkgname%-git}" # compile without assertions CXXFLAGS+=\ -DNDEBUG - ./configure --prefix=/usr + # export CXX=clang++ + + cmake \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=/usr/lib \ + -DBUILD_SHARED_LIBS=yes \ + -DSNAPPY_USE_BUNDLED_GTEST=OFF \ + -DSNAPPY_USE_BUNDLED_BENCHMARK_LIB=OFF \ + . + make } @@ -40,14 +56,12 @@ check() { # compile without assertions CXXFLAGS+=\ -DNDEBUG - make -C "${pkgname%-*}" check + make -C "${pkgname%-git}" test } package() { - cd "${pkgname%-*}" + cd "${pkgname%-git}" make DESTDIR="$pkgdir" install install -m644 -D COPYING "$pkgdir/usr/share/licenses/snappy/LICENSE" } - -# vim:set ts=2 sw=2 et:
\ No newline at end of file diff --git a/cmake_add_pkgconfig.patch b/cmake_add_pkgconfig.patch new file mode 100644 index 000000000000..6c3952bdf11e --- /dev/null +++ b/cmake_add_pkgconfig.patch @@ -0,0 +1,24 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -187,6 +187,12 @@ + "${PROJECT_BINARY_DIR}/config.h" + ) + ++configure_file( ++ "${CMAKE_CURRENT_SOURCE_DIR}/snappy.pc.in" ++ "${CMAKE_CURRENT_BINARY_DIR}/snappy.pc" ++ @ONLY ++) ++ + # We don't want to define HAVE_ macros in public headers. Instead, we use + # CMake's variable substitution with 0/1 variables, which will be seen by the + # preprocessor as constants. +@@ -395,4 +401,8 @@ + "${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" + ) ++ install( ++ FILES "${PROJECT_BINARY_DIR}/snappy.pc" ++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" ++ ) + endif(SNAPPY_INSTALL) diff --git a/snappy.pc.in b/snappy.pc.in new file mode 100644 index 000000000000..9c1a3478ee4b --- /dev/null +++ b/snappy.pc.in @@ -0,0 +1,10 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: snappy +Description: Fast compressor/decompressor library. +Version: @PROJECT_VERSION@ +Libs: -L${libdir} -lsnappy +Cflags: -I${includedir} |