summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 484b7aa500a6518d5a847ffabe66d2b9f9e7ad7a (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
# Maintainer: Andy Weidenbaum <archbaum@gmail.com>
# Contributor: Dave Reisner <dreisner@archlinux.org>
# Contributor: Antony Male <antony dot male at geemail dot com>>

pkgname=libsnappy
pkgver=1.1.3
pkgrel=2
pkgdesc="A fast compression/decompression library"
arch=('i686' 'x86_64')
makedepends=('autoconf' 'automake' 'git' 'libtool' 'm4' 'make' 'pkg-config')
url="https://google.github.io/snappy/"
license=('BSD')
source=($pkgname-$pkgver::git+https://github.com/google/snappy
        pkg-config.diff::https://github.com/deviance/snappy/commit/d2cb73b6ac1839462fcea926c7e73d1e627bd699.diff)
sha256sums=('SKIP'
            '596a9246a24822cd83abaa88ca3846fbaa1d50b5dcc4ebe23bf29ff2e19241d8')
provides=('snappy')
conflicts=('snappy')

prepare() {
  cd "$srcdir/$pkgname-$pkgver"

  msg2 'Fixing pkg-config...'
  git apply "$srcdir/pkg-config.diff"
}

build() {
  cd "$srcdir/$pkgname-$pkgver"

  msg2 'Building...'
  # compile without assertions
  export CXXFLAGS+=\ -DNDEBUG
  ./autogen.sh
  ./configure \
    --prefix=/usr \
    --sbindir=/usr/bin \
    --libexecdir=/usr/lib/snappy \
    --sysconfdir=/etc \
    --sharedstatedir=/usr/share/snappy \
    --localstatedir=/var/lib/snappy \
    --with-gnu-ld
  make
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  msg2 'Installing license...'
  install -Dm 644 COPYING -t "$pkgdir/usr/share/licenses/libsnappy"

  msg2 'Installing...'
  make DESTDIR="$pkgdir" install
  ln -s "$pkgdir/usr/lib/pkgconfig/snappy.pc" "$pkgdir/usr/lib/pkgconfig/libsnappy.pc"
}