void-packages/srcpkgs/qbittorrent/template
Jürgen Buchmüller 9dc56b9edc
qbittorrent: update to 4.1.6
Signed-off-by: Jürgen Buchmüller <pullmoll@t-online.de>
2019-05-12 00:28:59 +02:00

77 lines
2.1 KiB
Bash

# Template file for 'qbittorrent'
pkgname=qbittorrent
version=4.1.6
revision=1
create_wrksrc=yes
build_style=qmake
hostmakedepends="automake libtool pkg-config qt5-host-tools qt5-tools"
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/"
distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}-${version}.tar.xz"
checksum=25c629381454814c9d897693162482de8a049de8745680922b012d46377756a8
if [ "$CROSS_BUILD" ]; then
hostmakedepends+=" qt5-declarative-devel qt5-svg-devel"
fi
do_extract() {
local n=${pkgname}-${version}
mkdir 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}
qmake-qt5 ${configure_args} \
PREFIX=/usr \
LIB=/usr/lib \
QMAKE_CC=$CC QMAKE_CXX=$CXX QMAKE_LINK=$CXX \
QMAKE_CFLAGS="${CFLAGS}" \
QMAKE_CXXFLAGS="${CXXFLAGS}" \
QMAKE_LFLAGS="${LDFLAGS}"
vsed -i src/Makefile \
-e "s;^\(CC\\s*=\) .*;\1 $CC;" \
-e "s;^\(CXX\\s*=\) .*;\1 $CXX;" \
-e "s;^\(LINK\\s*=\) .*;\1 $CXX;" \
-e "s;@g++ ;@$CXX ;"
done
}
do_build() {
cd ${wrksrc}/build-x11
make ${makejobs}
cd ${wrksrc}/build-nox
make ${makejobs}
}
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
}
}