void-packages/srcpkgs/qmc2/template
Jürgen Buchmüller c62a1974db qmc2: fix cross
2017-01-27 16:09:48 +01:00

93 lines
3 KiB
Bash

# Template file for 'qmc2'
pkgname=qmc2
version=0.71
revision=2
wrksrc=${pkgname}
build_style=gnu-makefile
make_build_args="PREFIX=/usr DATADIR=/usr/share MAN_DIR=/usr/share/man TARGET=qmc2-mame"
make_install_args="${make_build_args}"
hostmakedepends="rsync unzip"
makedepends="SDL2-devel qt5-multimedia-devel qt5-script-devel qt5-svg-devel
qt5-webkit-devel qt5-xmlpatterns-devel qt5-x11extras-devel"
depends="qt5-plugin-sqlite rsync ${pkgname}-data qmc2-flyers qmc2-snapshots"
conf_files="/etc/${pkgname}/${pkgname}.ini"
short_desc="Qt M.A.M.E. Catalog/Launcher II"
maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
license="GPL-2"
homepage="http://qmc2.arcadehits.net/wordpress/"
distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}/${version}/${pkgname}-${version}.tar.bz2"
checksum=4233d8aaf679f9f752348990eb5ebe3ab801e28a17dc624ba9b6eb77d54a82f0
if [ -n "$CROSS_BUILD" ]; then
hostmakedepends+=" qt5-host-tools qt5-multimedia-devel qt5-script-devel qt5-svg-devel"
hostmakedepends+=" qt5-webkit-devel qt5-xmlpatterns-devel qt5-x11extras-devel"
fi
pre_build() {
# Replace sdl-config with sdl2-config
sed -e "s;sdl-config;sdl2-config;g" -i scripts/sdl-version.sh
# Replace obsolete -sdlmame suffix
sed -e "s;-sdlmame;-mame;g" -i Makefile
}
do_build() {
# Print configuration info
make ${make_build_args} config
make ${make_build_args} Makefile.qmake
make ${make_build_args} tools/qchdman/Makefile
sed -i Makefile.qmake tools/qchdman/Makefile \
-e "s;^\(CC *=\).*;\1 $CC;" \
-e "s;^\(CXX *=\).*;\1 $CXX;" \
-e "s;^\(LINK *=\).*;\1 $CXX;" \
-e "s;^\(CFLAGS *=\)\(.*\);\1 $CFLAGS \2;" \
-e "s;^\(CXXFLAGS *=\)\(.*\);\1 $CXXFLAGS \2;" \
-e "s;^\(LFLAGS *=\)\(.*\);\1 $LDFLAGS \2;"
make ${makejobs} qchdman
make ${make_build_args} ${makejobs}
}
do_install() {
# Install /usr/bin/qmc2-mame and /etc/qmc2/qmc2.ini
vbin qmc2-mame
vmkdir etc/${pkgname}
sed inst/qmc2.ini.template \
-e "s;DATADIR;/usr/share;" \
> ${DESTDIR}/etc/${pkgname}/${pkgname}.ini
# Install qmc2 desktop file
vmkdir usr/share/applications
sed inst/qmc2.desktop.template \
-e "s;DATADIR;/usr/share;" \
-e "s;EMULATOR;MAME;" \
-e "s;TARGET;qmc2-mame;" \
-e "s;EMUICO;mame.png;" \
-e "s;GENERICNAME;$short_desc;" \
> ${DESTDIR}/usr/share/applications/qmc2-mame.desktop
# Install translations
vmkdir usr/share/${pkgname}/lng
for qm in $(find ${wrksrc}/data/lng -name "*.qm"); do
vinstall $qm 644 /usr/share/${pkgname}/lng
done
# Install qchdman and img
vbin tools/qchdman/qchdman
vmkdir usr/share/${pkgname}
cp -aR data/img ${DESTDIR}/usr/share/${pkgname}
# Install qchdman desktop file
vmkdir usr/share/applications
sed inst/qchdman.desktop.template \
-e "s;DATADIR;/usr/share;" \
> ${DESTDIR}/usr/share/applications/qchdman.desktop
}
qmc2-data_package() {
noarch=yes
short_desc+=" - data files"
pkg_install() {
local _ddir
vmove usr/share/qmc2
for _ddir in opt img doc prv fly ico cat cab ctl \
mrq ttl sws swn gmn js; do
cp -aR data/$_ddir ${PKGDESTDIR}/usr/share/qmc2
done
}
}