summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2d17035694bf68240b0130cc09a7704b735f3a02 (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
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>

pkgbase=brotli-git
pkgname=('brotli-git' 'python-brotli-git')
pkgver=1.0.9.r51.g509d441
pkgrel=1
pkgdesc="Brotli compression library"
arch=('i686' 'x86_64')
url="https://github.com/google/brotli"
license=('MIT')
makedepends=('git' 'cmake' 'python-build' 'python-installer' 'python-wheel')
source=("git+https://github.com/google/brotli.git")
sha256sums=('SKIP')


pkgver() {
  cd "brotli"

  git describe --long --tags | sed 's/^[A-Za-z]*//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd "brotli"

  cmake \
    -B "_build" \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX="/usr" \
    -DCMAKE_INSTALL_LIBDIR="lib" \
    ./
  make -C "_build"

  python \
    -m build \
    --wheel \
    --no-isolation
}

check() {
  cd "brotli"

  make -C "_build" test
}

package_brotli-git() {
  depends=('glibc')
  provides=("brotli=$pkgver" 'libbrotlicommon.so' 'libbrotlidec.so' 'libbrotlienc.so')
  conflicts=('brotli')

  cd "brotli"

  make -C "_build" DESTDIR="$pkgdir" install
  install -Dm644 "LICENSE" -t "$pkgdir/usr/share/licenses/brotli"
}

package_python-brotli-git() {
  depends=('python')
  provides=("python-brotli=$pkgver")
  conflicts=('python-brotli')

  cd "brotli"

  python \
    -m installer \
    --destdir="$pkgdir" \
    dist/*.whl
}