# Template file for 'gpsbabel'
pkgname=gpsbabel
version=1.10.0
revision=1
build_style=cmake
configure_args="-DGPSBABEL_WITH_SHAPELIB=pkgconfig -DGPSBABEL_WITH_ZLIB=pkgconfig"
hostmakedepends="pkg-config qt6-tools"
makedepends="qt6-base-devel qt6-qt5compat-devel qt6-webengine-devel qt6-serialport-devel libusb-compat-devel shapelib-devel"
depends="desktop-file-utils"
short_desc="Converts waypoints, tracks, and routes between popular GPS formats"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-2.0-or-later"
homepage="https://www.gpsbabel.org/"
distfiles="https://github.com/gpsbabel/${pkgname}/archive/${pkgname}_${version//./_}.tar.gz"
checksum=a89756fb988a54f5c5f371413845b9aecb66628a594cd83bd529c0f18382c968

# ERROR: Package 'qt6-webengine-devel-6.8.2_3' not found in repository pool.
archs="x86_64* aarch64* armv6l*"

replaces="gpsbabel-gui>=0"

if [ "$CROSS_BUILD" ]; then
	hostmakedepends+=" qt6-base-devel qt6-webengine-devel"
	configure_args+=" ac_cv_prog_QMAKE=${XBPS_WRAPPERDIR}/qmake"
fi

do_install() {
	vbin build/gpsbabel
	vbin build/gui/GPSBabelFE/gpsbabelfe
	vinstall gui/gpsbabel.desktop 644 usr/share/applications
	vinstall gui/images/appicon.png 644 usr/share/pixmaps gpsbabel.png
	vmkdir usr/share/gpsbabel/translations
	mv gui/*.qm ${DESTDIR}/usr/share/gpsbabel/translations
}
