void-packages/srcpkgs/qt5-webview/template

62 lines
2.1 KiB
Bash

# Template file for 'qt5-webview'
pkgname=qt5-webview
version=5.15.4
revision=1
_commit=826d2a33929c69807917536d48b7861e7682001e
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=49f7c087e8e3662adf3c271c41c629e547f02b82b305641148f07170d4ea1a67
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
}
}