commit:     d5c918f620f0ba3312ed83b2a9cd1c0c59f5a443
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Wed Oct  5 18:47:06 2022 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Wed Oct  5 18:49:11 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d5c918f6

net-p2p/qbittorrent: rework DBUS and SYSTEMD options

The DBUS feature is only relevant when GUI=ON.
The SYSTEMD feature is only relevant when GUI=OFF.

Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 net-p2p/qbittorrent/qbittorrent-4.4.5-r1.ebuild | 27 ++++++++++++-------------
 net-p2p/qbittorrent/qbittorrent-9999.ebuild     | 27 ++++++++++++-------------
 2 files changed, 26 insertions(+), 28 deletions(-)

diff --git a/net-p2p/qbittorrent/qbittorrent-4.4.5-r1.ebuild 
b/net-p2p/qbittorrent/qbittorrent-4.4.5-r1.ebuild
index 86809760e4f7..0e71f8eb646d 100644
--- a/net-p2p/qbittorrent/qbittorrent-4.4.5-r1.ebuild
+++ b/net-p2p/qbittorrent/qbittorrent-4.4.5-r1.ebuild
@@ -56,15 +56,9 @@ src_prepare() {
 src_configure() {
        multibuild_src_configure() {
                local mycmakeargs=(
-                       -DDBUS=$(usex dbus)
-
                        # musl lacks execinfo.h
                        -DSTACKTRACE=$(usex !elibc_musl)
 
-                       # We always want to install unit files
-                       -DSYSTEMD=ON
-                       
-DSYSTEMD_SERVICES_INSTALL_DIR=$(systemd_get_systemunitdir)
-
                        # More verbose build logs are preferable for bug reports
                        -DVERBOSE_CONFIGURE=ON
 
@@ -77,9 +71,20 @@ src_configure() {
                if [[ ${MULTIBUILD_VARIANT} == gui ]]; then
                        # We do this in multibuild, see bug #839531 for why.
                        # Fedora has to do the same thing.
-                       mycmakeargs+=( -DGUI=ON )
+                       mycmakeargs+=(
+                               -DGUI=ON
+                               -DDBUS=$(usex dbus)
+                               -DSYSTEMD=OFF
+                       )
                else
-                       mycmakeargs+=( -DGUI=OFF )
+                       mycmakeargs+=(
+                               -DGUI=OFF
+                               -DDBUS=OFF
+                               # The systemd service calls qbittorrent-nox, 
which is only
+                               # installed when GUI=OFF.
+                               -DSYSTEMD=ON
+                               
-DSYSTEMD_SERVICES_INSTALL_DIR="$(systemd_get_systemunitdir)"
+                       )
                fi
 
                cmake_src_configure
@@ -94,11 +99,5 @@ src_compile() {
 
 src_install() {
        multibuild_foreach_variant cmake_src_install
-
-       if ! use webui ; then
-               # No || die deliberately as it doesn't always exist
-               rm "${D}/$(systemd_get_systemunitdir)"/qbittorrent-nox*.service
-       fi
-
        einstalldocs
 }

diff --git a/net-p2p/qbittorrent/qbittorrent-9999.ebuild 
b/net-p2p/qbittorrent/qbittorrent-9999.ebuild
index dd26453408e2..c6292efff901 100644
--- a/net-p2p/qbittorrent/qbittorrent-9999.ebuild
+++ b/net-p2p/qbittorrent/qbittorrent-9999.ebuild
@@ -57,15 +57,9 @@ src_prepare() {
 src_configure() {
        multibuild_src_configure() {
                local mycmakeargs=(
-                       -DDBUS=$(usex dbus)
-
                        # musl lacks execinfo.h
                        -DSTACKTRACE=$(usex !elibc_musl)
 
-                       # We always want to install unit files
-                       -DSYSTEMD=ON
-                       
-DSYSTEMD_SERVICES_INSTALL_DIR=$(systemd_get_systemunitdir)
-
                        # More verbose build logs are preferable for bug reports
                        -DVERBOSE_CONFIGURE=ON
 
@@ -80,9 +74,20 @@ src_configure() {
                if [[ ${MULTIBUILD_VARIANT} == gui ]] ; then
                        # We do this in multibuild, see bug #839531 for why.
                        # Fedora has to do the same thing.
-                       mycmakeargs+=( -DGUI=ON )
+                       mycmakeargs+=(
+                               -DGUI=ON
+                               -DDBUS=$(usex dbus)
+                               -DSYSTEMD=OFF
+                       )
                else
-                       mycmakeargs+=( -DGUI=OFF )
+                       mycmakeargs+=(
+                               -DGUI=OFF
+                               -DDBUS=OFF
+                               # The systemd service calls qbittorrent-nox, 
which is only
+                               # installed when GUI=OFF.
+                               -DSYSTEMD=ON
+                               
-DSYSTEMD_SERVICES_INSTALL_DIR="$(systemd_get_systemunitdir)"
+                       )
                fi
 
                cmake_src_configure
@@ -106,11 +111,5 @@ src_test() {
 
 src_install() {
        multibuild_foreach_variant cmake_src_install
-
-       if ! use webui ; then
-               # No || die deliberately as it doesn't always exist
-               rm "${D}/$(systemd_get_systemunitdir)"/qbittorrent-nox*.service
-       fi
-
        einstalldocs
 }

Reply via email to