void-packages/srcpkgs/qwt/template

114 lines
2.8 KiB
Bash

# Template file for 'qwt'
pkgname=qwt
version=6.2.0
revision=2
build_style=qmake
hostmakedepends="qt6-base qt6-tools qt5-qmake qt5-host-tools"
_makedepends_qt6="qt6-tools-devel qt6-svg-devel"
_makedepends_qt5="${_makedepends_qt6//qt6/qt5}"
makedepends="${_makedepends_qt6} ${_makedepends_qt5}"
short_desc="Qt Widgets for Technical Applications"
maintainer="Giuseppe Fierro <gspe@ae-design.ws>"
license="LGPL-2.1-only, Qwt-exception-1.0"
homepage="https://qwt.sourceforge.io/"
distfiles="https://sourceforge.net/projects/${pkgname}/files/${pkgname}/${version}/${pkgname}-${version}.tar.bz2"
checksum=9194f6513955d0fd7300f67158175064460197abab1a92fa127a67a4b0b71530
post_configure() {
local qmake_args f sdir dspec dname
if [ -n "${CROSS_BUILD}" ]; then
dname="linux-g++"
for sdir in .host-spec .target-spec; do
dspec="${sdir}-qt6/${dname}"
mkdir -p "${dspec}"
for f in "${sdir}/${dname}"/*; do
[ -f "${f}" ] || continue
sed 's/qt5/qt6/g' "${f}" > "${dspec}/${f##*/}"
done
done
sed -e 's/qt5/qt6/g' -e "s@-spec/@-spec-qt6/@g" qt.conf > qt6.conf
qmake_args=(
"-qtconf" "${wrksrc}/qt6.conf"
"PKG_CONFIG_EXECUTABLE=${XBPS_WRAPPERDIR}/${PKG_CONFIG}"
)
else
qmake_args=( "CONFIG+=no_qt_rpath" )
fi
mkdir -p build-qt6
cd build-qt6
/usr/lib/qt6/bin/qmake "${qmake_args[@]}" \
PREFIX=/usr QT_INSTALL_PREFIX=/usr LIB=/usr/lib ..
}
do_build() {
make ${makejobs} CC="$CC" CXX="$CXX" LINK="$CXX"
make ${makejobs} -C build-qt6 CC="$CC" CXX="$CXX" LINK="$CXX"
}
do_install() {
for build_root in . build-qt6; do
make -C "${build_root}" STRIP=true PREFIX=/usr \
DESTDIR="${DESTDIR}" INSTALL_ROOT="${DESTDIR}" install
done
# This is Qt5 only, so it will be installed in qwt-devel
rm "${DESTDIR}/usr/include/qwt/qwt_plot_glcanvas.h"
vlicense COPYING
}
qwt-qt6_package() {
short_desc+=" (Qt6)"
pkg_install() {
vmove "usr/lib/libqwt-qt6.so.*"
vlicense COPYING
}
}
qwt-headers_package() {
short_desc+=" - Qt5/Qt6 common headers"
pkg_install() {
vmove usr/include
vlicense COPYING
}
}
qwt-devel_package() {
depends="${sourcepkg}-${version}_${revision}
qwt-headers-${version}_${revision} ${_makedepends_qt5}"
short_desc+=" - Qt5 development files"
pkg_install() {
vmove "usr/lib/*-qt5.so"
vmove usr/lib/qt5
vmove usr/lib/pkgconfig/Qt5*
vmkdir usr/include/qwt
vcopy "src/qwt_plot_glcanvas.h" usr/include/qwt
}
}
qwt-qt6-devel_package() {
depends="qwt-qt6-${version}_${revision}
qwt-headers-${version}_${revision} ${_makedepends_qt6}"
short_desc+=" - Qt6 development files"
pkg_install() {
vmove "usr/lib/*-qt6.so"
vmove usr/lib/qt6
vmove usr/lib/pkgconfig/Qt6*
}
}
qwt-doc_package() {
depends="${sourcepkg}-${version}_${revision}"
short_desc+=" - doc files"
pkg_install() {
vmove usr/share/doc
mv "${PKGDESTDIR}/usr/share/doc/qwt/man" "${PKGDESTDIR}/usr/share"
}
}