summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 10dc021f6724ea707870f8b091ef3f12c2e326b3 (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
# Maintainer: Ranieri Althoff <ranisalt+aur at gmail dot com>
# Contributor: S├ębastien Luttringer

_pkgname=lz4
pkgname=${_pkgname}-static-musl
epoch=1
pkgver=1.9.1
pkgrel=2
pkgdesc='Extremely fast compression algorithm, statically linked to musl libc'
arch=('x86_64')
url='http://www.lz4.org/'
license=('GPL2')
makedepends=('git' 'musl')
checkdepends=('diffutils')
provides=("${_pkgname}=${pkgver}")
conflicts=('lz4')
source=("git+https://github.com/lz4/lz4.git#tag=v$pkgver")
md5sums=('SKIP')

build() {
  export CC="musl-gcc"
  export CFLAGS="$CFLAGS -fPIC -static"

  # do not use the main makefile, it calls sub make with -e
  # exported CLFAGS by makepkg break the version. see FS#50071
  cd $_pkgname
  make -C lib PREFIX=/usr
  make -C programs PREFIX=/usr lz4 lz4c
}

check() {
  rm -f passwd.lz4
  $_pkgname/programs/lz4 /etc/passwd passwd.lz4
  $_pkgname/programs/lz4 -d passwd.lz4 passwd
  diff -q /etc/passwd passwd
  rm passwd
}

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

# vim:set ts=2 sw=2 et: