summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7bfc81099a5a12e1ee76b980127083c3d4a14124 (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
_pkgname=resvg
pkgname=${_pkgname}-git
pkgver=0.5.0.r6.gec7f425
pkgrel=1
pkgdesc='SVG rendering library and CLI'
arch=(i686 x86_64)
url="https://github.com/RazrFalcon/$_pkgname"
license=(MPL2)
makedepends=(cargo qt5-base pango git gdk-pixbuf2)
conflicts=(resvg)
provides=(resvg)
source=("git+${url}.git#branch=master")
sha256sums=('SKIP')

pkgver() {
	cd "${srcdir}/${_pkgname}"
	git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//'
}

build() {
	cd "${srcdir}/${_pkgname}"
	for dir in capi tools/rendersvg; do
	(
		msg2 "Building $dir"
		cd "$dir"
		cargo build --release --features='qt-backend cairo-backend'
	)
	done
	
	msg2 'Building docs'
	cargo doc --release --no-deps -p resvg-capi
}

package() {
	cd "${srcdir}/${_pkgname}"
	
	install -Dm755 target/release/rendersvg   "$pkgdir/usr/bin/rendersvg"
	install -Dm755 target/release/libresvg.so "$pkgdir/usr/lib/libresvg.so"
	install -Dm644 capi/include/resvg.h       "$pkgdir/usr/include/resvg.h"

	install -d "$pkgdir/usr/share/doc/resvg"
	cp -r target/doc/* "$pkgdir/usr/share/doc/resvg"
}