net/qbittorrent: drop autoconf patch, use saner cmake

2023-01-04 Thread Klemens Nanni
(this needs the python.port.mk diff I just sent.)

cmake gets the PREFIX stuff right and, imho, is easier to work with.

Qt5Svg is always REQUIRED in the global cmake file but only used in
src/app/ for Windows and macOS, so make it a build dep.

With cmake the dbus support bits are under 'if (LINUX)', so enable
explicitly to retain notification and power management support.

Both autoconf and cmake pick up  and default-enable
stacktrace printing on crashes so they can be sent upstream, but only
autoconf manages to pass -libexecinfo.

I'll send patches upstream in case future updates don't solve the cmake
bits for dbus and stacktrace.

That one .png is no longer installed but shouldn't matter.
Works as before.

Feedback? Objection? OK?

Index: Makefile.inc
===
RCS file: /cvs/ports/net/qbittorrent/Makefile.inc,v
retrieving revision 1.22
diff -u -p -r1.22 Makefile.inc
--- Makefile.inc7 Aug 2022 09:29:21 -   1.22
+++ Makefile.inc4 Jan 2023 22:07:43 -
@@ -17,11 +17,8 @@ PERMIT_PACKAGE = Yes
 
 MASTER_SITES ?=${MASTER_SITE_SOURCEFORGE:=qbittorrent/}
 
-MODULES += x11/qt5
+MODULES += devel/cmake \
+   x11/qt5
 
-USE_GMAKE =Yes
-
-CONFIGURE_STYLE =   autoreconf
-AUTORECONF =${WRKSRC}/bootstrap.sh
-AUTOCONF_VERSION =  2.69
-AUTOMAKE_VERSION =  1.16
+# for automatic stacktraces on crash:  autoconf links it, cmake does not
+CONFIGURE_ARGS +=  -DCMAKE_EXE_LINKER_FLAGS='${LDFLAGS} -lexecinfo'
Index: qbittorrent/Makefile
===
RCS file: /cvs/ports/net/qbittorrent/qbittorrent/Makefile,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile
--- qbittorrent/Makefile4 Jan 2023 20:01:50 -   1.20
+++ qbittorrent/Makefile4 Jan 2023 22:07:43 -
@@ -1,8 +1,8 @@
 COMMENT =  BitTorrent client with Qt interface
-REVISION = 1
+REVISION = 2
 
-WANTLIB += ${COMPILER_LIBCXX} GL Qt5Core Qt5DBus Qt5Gui Qt5Network
-WANTLIB += Qt5Sql Qt5Svg Qt5Widgets Qt5Xml boost_system-mt c crypto
+WANTLIB += ${COMPILER_LIBCXX} Qt5Core Qt5DBus Qt5Gui Qt5Network
+WANTLIB += Qt5Sql Qt5Widgets Qt5Xml boost_system-mt c crypto
 WANTLIB += execinfo m ssl torrent-rasterbar z
 
 MODULES =  lang/python
@@ -10,19 +10,14 @@ MODULES =   lang/python
 MODPY_BUILDDEP =   No
 MODPY_TESTDEP =No
 
+BUILD_DEPENDS +=   x11/qt5/qtsvg
+
 LIB_DEPENDS += net/libtorrent-rasterbar \
-   devel/boost \
-   x11/qt5/qtsvg
+   devel/boost
 
 RUN_DEPENDS += x11/gtk+3,-guic \
devel/desktop-file-utils
 
-# remove include directives which cause incorrect gmake behavior
-pre-build:
-   @cd ${WRKBUILD}/src && \
-   sed -ie "/^\-include/d" Makefile
-
-pre-install:
-   ${SUBST_CMD} ${WRKSRC}/conf.pri
+CONFIGURE_ARGS +=  -DDBUS=ON
 
 .include 
Index: qbittorrent/patches/patch-conf_pri_in
===
RCS file: qbittorrent/patches/patch-conf_pri_in
diff -N qbittorrent/patches/patch-conf_pri_in
--- qbittorrent/patches/patch-conf_pri_in   11 Mar 2022 19:47:15 -  
1.3
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -1,17 +0,0 @@
-Index: conf.pri.in
 conf.pri.in.orig
-+++ conf.pri.in
-@@ -1,9 +1,9 @@
- # @configure_input@
- 
--PREFIX = @EXPAND_PREFIX@
--BINDIR = @EXPAND_BINDIR@
--DATADIR = @EXPAND_DATADIR@
--MANPREFIX = @EXPAND_MANDIR@
-+PREFIX = ${PREFIX}
-+BINDIR = ${PREFIX}/bin
-+DATADIR = ${PREFIX}/share
-+MANPREFIX = ${PREFIX}/man
- 
- QMAKE_CC = @QBT_CC@
- QMAKE_CXX = @QBT_CXX@
Index: qbittorrent/pkg/PLIST
===
RCS file: /cvs/ports/net/qbittorrent/qbittorrent/pkg/PLIST,v
retrieving revision 1.5
diff -u -p -r1.5 PLIST
--- qbittorrent/pkg/PLIST   8 May 2022 14:40:24 -   1.5
+++ qbittorrent/pkg/PLIST   4 Jan 2023 22:07:43 -
@@ -31,5 +31,3 @@ share/icons/hicolor/scalable/status/qbit
 share/icons/hicolor/scalable/status/qbittorrent-tray.svg
 share/metainfo/
 share/metainfo/org.qbittorrent.qBittorrent.appdata.xml
-share/pixmaps/
-share/pixmaps/qbittorrent.png
Index: qbittorrent-nox/Makefile
===
RCS file: /cvs/ports/net/qbittorrent/qbittorrent-nox/Makefile,v
retrieving revision 1.11
diff -u -p -r1.11 Makefile
--- qbittorrent-nox/Makefile4 Jan 2023 20:01:50 -   1.11
+++ qbittorrent-nox/Makefile4 Jan 2023 22:07:43 -
@@ -1,6 +1,6 @@
 COMMENT =  BitTorrent client with web interface
 PKGNAME =  qbittorrent-nox-${VER}
-REVISION = 0
+REVISION = 1
 
 WANTLIB += ${COMPILER_LIBCXX} Qt5Core Qt5Network Qt5Sql Qt5Xml
 WANTLIB += boost_system-mt c crypto execinfo m ssl torrent-rasterbar
@@

Re: net/qbittorrent: drop autoconf patch, use saner cmake

2023-01-05 Thread Klemens Nanni
Using cmake I have then updated and tested all the versions up to 4.4.5.
They all work, no changes except bumping the version number.

4.5.0 needs libtorrent-rasterbar 2.0.0, but also seems to have
regressions and/or controversial changes.

Switching to Qt6 is a single configure argument and s/5/6/ away, which
fixes visual bugs under Xfce for me.



Re: net/qbittorrent: drop autoconf patch, use saner cmake

2023-01-09 Thread Klemens Nanni
On Wed, Jan 04, 2023 at 10:10:51PM +, Klemens Nanni wrote:
> (this needs the python.port.mk diff I just sent.)

Turns out it doesn't:  If lang/python comes before devel/cmake in
MODULES it is enough to set CONFIGURE_STYLE=cmake to build with cmake.

This is what productivity/ktimetracker (I'm maintainer) already does (:

> cmake gets the PREFIX stuff right and, imho, is easier to work with.
> 
> Qt5Svg is always REQUIRED in the global cmake file but only used in
> src/app/ for Windows and macOS, so make it a build dep.
> 
> With cmake the dbus support bits are under 'if (LINUX)', so enable
> explicitly to retain notification and power management support.
> 
> Both autoconf and cmake pick up  and default-enable
> stacktrace printing on crashes so they can be sent upstream, but only
> autoconf manages to pass -libexecinfo.
> 
> I'll send patches upstream in case future updates don't solve the cmake
> bits for dbus and stacktrace.
> 
> That one .png is no longer installed but shouldn't matter.
> Works as before.

New diff which sets CONFIGURE_STYLE=cmake, rest remains unchanged.
I've already got an OK rsadowski for this, but will wait for Elias.

Feedback? OK?

Index: Makefile.inc
===
RCS file: /cvs/ports/net/qbittorrent/Makefile.inc,v
retrieving revision 1.22
diff -u -p -r1.22 Makefile.inc
--- Makefile.inc7 Aug 2022 09:29:21 -   1.22
+++ Makefile.inc9 Jan 2023 22:12:00 -
@@ -17,11 +17,9 @@ PERMIT_PACKAGE = Yes
 
 MASTER_SITES ?=${MASTER_SITE_SOURCEFORGE:=qbittorrent/}
 
-MODULES += x11/qt5
+MODULES += devel/cmake \
+   x11/qt5
 
-USE_GMAKE =Yes
-
-CONFIGURE_STYLE =   autoreconf
-AUTORECONF =${WRKSRC}/bootstrap.sh
-AUTOCONF_VERSION =  2.69
-AUTOMAKE_VERSION =  1.16
+CONFIGURE_STYLE =  cmake
+# for automatic stacktraces on crash:  autoconf links it, cmake does not
+CONFIGURE_ARGS +=  -DCMAKE_EXE_LINKER_FLAGS='${LDFLAGS} -lexecinfo'
Index: qbittorrent/Makefile
===
RCS file: /cvs/ports/net/qbittorrent/qbittorrent/Makefile,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile
--- qbittorrent/Makefile4 Jan 2023 20:01:50 -   1.20
+++ qbittorrent/Makefile9 Jan 2023 22:05:36 -
@@ -1,8 +1,8 @@
 COMMENT =  BitTorrent client with Qt interface
-REVISION = 1
+REVISION = 2
 
-WANTLIB += ${COMPILER_LIBCXX} GL Qt5Core Qt5DBus Qt5Gui Qt5Network
-WANTLIB += Qt5Sql Qt5Svg Qt5Widgets Qt5Xml boost_system-mt c crypto
+WANTLIB += ${COMPILER_LIBCXX} Qt5Core Qt5DBus Qt5Gui Qt5Network
+WANTLIB += Qt5Sql Qt5Widgets Qt5Xml boost_system-mt c crypto
 WANTLIB += execinfo m ssl torrent-rasterbar z
 
 MODULES =  lang/python
@@ -10,19 +10,14 @@ MODULES =   lang/python
 MODPY_BUILDDEP =   No
 MODPY_TESTDEP =No
 
+BUILD_DEPENDS +=   x11/qt5/qtsvg
+
 LIB_DEPENDS += net/libtorrent-rasterbar \
-   devel/boost \
-   x11/qt5/qtsvg
+   devel/boost
 
 RUN_DEPENDS += x11/gtk+3,-guic \
devel/desktop-file-utils
 
-# remove include directives which cause incorrect gmake behavior
-pre-build:
-   @cd ${WRKBUILD}/src && \
-   sed -ie "/^\-include/d" Makefile
-
-pre-install:
-   ${SUBST_CMD} ${WRKSRC}/conf.pri
+CONFIGURE_ARGS +=  -DDBUS=ON
 
 .include 
Index: qbittorrent/patches/patch-conf_pri_in
===
RCS file: qbittorrent/patches/patch-conf_pri_in
diff -N qbittorrent/patches/patch-conf_pri_in
--- qbittorrent/patches/patch-conf_pri_in   11 Mar 2022 19:47:15 -  
1.3
+++ /dev/null   1 Jan 1970 00:00:00 -
@@ -1,17 +0,0 @@
-Index: conf.pri.in
 conf.pri.in.orig
-+++ conf.pri.in
-@@ -1,9 +1,9 @@
- # @configure_input@
- 
--PREFIX = @EXPAND_PREFIX@
--BINDIR = @EXPAND_BINDIR@
--DATADIR = @EXPAND_DATADIR@
--MANPREFIX = @EXPAND_MANDIR@
-+PREFIX = ${PREFIX}
-+BINDIR = ${PREFIX}/bin
-+DATADIR = ${PREFIX}/share
-+MANPREFIX = ${PREFIX}/man
- 
- QMAKE_CC = @QBT_CC@
- QMAKE_CXX = @QBT_CXX@
Index: qbittorrent/pkg/PLIST
===
RCS file: /cvs/ports/net/qbittorrent/qbittorrent/pkg/PLIST,v
retrieving revision 1.5
diff -u -p -r1.5 PLIST
--- qbittorrent/pkg/PLIST   8 May 2022 14:40:24 -   1.5
+++ qbittorrent/pkg/PLIST   8 Jan 2023 16:49:25 -
@@ -31,5 +31,3 @@ share/icons/hicolor/scalable/status/qbit
 share/icons/hicolor/scalable/status/qbittorrent-tray.svg
 share/metainfo/
 share/metainfo/org.qbittorrent.qBittorrent.appdata.xml
-share/pixmaps/
-share/pixmaps/qbittorrent.png
Index: qbittorrent-nox/Makefile
===
RCS file: /cvs/ports/net/qbittorrent/qbittorrent-nox/Makefile,v
retrieving revision 1.11
dif