# Template file for 'fbida'.
pkgname=fbida
version=2.14
revision=1
build_style=meson
hostmakedepends="cmake perl pkg-config cairo-devel"
# XXX ida needs motif-devel; cross needs cairo-gl
makedepends="MesaLib-devel giflib-devel libexif-devel libpng-devel fontconfig-devel
freetype-devel libcurl-devel libdrm-devel libepoxy-devel libglib-devel libXpm-devel
libXt-devel pixman-devel cairo-devel poppler-glib-devel libwebp-devel tiff-devel
libwebp-devel sane-devel"
short_desc="Display and elementary edit images using fbdev"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later"
homepage="https://www.kraxel.org/blog/linux/fbida/"
distfiles="https://www.kraxel.org/releases/${pkgname}/${pkgname}-${version}.tar.gz"
checksum=95b7c01556cb6ef9819f358b314ddfeb8a4cbe862b521a3ed62f03d163154438
depends="fbida-exiftran-${version}_${revision} fbida-fbi-${version}_${revision}
 fbida-fbpdf-${version}_${revision} $(vopt_if ida fbida-ida-${version}_${revision})"
nocross="Requires cairo-gl.pc for the target which Void does not have"

build_options="ida"
desc_option_ida="Build ida motif application (needs motif-devel)"

# Needs motif-devel, does not work with lesstif-devel
#build_options_default="ida"

subpackages="fbida-fbi fbida-fbpdf fbida-exiftran"
if [ "$build_option_ida" ]; then
	subpackages+=" fbida-ida"
fi

CFLAGS="-fcommon"

post_install() {
	vdoc README
	vdoc Changes
	vdoc TODO
}

fbida-fbi_package() {
	short_desc+=" - fbi binary"
	pkg_install() {
		vmove usr/bin/fbi
		vmove usr/share/man/man1/fbi.1
	}
}

fbida-fbpdf_package() {
	short_desc+=" - fbipdf binary"
	conflicts="fbpdf>=0"
	pkg_install() {
		vmove usr/bin/fbpdf
	}
}

fbida-ida_package() {
	short_desc+=" - ida binary and desktop file"
	pkg_install() {
		vmove usr/bin/ida
		vmove usr/share/man/man1/ida.1
		vmkdir usr/share/examples/ida
		mv ${DESTDIR}/usr/Ida ${PKGDESTDIR}/usr/share/examples/ida
		vinstall desktop/ida.desktop 644 usr/share/X11
	}
}

fbida-exiftran_package() {
	short_desc+=" - exiftran binary"
	pkg_install() {
		vmove usr/bin/exiftran
		vmove usr/share/man/man1/exiftran.1
	}
}
