void-packages/srcpkgs/qbittorrent/template

102 lines
3.4 KiB
Bash

# Template file for 'qbittorrent'
pkgname=qbittorrent
version=4.2.5
revision=3
create_wrksrc=yes
build_style=qmake
hostmakedepends="automake libtool pkg-config qt5-host-tools qt5-qmake qt5-tools tar xz"
makedepends="libtorrent-rasterbar-devel qt5-declarative-devel qt5-svg-devel"
depends="qt5-svg"
short_desc="Free software alternative to µtorrent"
maintainer="Jürgen Buchmüller <pullmoll@t-online.de>"
license="GPL-2.0-or-later"
homepage="http://www.qbittorrent.org/"
changelog="https://www.qbittorrent.org/news.php"
distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
checksum=4b57c86a22e485e5f19ae94881dfda7b8234aa1f20fb0ec6e04972b477f26a4f
if [ "$CROSS_BUILD" ]; then
hostmakedepends+=" qt5-svg-devel"
fi
do_extract() {
local n=${pkgname}-${version}
mkdir -p build-nox build-x11
tar xf ${XBPS_SRCDISTDIR}/${n}/${n}.tar.xz --strip-components=1 -C build-x11
tar xf ${XBPS_SRCDISTDIR}/${n}/${n}.tar.xz --strip-components=1 -C build-nox
}
do_configure() {
local opts="--prefix=/usr" build opts
opts+=" --disable-systemd"
opts+=" --with-boost=${XBPS_CROSS_BASE}/usr"
opts+=" --with-boost-libdir=${XBPS_CROSS_BASE}/usr/lib"
if [ "$CROSS_BUILD" ]; then
opts+=" --host=${XBPS_CROSS_TRIPLET}"
fi
for f in build-x11:--enable-gui:--disable-webui \
build-nox:--disable-gui:--enable-webui; do
build=${f%%:*}
f=${f#*:}
opts+=" ${f/:/ }"
cd ${wrksrc}/${build}
./bootstrap.sh
./configure ${opts}
echo "[Paths]" > qt.conf
echo "Sysroot=${XBPS_CROSS_BASE}" >> qt.conf
echo "Prefix=${XBPS_CROSS_BASE}/usr" >> qt.conf
echo "ArchData=${XBPS_CROSS_BASE}/usr/lib/qt5" >> qt.conf
echo "Data=${XBPS_CROSS_BASE}/usr/share/qt5" >> qt.conf
echo "Documentation=${XBPS_CROSS_BASE}/usr/share/doc/qt5" >> qt.conf
echo "Headers=${XBPS_CROSS_BASE}/usr/include/qt5" >> qt.conf
echo "Libraries=${XBPS_CROSS_BASE}/usr/lib" >> qt.conf
echo "LibraryExecutables=/usr/lib/qt5/libexec" >> qt.conf
echo "Binaries=/usr/lib/qt5/bin" >> qt.conf
echo "Tests=${XBPS_CROSS_BASE}/usr/tests" >> qt.conf
echo "Plugins=/usr/lib/qt5/plugins" >> qt.conf
echo "Imports=${XBPS_CROSS_BASE}/usr/lib/qt5/imports" >> qt.conf
echo "Qml2Imports=${XBPS_CROSS_BASE}/usr/lib/qt5/qml" >> qt.conf
echo "Translations=${XBPS_CROSS_BASE}/usr/share/qt5/translations" >> qt.conf
echo "Settings=${XBPS_CROSS_BASE}/etc/xdg" >> qt.conf
echo "Examples=${XBPS_CROSS_BASE}/usr/share/qt5/examples" >> qt.conf
echo "HostPrefix=/usr" >> qt.conf
echo "HostData=/usr/lib/qt5" >> qt.conf
echo "HostBinaries=/usr/lib/qt5/bin" >> qt.conf
echo "HostLibraries=/usr/lib" >> qt.conf
echo "Spec=linux-g++" >> qt.conf
echo "TargetSpec=linux-g++" >> qt.conf
qmake-qt5 \
PREFIX=/usr \
LIB=/usr/lib \
QMAKE_CC=$CC QMAKE_CXX=$CXX QMAKE_LINK=$CXX \
QMAKE_CFLAGS="${CFLAGS}" \
QMAKE_CXXFLAGS="${CXXFLAGS}" \
QMAKE_LFLAGS="${LDFLAGS}" \
-qtconf qt.conf
if [ "${XBPS_CROSS_BASE}" ]; then
vsed -i src/Makefile \
-e "s; /usr/lib/libQt5; ${XBPS_CROSS_BASE}/usr/lib/libQt5;g"
fi
done
}
do_build() {
cd ${wrksrc}/build-x11
make ${makejobs} CC="$CC" CXX="$CXX" LINK="$CXX"
cd ${wrksrc}/build-nox
make ${makejobs} CC="$CC" CXX="$CXX" LINK="$CXX"
}
do_install() {
cd ${wrksrc}/build-x11
make ${makejobs} INSTALL_ROOT=${DESTDIR} install
}
qbittorrent-nox_package() {
short_desc+=" - no X11"
pkg_install() {
cd ${wrksrc}/build-nox
make ${makejobs} INSTALL_ROOT=${PKGDESTDIR} install
}
}