blob: acfd898b70d207e4a6c1e6777bb18a84507fcde2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
# Maintainer: Patrick Northon <northon_patrick3@yahoo.ca>
# Contributor: Andrew Sun <adsun701 at gmail dot com>
_pkgname=snappy
pkgname=mingw-w64-${_pkgname}
pkgver=1.2.1
pkgrel=1
pkgdesc='A fast compressor/decompressor library (mingw-w64)'
arch=('any')
url="https://google.github.io/snappy/"
license=('BSD')
depends=('mingw-w64-crt' 'mingw-w64-winpthreads')
makedepends=('mingw-w64-cmake' 'git')
checkdepends=('mingw-w64-wine' 'mingw-w64-zlib' 'mingw-w64-lzo' 'mingw-w64-lz4')
options=('!strip' '!buildflags' 'staticlibs')
source=(
"git+https://github.com/google/snappy.git#tag=${pkgver}"
'git+https://github.com/google/googletest.git')
sha256sums=('1fe95cdb4e11b0bce890d162587592ae8910733e66510d28fd7644bf16095895'
'SKIP')
_srcdir="${_pkgname}"
_architectures='i686-w64-mingw32 x86_64-w64-mingw32'
_flags=( -Wno-dev -DCMAKE_BUILD_TYPE='Release'
-DCMAKE_C_FLAGS_RELEASE='-DNDEBUG'
-DCMAKE_CXX_FLAGS_RELEASE='-DNDEBUG'
-DCMAKE_CXX_STANDARD=23
-DSNAPPY_BUILD_BENCHMARKS=OFF
-DINSTALL_GTEST=OFF )
prepare() {
cd "${_srcdir}"
git config --file=.gitmodules submodule.third_party/googletest.url "$srcdir/googletest"
git -c protocol.file.allow=always submodule update --init
sed -i 's|COMMAND "${PROJECT_BINARY_DIR}/snappy_unittest"|COMMAND snappy_unittest|' 'CMakeLists.txt'
}
build() {
for _arch in ${_architectures}; do
${_arch}-cmake -S "${_srcdir}" -B "build-${_arch}-static" "${_flags[@]}" \
-DSNAPPY_BUILD_TESTS=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_INSTALL_PREFIX="/usr/${_arch}/static"
cmake --build "build-${_arch}-static"
${_arch}-cmake -S "${_srcdir}" -B "build-${_arch}" "${_flags[@]}" \
-DSNAPPY_BUILD_TESTS=OFF
cmake --build "build-${_arch}"
done
}
check() {
for _arch in ${_architectures}; do
${_arch}-cmake -S "${_srcdir}" -B "build-${_arch}" "${_flags[@]}" \
-DSNAPPY_BUILD_TESTS=ON
cmake --build "build-${_arch}"
cp -f "build-${_arch}/bin"/* "build-${_arch}"
cmake --build "build-${_arch}" --target test
done
}
package() {
for _arch in ${_architectures}; do
DESTDIR="${pkgdir}" cmake --install "build-${_arch}-static"
${_arch}-strip -g "$pkgdir"/usr/${_arch}/static/lib/*.a
DESTDIR="${pkgdir}" cmake --install "build-${_arch}"
${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
done
}
|