summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d44de2ad8ff1a1e571f52a0dcc3052d8c862775b (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
# Maintainer: Philipp A. <flying-sheep@web.de>
_name=resvg
pkgname=$_name-qt
pkgver=0.13.0
pkgrel=1
pkgdesc='SVG rendering library and CLI (Linked against Qt)'
arch=(i686 x86_64)
url="https://github.com/RazrFalcon/$_name"
license=(MPL2)
provides=(resvg)
conflicts=(resvg)
depends=(qt5-base)
makedepends=(cargo clang qt5-tools cmake extra-cmake-modules)
source=("$_name-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('f5d4f146909634d664ba3fbbae7ba20d6f2db5c56d1e63056653d6245331d907')

build() {
	cd "$_name-$pkgver"
	for dir in usvg c-api .; do
	(
		msg2 "Building $dir"
		cd "$dir"
		if grep -q cairo-backend Cargo.toml; then
			cargo build --release --features=qt-backend
		else
			cargo build --release
		fi
	)
	done
	(
		msg2 "Building tools/viewsvg"
		cd tools/viewsvg
		qmake PREFIX="$pkgdir/usr"
		make
	)
	
	msg2 'Building docs'
	cargo doc --release --no-deps -p resvg-capi
}

package() {
	cd "$_name-$pkgver"
	
	for tool in resvg usvg; do
		install -Dm755 target/release/$tool "$pkgdir/usr/bin/$tool"
	done
	install -Dm755 tools/viewsvg/viewsvg      "$pkgdir/usr/bin/viewsvg"
	install -Dm755 target/release/libresvg.so "$pkgdir/usr/lib/libresvg.so"
	install -d "$pkgdir/usr/share/doc/resvg"  "$pkgdir/usr/include"
	install -Dm644 c-api/*.h "$pkgdir/usr/include/"
	cp -r target/doc/* "$pkgdir/usr/share/doc/resvg"
}