void-packages/srcpkgs/qt5-webview/template

62 lines
2.1 KiB
Bash

# Template file for 'qt5-webview'
pkgname=qt5-webview
version=5.15.11
revision=1
_commit=f078642eb9a440f6aa88f2beaf10f445de1e29bb
build_style=qmake
hostmakedepends="qt5-qmake perl qt5-host-tools"
makedepends="qt5-location-devel qt5-webchannel-devel qt5-tools-devel qt5-declarative-devel
$(vopt_if webengine qt5-webengine-devel)"
short_desc="Cross-platform application and UI framework (QT5) - WebEngine component"
maintainer="John <me@johnnynator.dev>"
license="GPL-3.0-or-later, LGPL-3.0-or-later"
homepage="https://qt.io/"
distfiles="https://invent.kde.org/qt/qt/qtwebview/-/archive/${_commit}.tar.gz"
checksum=263646015be03b1bc8828ce84c9ab278e7ff3fed8f9cceb271aa262da1f312aa
build_options="webengine"
if [ "$XBPS_TARGET_ENDIAN" = "le" ] && [ "$XBPS_WORDSIZE" = "$XBPS_TARGET_WORDSIZE" ]; then
build_options_default="webengine"
fi
post_extract() {
mkdir -p ${wrksrc}/.git
}
_cleanup_wrksrc_leak() {
if [ -d "${PKGDESTDIR}/usr/lib/cmake" ]; then
# Replace references to ${wrksrc} in cmake files
sed -i ${PKGDESTDIR}/usr/lib/cmake/*/*.cmake \
-e "s;${wrksrc}/host;/usr/lib/qt5;g" \
-e "s;devices/void-${XBPS_CROSS_TRIPLET}-g++;linux-g++;g"
fi
if [ -d "${PKGDESTDIR}/usr/lib/pkgconfig" ]; then
# Replace references to ${wrksrc} in pkgconfig files
sed -i ${PKGDESTDIR}/usr/lib/pkgconfig/*.pc \
-e "s;${wrksrc}/host;/usr/lib/qt5;g" \
-e "s;devices/void-${XBPS_CROSS_TRIPLET}-g++;linux-g++;g"
fi
# Remove QMAKE_PRL_BUILD_DIR from hint files for static libraries
# and replace references to ${wrksrc}
find ${PKGDESTDIR} -iname "*.prl" -exec sed -i "{}" \
-e "/^QMAKE_PRL_BUILD_DIR/d" \
-e "s;-L${wrksrc}/qtbase/lib;-L/usr/lib;g" \;
# Replace ${wrksrc} in project include files
find ${PKGDESTDIR} -iname "*.pri" -exec sed -i "{}" \
-e "s;${wrksrc}/qtbase;/usr/lib/qt5;g" \;
}
qt5-webview-devel_package() {
depends="qt5-devel>=${version} ${sourcepkg}>=${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove usr/include
vmove usr/lib/cmake
vmove usr/lib/pkgconfig
vmove usr/lib/qt5/mkspecs
vmove "usr/lib/*.so"
vmove "usr/lib/*.prl"
_cleanup_wrksrc_leak
}
}