commit:     0f1d8f865009ffbd7e822f7deefc022e911aab5e
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 19 20:51:39 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Apr 19 20:52:00 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0f1d8f86

net-p2p/qbittorrent: refine webui/gui logic

Closes: https://bugs.gentoo.org/839531
Thanks-to: maria
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...-4.4.2-r1.ebuild => qbittorrent-4.4.2-r2.ebuild} | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/net-p2p/qbittorrent/qbittorrent-4.4.2-r1.ebuild 
b/net-p2p/qbittorrent/qbittorrent-4.4.2-r2.ebuild
similarity index 84%
rename from net-p2p/qbittorrent/qbittorrent-4.4.2-r1.ebuild
rename to net-p2p/qbittorrent/qbittorrent-4.4.2-r2.ebuild
index b64788d0b71b..75754bfe9170 100644
--- a/net-p2p/qbittorrent/qbittorrent-4.4.2-r1.ebuild
+++ b/net-p2p/qbittorrent/qbittorrent-4.4.2-r2.ebuild
@@ -21,7 +21,8 @@ fi
 LICENSE="GPL-2"
 SLOT="0"
 IUSE="+dbus +gui webui"
-REQUIRED_USE="dbus? ( gui )"
+REQUIRED_USE="dbus? ( gui )
+       || ( gui webui )"
 
 RDEPEND="
        >=dev-libs/boost-1.65.0-r1:=
@@ -47,7 +48,6 @@ DOCS=( AUTHORS Changelog CONTRIBUTING.md README.md TODO )
 
 src_prepare() {
        MULTIBUILD_VARIANTS=( base )
-       use gui && MULTIBUILD_VARIANTS+=( gui )
        use webui && MULTIBUILD_VARIANTS+=( webui )
 
        multibuild_foreach_variant cmake_src_prepare
@@ -73,12 +73,16 @@ src_configure() {
 
                        # We do these in multibuild, see bug #839531 for why
                        # Fedora has to do the same thing.
-                       -DGUI=OFF
-                       -DWEBUI=OFF
+                       -DGUI=$(usex gui)
                )
 
-               if [[ ${MULTIBUILD_VARIANT} != base ]] ; then
-                       mycmakeargs+=( -D${MULTIBUILD_VARIANT^^}=$(usex 
${MULTIBUILD_VARIANT}) )
+               if [[ ${MULTIBUILD_VARIANT} == webui ]] ; then
+                       mycmakeargs+=(
+                               -DGUI=OFF
+                               -DWEBUI=ON
+                       )
+               else
+                       mycmakeargs+=( -DWEBUI=OFF )
                fi
 
                cmake_src_configure
@@ -94,5 +98,10 @@ src_compile() {
 src_install() {
        multibuild_foreach_variant cmake_src_install
 
+       if ! use webui ; then
+               # No || die deliberately as it doesn't always exist
+               rm "${ED}/$(systemd_get_systemunitdir)"/qbittorrent-nox*.service
+       fi
+
        einstalldocs
 }

Reply via email to