summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 52ce614b1f4b07b258bc30fb06acd6a5e16c813b (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: Otreblan <otreblain@gmail.com>

pkgname=libtree
pkgver=1.2.0
pkgrel=1
pkgdesc="ldd as a tree with an option to bundle dependencies into a single folder "
arch=('x86_64')
url="https://github.com/haampie/libtree"
license=('MIT')
depends=('cppglob' 'gcc-libs')
makedepends=('cmake' 'cxxopts' 'termcolor' 'elfio')
optdepends=('binutils: For the --strip option'
	'chrpath: For the --chrpath option'
)
checkdepends=('gtest')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('4b60d8adacb60a5d91fda5e05a87fca6030350753ef1974dc7813a25b0e996bc')

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

	mkdir -p build

	# Needed for LTO
	find . \
		-name 'CMakeLists.txt' \
		-exec sed -i 's/VERSION 3.0/VERSION 3.13.0/' {} \;
}

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

	cmake \
		-DUSE_SYSTEM_DEPS=ON \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_UNITY_BUILD=ON \
		-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
		..

	make
}

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

	make test
}

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

	make DESTDIR="$pkgdir/" install
	install -Dm644 ../LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}