aboutsummaryrefslogtreecommitdiffstats
path: root/testing/libgflags/APKBUILD
blob: a1f4f73dfb8f3cd02dfe52494c454bc546e65643 (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
# Contributor: David Huffman <storedbox@outlook.com>
# Maintainer: David Huffman <storedbox@outlook.com>
pkgname=libgflags
pkgver=2.1.2
_srcname=gflags-$pkgver
pkgrel=0
pkgdesc="A C++ library that implements commandline flags processing"
url="https://gflags.github.io/gflags"
arch="all"
license="BSD"
depends=""
depends_dev=""
makedepends="$depends_dev cmake"
install=""
subpackages="$pkgname-dev $pkgname-doc $pkgname-bash-completion:bashcomp"
source="https://github.com/gflags/gflags/archive/v$pkgver/$_srcname.tar.gz"

_builddir="$srcdir/$_srcname"
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	cmake -Wno-dev \
	      -DBUILD_gflags_nothreads_LIB=OFF \
	      -DBUILD_SHARED_LIBS=ON \
	      -DBUILD_STATIC_LIBS=ON \
	      -DCMAKE_INSTALL_PREFIX=/usr \
	      -DCMAKE_SKIP_RPATH=ON \
	      -DCMAKE_VERBOSE_MAKEFILE=ON \
	       || return 1
	make || return 1
}

package() {
	local docdir="$pkgdir/usr/share/doc/$pkgname-$pkgver"
	mkdir -p "$docdir" || return 1

	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	cp AUTHORS.txt ChangeLog.txt COPYING.txt "$docdir"
	cp -r doc "$docdir/html"
}

bashcomp() {
	depends=""
	pkgdesc="Bash completion for $pkgname"
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"
	arch="noarch"

	install -Dm644 "$pkgdir/usr/bin/gflags_completions.sh" \
	               "$subpkgdir/usr/share/bash-completion/completions/gflags"
}

md5sums="ac432de923f9de1e9780b5254884599f  gflags-2.1.2.tar.gz"
sha256sums="d8331bd0f7367c8afd5fcb5f5e85e96868a00fd24b7276fa5fcee1e5575c2662  gflags-2.1.2.tar.gz"
sha512sums="f636023c1150e4d536d2d472e40d643ff0b02d3c96d8cb7f31544df23e6255fa6c4fd927ef94a3660c250d3faeae7d8d78519fc5e856749a577347a78d9d9ab5  gflags-2.1.2.tar.gz"