aboutsummaryrefslogtreecommitdiffstats
path: root/main/zstd/APKBUILD
blob: e18ea51ae12648cfbfa1fb45353ea74659f31b7b (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
# Contributor: stef <l0ls0fo2i@ctrlc.hu>
# Maintainer: André Klitzing <aklitzing@gmail.com>
pkgname=zstd
pkgver=1.4.4
pkgrel=1
pkgdesc="Zstandard - Fast real-time compression algorithm"
url="https://www.zstd.net"
arch="all"
license="BSD-3-Clause GPL-2.0-or-later"
checkdepends="file"
makedepends="grep"
subpackages="$pkgname-static $pkgname-libs $pkgname-dev $pkgname-doc"
source="zstd-$pkgver.tar.gz::https://github.com/facebook/zstd/archive/v$pkgver.tar.gz
	"

# secfixes:
#   1.3.8-r0:
#     - CVE-2019-11922

build() {
	cd "$builddir"
	unset CPPFLAGS
	local _moreflags="-O2"
	case "$CARCH" in
		# avoid memory copy hack that violates C standard
		armhf) _moreflags="$_moreflags -DMEM_FORCE_MEMORY_ACCESS=0" ;;
	esac
	make HAVE_PTHREAD=1 HAVE_ZLIB=0 HAVE_LZMA=0 HAVE_LZ4=0 MOREFLAGS="$_moreflags"
}

check() {
	cd "$builddir"
	case "$CARCH" in
		arm*) make check ;;
		*) make test ;;
	esac
}

package() {
	cd "$builddir"
	make PREFIX="/usr" DESTDIR="$pkgdir" install
}

static() {
	pkgdesc="zstd static library"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/*.a "$subpkgdir"/usr/lib/
}

sha512sums="8209837e8eb14e474dfe21d5511085f46cef93b03ab77613fd41e7b8be652418231c38852669c8e0b55b78ad41ea2cb8008d0da122a83f8f27e32b5c86f045cf  zstd-1.4.4.tar.gz"