void-packages/srcpkgs/resvg/template
2019-03-23 16:00:54 -03:00

55 lines
1.5 KiB
Bash

# Template file for 'resvg'
pkgname=resvg
version=0.6.1
revision=1
build_helper="rust"
hostmakedepends="cargo qt5-host-tools pkg-config"
makedepends="pango-devel cairo-devel gdk-pixbuf-devel rust-std qt5-devel"
short_desc="SVG rendering library written in Rust"
maintainer="maxice8 <thinkabit.ukim@gmail.com>"
license="MPL-2.0"
homepage="https://github.com/RazrFalcon/resvg"
distfiles="https://github.com/RazrFalcon/resvg/releases/download/v${version}/resvg-${version}.tar.xz"
checksum=7206f79f67b4c8610353134c375ed3ff9c5eb63b16fae267b94730c23ebe4ee1
do_build() {
for dir in capi tools/{render,u}svg; do
(
cd $dir
if grep -q cairo-backend Cargo.toml; then
cargo build --release --target ${RUST_TARGET} --features="qt-backend cairo-backend"
else
cargo build --release --target ${RUST_TARGET}
fi
)
done
}
do_install() {
for t in {render,u}svg; do
vbin target/${RUST_TARGET}/release/$t
done
# Install library as libresvg.so.0 and make the solink
vinstall target/${RUST_TARGET}/release/libresvg.so 755 usr/lib libresvg.so.0
ln -rs "${DESTDIR}"/usr/lib/libresvg.so.0 "${DESTDIR}"/usr/lib/libresvg.so
vinstall capi/include/resvg.h 644 usr/include
vinstall capi/include/ResvgQt.h 644 usr/include
}
libresvg0_package() {
short_desc+=" - resvg library"
pkg_install() {
vmove "usr/lib/libresvg.so.*"
}
}
libresvg-devel_package() {
depends="libresvg0-${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove "usr/lib/*.so"
}
}