void-packages/srcpkgs/gpsbabel/template
newbluemoon 673bc8f56e gpsbabel: use qmake build-helper
enable cross-builds and fix package cleanup
2019-11-04 17:44:02 +01:00

51 lines
1.5 KiB
Bash

# Template file for 'gpsbabel'
pkgname=gpsbabel
version=1.5.4
revision=1
wrksrc="gpsbabel-gpsbabel_${version//./_}"
build_style=gnu-configure
build_helper=qmake
makedepends="qt5-devel libusb-compat-devel"
depends="desktop-file-utils"
short_desc="Converts waypoints, tracks, and routes between popular GPS formats"
maintainer="Philipp Hirsch <itself@hanspolo.net>"
license="GPL-2.0-or-later"
homepage="https://www.gpsbabel.org/"
distfiles="https://github.com/gpsbabel/${pkgname}/archive/${pkgname}_${version//./_}.tar.gz"
checksum=8cd740db0b92610abff71e942e8a987df58cd6ca5f25cca86e15f2b00e190704
replaces="gpsbabel-gui>=0"
if [ "$CROSS_BUILD" ]; then
hostmakedepends+=" qt5-devel"
configure_args+=" ac_cv_prog_QMAKE=${XBPS_WRAPPERDIR}/qmake"
fi
do_build() {
sed -i 's|langPath_ = QApplication::applicationDirPath();|langPath_ = "/usr/share/gpsbabel";|' gui/mainwindow.cc
make ${makejobs}
cd gui
qmake-qt5
lrelease-qt5 *.ts
sed -i Makefile \
-e"s;^\(CFLAGS.*=.*\);& $CFLAGS;" \
-e"s;^\(CXXFLAGS.*=.*\);& $CXXFLAGS;" \
-e"s;^\(LFLAGS.*=.*\);& $LDFLAGS;"
make ${makejobs}
}
do_install() {
make install DESTDIR=${DESTDIR}
vbin gui/gpsbabelfe
vbin gui/objects/gpsbabelfe-bin
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
}
post_pkg() {
# Remove temporary stuff from masterdir
rm -rf ${XBPS_BUILDDIR}/babelweb
}