APKBUILD 1.85 KB
Newer Older
dai9ah's avatar
dai9ah committed
1
2
3
# Contributor: prspkt <prspkt@protonmail.com>
# Maintainer: prspkt <prspkt@protonmail.com>
pkgname=brotli
4
5
pkgver=1.0.9
pkgrel=1
dai9ah's avatar
dai9ah committed
6
7
8
9
pkgdesc="Generic lossless compressor"
url="https://github.com/google/brotli"
arch="all"
license="MIT"
10
makedepends="cmake python3-dev"
TBK's avatar
TBK committed
11
subpackages="$pkgname-doc $pkgname-static $pkgname-dev $pkgname-libs py3-$pkgname:py3"
12
13
source="$pkgname-$pkgver.tar.gz::https://github.com/google/brotli/archive/v$pkgver.tar.gz
	optimize-mips-s390x.patch
TBK's avatar
TBK committed
14
	build-tool-against-shared-lib.patch
15
	838.patch
16
	"
dai9ah's avatar
dai9ah committed
17

18
19
20
21
# secfixes:
#   1.0.9-r0:
#     - CVE-2020-8927

dai9ah's avatar
dai9ah committed
22
prepare() {
prspkt's avatar
prspkt committed
23
24
	default_prepare
	sed -i 's,/usr/bin/env bash,/bin/sh,' tests/*.sh
dai9ah's avatar
dai9ah committed
25
26
27
}

build() {
prspkt's avatar
prspkt committed
28
29
30
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
TBK's avatar
TBK committed
31
32
	cmake  -B build \
		-DCMAKE_BUILD_TYPE=None \
dai9ah's avatar
dai9ah committed
33
		-DCMAKE_INSTALL_PREFIX=/usr \
prspkt's avatar
prspkt committed
34
35
36
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_C_FLAGS="$CFLAGS" \
TBK's avatar
TBK committed
37
38
		$CMAKE_CROSSOPTS
	make -C build
dai9ah's avatar
dai9ah committed
39
40
41
}

check() {
TBK's avatar
TBK committed
42
	make -C build test
dai9ah's avatar
dai9ah committed
43
}
44

dai9ah's avatar
dai9ah committed
45
package() {
TBK's avatar
TBK committed
46
	make -C build DESTDIR="$pkgdir" install
47

prspkt's avatar
prspkt committed
48
	local man; for man in docs/*.?; do
dai9ah's avatar
dai9ah committed
49
50
51
52
		install -D -m644 $man "$pkgdir"/usr/share/man/man${man##*.}/${man##*/}
	done
}

53
54
55
56
57
py3() {
	cd "$builddir"
	python3 setup.py install --prefix=/usr --root="$subpkgdir"
}

58
sha512sums="b8e2df955e8796ac1f022eb4ebad29532cb7e3aa6a4b6aee91dbd2c7d637eee84d9a144d3e878895bb5e62800875c2c01c8f737a1261020c54feacf9f676b5f5  brotli-1.0.9.tar.gz
TBK's avatar
TBK committed
59
59e934578ce23b703f8f25f56578f8e9fd1466a9844b6f67b542acd6496df352548e3762697dc3851cfd0f8e1bad170bfdaa3e8a87c901fe81e2f3042e3aee84  optimize-mips-s390x.patch
60
61
f4a7653a0f7ef69f059d7f744a48c7731c8e66f977ce2e66cd106f697e82aa1f005923898d216a3d8be143b2dc8db1927c09daedb981818e752640a333d75fbc  build-tool-against-shared-lib.patch
58ef677595f0db80b7d1353e42603cc30ef9b0b9530927f731ee31ac60ad9a3b2aac960a5cd100f8b10e547c9534e1ebf78c53550b52eed6fb3b7fb853317d20  838.patch"