Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[mkvtoolnix] dbus dependency removal question
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
sdauth
Apprentice
Apprentice


Joined: 19 Sep 2018
Posts: 195
Location: Ásgarðr

PostPosted: Sun Aug 25, 2019 3:12 am    Post subject: [mkvtoolnix] dbus dependency removal question Reply with quote

Hello,

mkvtoolnix-29.0.0 ebuild introduced a dependency for dev-qt/qtdbus:5 (was not needed before) if you use the GUI.
I noticed that the qtdbus dependency is related to mkvtoolnix-gui/util/sleep_inhibitor.cpp
So I removed the sleep_inhibitor code depending on qtdbus, created a patch and tried it on latest stable (mkvtoolnix 35.0)
I can finally compile it and run it without issue on my dbus-less setup.

So my question is, would code removal like this be considered acceptable to write a new ebuild with "IUSE="dbus [...]" etc.. ? Or would it be better to open a bug on mkvtoolnix so that the developer introduces a way to disable the "sleep_inhibitor" at configure stage so that qtdbus is not needed at all ?

thanks :wink:
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 24652
Location: here

PostPosted: Sun Aug 25, 2019 6:08 am    Post subject: Re: [mkvtoolnix] dbus dependency removal question Reply with quote

sdauth wrote:
So my question is, would code removal like this be considered acceptable to write a new ebuild with "IUSE="dbus [...]" etc.. ? Or would it be better to open a bug on mkvtoolnix so that the developer introduces a way to disable the "sleep_inhibitor" at configure stage so that qtdbus is not needed at all ?

The best solution is tell upstream, because every new version developer must test package and also the patch (and recreate it if not work)
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7447

PostPosted: Sun Aug 25, 2019 8:20 am    Post subject: Reply with quote

too late :)

- latest stable is 35.0.0
- with a qt5 useflag to disable that dep
https://packages.gentoo.org/packages/media-video/mkvtoolnix
Back to top
View user's profile Send private message
sdauth
Apprentice
Apprentice


Joined: 19 Sep 2018
Posts: 195
Location: Ásgarðr

PostPosted: Sun Aug 25, 2019 12:36 pm    Post subject: Reply with quote

fedeliallalinea wrote:
sdauth wrote:
So my question is, would code removal like this be considered acceptable to write a new ebuild with "IUSE="dbus [...]" etc.. ? Or would it be better to open a bug on mkvtoolnix so that the developer introduces a way to disable the "sleep_inhibitor" at configure stage so that qtdbus is not needed at all ?

The best solution is tell upstream, because every new version developer must test package and also the patch (and recreate it if not work)


Alright, that's what I thought. Much better to tell dev. :wink: (I'm too lazy right now to create an other account on github or whatever just to report it.. :lol: )

krinn wrote:
too late :)

- latest stable is 35.0.0
- with a qt5 useflag to disable that dep
https://packages.gentoo.org/packages/media-video/mkvtoolnix


But I want qt5, just without qt5dbus. Removing sleep_inhibitor.cpp seems to be the only way to get rid of it if you want to use the Qt5 gui on a dbus-less system.

Thanks to both of you, I'll update this thread later. Or even open a bug for ebuild update if there is a resolution for it upstream.
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 5847
Location: Removed by Neddy

PostPosted: Sun Aug 25, 2019 1:23 pm    Post subject: Reply with quote

Approach upstream to see if they would incorporate it as a make option. Users can apply such patches via /etc/portage/... quite easily so asking Gentoo to modify upstream for additional functionality would cause some maintenance overhead issues
_________________
The best argument against democracy is a five-minute conversation with the average voter
Great Britain is a republic, with a hereditary president, while the United States is a monarchy with an elective king
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 4877
Location: Dallas area

PostPosted: Sun Aug 25, 2019 1:49 pm    Post subject: Reply with quote

I copied the ebuild to my local directory and modifed it, and have a patch to do away with the need for qtdbus.

To make it work remove the qtdbus dependency

Delete from the ebuild -> dev-qt/qtdbus:5
Code:
--- /usr/portage/media-video/mkvtoolnix/mkvtoolnix-35.0.0.ebuild   2019-07-23 03:39:41.000000000 -0500
+++ ./mkvtoolnix-35.0.0.ebuild   2019-07-24 04:37:18.951525029 -0500
@@ -34,7 +34,6 @@
    sys-libs/zlib
    qt5? (
       dev-qt/qtcore:5
-      dev-qt/qtdbus:5
       dev-qt/qtgui:5
       dev-qt/qtnetwork:5
       dev-qt/qtwidgets:5


run ebuild <ebuild name> digest to update Manifest

Add this patch http://dpaste.com/3MG8564 to /etc/portage/patches/media-video/mkvtoolnix-35.0.0/
_________________
PRIME x570-pro, 3700x, RX 550 - 5.8 zen kernel
Acer E5-575 (laptop), i3-7100u - i965 - 5.5 zen kernel
---both---
gcc 9.3.0, profile 17.1 (no-pie & modified) amd64-no-multilib, eudev, openrc, openbox, palemoon


Last edited by Anon-E-moose on Sun Aug 25, 2019 1:56 pm; edited 1 time in total
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 24652
Location: here

PostPosted: Sun Aug 25, 2019 1:56 pm    Post subject: Reply with quote

Why anyone open a upstream bug?
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
sdauth
Apprentice
Apprentice


Joined: 19 Sep 2018
Posts: 195
Location: Ásgarðr

PostPosted: Wed Aug 28, 2019 4:40 pm    Post subject: Reply with quote

Anon-E-moose wrote:
I copied the ebuild to my local directory and modifed it, and have a patch to do away with the need for qtdbus.

To make it work remove the qtdbus dependency

Delete from the ebuild -> dev-qt/qtdbus:5
Code:
--- /usr/portage/media-video/mkvtoolnix/mkvtoolnix-35.0.0.ebuild   2019-07-23 03:39:41.000000000 -0500
+++ ./mkvtoolnix-35.0.0.ebuild   2019-07-24 04:37:18.951525029 -0500
@@ -34,7 +34,6 @@
    sys-libs/zlib
    qt5? (
       dev-qt/qtcore:5
-      dev-qt/qtdbus:5
       dev-qt/qtgui:5
       dev-qt/qtnetwork:5
       dev-qt/qtwidgets:5


run ebuild <ebuild name> digest to update Manifest

Add this patch http://dpaste.com/3MG8564 to /etc/portage/patches/media-video/mkvtoolnix-35.0.0/


Thank you Anon-E-moose, your workaround is much better than mine as it only disables qtdbus dep in ebuild and in "configure" (no need to remove bunch of code (sleepinhibitor.cpp) as in my patch)
I followed your steps and it compiled just fine with USE="-dbus qt5"
The Qt5 gui is working fine. :)

So the current official ebuild could be updated so that the qtdbus is considered as optional if one selects USE="-dbus qt5" and it automatically applies the patch for 'configure" to disable the need for qtdbus dependency. As it doesn't touch the code, it should be acceptable, isn't it ?

PS : Also, thanks for making me discover /etc/portage/patches, I didn't know about it. Very handy. 8)
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 24652
Location: here

PostPosted: Wed Aug 28, 2019 4:54 pm    Post subject: Reply with quote

sdauth wrote:
So the current official ebuild could be updated so that the qtdbus is considered as optional if one selects USE="-dbus qt5" and it automatically applies the patch for 'configure" to disable the need for qtdbus dependency. As it doesn't touch the code, it should be acceptable, isn't it ?

No because you should create a patch on official code, then is upstream that should change package for optional disable dbus
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
sdauth
Apprentice
Apprentice


Joined: 19 Sep 2018
Posts: 195
Location: Ásgarðr

PostPosted: Wed Aug 28, 2019 5:24 pm    Post subject: Reply with quote

fedeliallalinea wrote:
sdauth wrote:
So the current official ebuild could be updated so that the qtdbus is considered as optional if one selects USE="-dbus qt5" and it automatically applies the patch for 'configure" to disable the need for qtdbus dependency. As it doesn't touch the code, it should be acceptable, isn't it ?

No because you should create a patch on official code, then is upstream that should change package for optional disable dbus

Ok, it makes sense since it touches "configure" and needs to be tested. So go back to step 1.

Anyone with a gitlab account willing to report the bug ? I don't have one and don't want to create one. (too many account already.. :lol: )
https://gitlab.com/mbunkus/mkvtoolnix/issues
thanks in advance :wink:
Back to top
View user's profile Send private message
Koyan
n00b
n00b


Joined: 07 Nov 2014
Posts: 8

PostPosted: Thu Sep 05, 2019 11:25 am    Post subject: Reply with quote

Anon-E-moose wrote:
Add this patch http://dpaste.com/3MG8564 to /etc/portage/patches/media-video/mkvtoolnix-35.0.0/


Thanks for this! But unfortunately the patch isn't available anymore on dpaste.com. Could you reupload it for me please?
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 4877
Location: Dallas area

PostPosted: Thu Sep 05, 2019 11:47 am    Post subject: Reply with quote

The key is the undef QTDBUS

Code:
$ cat /etc/portage/patches/media-video/mkvtoolnix-35.0.0/configure.patch
--- 1/configure   2019-03-07 12:52:33.594252613 -0600
+++ 2/configure   2019-03-07 12:57:28.576229245 -0600
@@ -1,4 +1,4 @@
-#! /bin/sh
+
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.69 for MKVToolNix 29.0.0.
 #
@@ -9287,7 +9287,7 @@
   with_qt_pkg_config_modules="$with_qt_pkg_config_modules,Qt5DBus"
 fi
 
-$as_echo "#define HAVE_QTDBUS 1" >>confdefs.h
+$as_echo "#undef HAVE_QTDBUS" >>confdefs.h
 
     fi

_________________
PRIME x570-pro, 3700x, RX 550 - 5.8 zen kernel
Acer E5-575 (laptop), i3-7100u - i965 - 5.5 zen kernel
---both---
gcc 9.3.0, profile 17.1 (no-pie & modified) amd64-no-multilib, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
Koyan
n00b
n00b


Joined: 07 Nov 2014
Posts: 8

PostPosted: Thu Sep 05, 2019 1:17 pm    Post subject: Reply with quote

Anon-E-moose wrote:
The key is the undef QTDBUS


Thank you!
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 4877
Location: Dallas area

PostPosted: Thu Sep 05, 2019 5:50 pm    Post subject: Reply with quote

Actually it doesn't need the first part of the configure patch.

So this is what's needed to modify mkvtoolnix to get rid of qtdbus/dbus.

Copy ebuild to local repo
apply this patch

Code:
--- mkvtoolnix-35.0.0.ebuild   2019-07-23 03:39:41.000000000 -0500
+++ /usr/local/portage/media-video/mkvtoolnix/mkvtoolnix-35.0.0.ebuild   2019-07-24 04:37:18.951525029 -0500
@@ -34,7 +34,6 @@
    sys-libs/zlib
    qt5? (
       dev-qt/qtcore:5
-      dev-qt/qtdbus:5
       dev-qt/qtgui:5
       dev-qt/qtnetwork:5
       dev-qt/qtwidgets:5




Put this patch in /etc/portage/patches/media-video/mkvtoolnix/

Code:
$ cat /etc/portage/patches/media-video/mkvtoolnix/configure.patch
--- 1/configure   2019-03-07 12:52:33.594252613 -0600
+++ 2/configure   2019-03-07 12:57:28.576229245 -0600
@@ -9287,7 +9287,7 @@
   with_qt_pkg_config_modules="$with_qt_pkg_config_modules,Qt5DBus"
 fi
 
-$as_echo "#define HAVE_QTDBUS 1" >>confdefs.h
+$as_echo "#undef HAVE_QTDBUS" >>confdefs.h
 
     fi


All done. Emerge & Enjoy
_________________
PRIME x570-pro, 3700x, RX 550 - 5.8 zen kernel
Acer E5-575 (laptop), i3-7100u - i965 - 5.5 zen kernel
---both---
gcc 9.3.0, profile 17.1 (no-pie & modified) amd64-no-multilib, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
sdauth
Apprentice
Apprentice


Joined: 19 Sep 2018
Posts: 195
Location: Ásgarðr

PostPosted: Tue Jul 28, 2020 2:58 pm    Post subject: Reply with quote

Even though it's not that bad to use the small configure.patch (and copy mkvtoolnix to localrepo to remove qtdbus USE flag), I opened a bug on mkvtoolnix git : https://gitlab.com/mbunkus/mkvtoolnix/-/issues/2886

Unfortunately, I don't have the knowledge to create the needed patch. But Moritz is willing to integrate it.

@Moritz Bunkus
Code:
DBus-Support is already optional, or it should be. configure tries to detect it and uses it if it's present.
If you want something else (e.g. arguments to configure for turning off said detection), please provide patches. I'm not going to work on that myself. Are you willing to do that?


Code:
Alrighty. If someone comes up with a patch (shouldn't be too hard, just make the check optional in ac/qt5.m4 similar to how other features are gated via AC_ARG_ENABLE), I'll gladly integrate it.


Let me know if you have an idea. It would be great so we can get rid of extra patch, copying ebuild to localrepo.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3514

PostPosted: Tue Jul 28, 2020 3:12 pm    Post subject: Reply with quote

sdauth wrote:
Let me know if you have an idea. It would be great so we can get rid of extra patch, copying ebuild to localrepo.

Why don't you create a pull request for the latest version of mkvtoolnix adding that patch with an appropriate USE flag?
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 4877
Location: Dallas area

PostPosted: Tue Jul 28, 2020 3:13 pm    Post subject: Reply with quote

$ wgetpaste /etc/portage/patches/media-video/makemkv/configure.patch
Your paste can be seen here: https://dpaste.com/2BJGK948J

$ wgetpaste /etc/portage/patches/media-video/mkvtoolnix/configure.patch
Your paste can be seen here: https://dpaste.com/E8RMDASD7

I use the patch only for both makemkv and mkvtoolnix (similar problem, ie unwanted dbus)

Edit to add: I also added this to package.provided (satisfy the ebuild without having to make a local copy and edit)
dev-qt/qtdbus-5.14.2


I've been doing this for the last year or so's worth of releases with no problem

ETA2: the reasoning for an entry in package.provided is that either you use dbus OR you don't, you won't want to use it part of the time (doesn't make sense).
_________________
PRIME x570-pro, 3700x, RX 550 - 5.8 zen kernel
Acer E5-575 (laptop), i3-7100u - i965 - 5.5 zen kernel
---both---
gcc 9.3.0, profile 17.1 (no-pie & modified) amd64-no-multilib, eudev, openrc, openbox, palemoon


Last edited by Anon-E-moose on Tue Jul 28, 2020 3:31 pm; edited 1 time in total
Back to top
View user's profile Send private message
sdauth
Apprentice
Apprentice


Joined: 19 Sep 2018
Posts: 195
Location: Ásgarðr

PostPosted: Tue Jul 28, 2020 3:24 pm    Post subject: Reply with quote

charles17 wrote:

Why don't you create a pull request for the latest version of mkvtoolnix adding that patch with an appropriate USE flag?


fedeliallalinea wrote:
sdauth wrote:
So the current official ebuild could be updated so that the qtdbus is considered as optional if one selects USE="-dbus qt5" and it automatically applies the patch for 'configure" to disable the need for qtdbus dependency. As it doesn't touch the code, it should be acceptable, isn't it ?

No because you should create a patch on official code, then is upstream that should change package for optional disable dbus


So I wonder what to do. Anon-E-moose's patch (thanks) works just fine (I use it for months now across multiple releases) but fedeliallalinea says it should be integrated upstream ? Sorry it that's silly question.
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 4877
Location: Dallas area

PostPosted: Tue Jul 28, 2020 3:29 pm    Post subject: Reply with quote

It would be preferable for upstream to have a configure option, AND it would be preferable for gentoo devs to add a use flag switch.

Having said that, I don't bother trying to tilt against windmills (ie get either upstream or gentoo devs to fix something), not worth my time, so I use local patches and overrides, which is what they're there for. When and if, upstream/gentoo devs make the changes then I'll modify/abolish my patches on my system.
_________________
PRIME x570-pro, 3700x, RX 550 - 5.8 zen kernel
Acer E5-575 (laptop), i3-7100u - i965 - 5.5 zen kernel
---both---
gcc 9.3.0, profile 17.1 (no-pie & modified) amd64-no-multilib, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3514

PostPosted: Tue Jul 28, 2020 3:46 pm    Post subject: Reply with quote

sdauth wrote:
... but fedeliallalinea says it should be integrated upstream ? Sorry it that's silly question.

Even if integrated upstream, the ebuild should receive the USE flag switch
Code:
   dvd? ( media-libs/libdvdread:= )
   qt5? (
      dbus? ( dev-qt/qtdbus:5 )
      dev-qt/qtcore:5
      dev-qt/qtgui:5
      dev-qt/qtnetwork:5
      dev-qt/qtwidgets:5
      dev-qt/qtconcurrent:5
      dev-qt/qtmultimedia:5
      app-text/cmark:0=
   )
Back to top
View user's profile Send private message
sdauth
Apprentice
Apprentice


Joined: 19 Sep 2018
Posts: 195
Location: Ásgarðr

PostPosted: Tue Jul 28, 2020 4:34 pm    Post subject: Reply with quote

Anon-E-moose wrote:
It would be preferable for upstream to have a configure option, AND it would be preferable for gentoo devs to add a use flag switch.

Having said that, I don't bother trying to tilt against windmills (ie get either upstream or gentoo devs to fix something), not worth my time, so I use local patches and overrides, which is what they're there for. When and if, upstream/gentoo devs make the changes then I'll modify/abolish my patches on my system.


Indeed. Well, I usually use some patches myself as well but today, I noticed that xdg-utils finally received that dbus use flag a few days ago. 8) So I remembered the mkvtoolnix case.. :o

charles17 wrote:
sdauth wrote:
... but fedeliallalinea says it should be integrated upstream ? Sorry it that's silly question.

Even if integrated upstream, the ebuild should receive the USE flag switch
Code:
   dvd? ( media-libs/libdvdread:= )
   qt5? (
      dbus? ( dev-qt/qtdbus:5 )
      dev-qt/qtcore:5
      dev-qt/qtgui:5
      dev-qt/qtnetwork:5
      dev-qt/qtwidgets:5
      dev-qt/qtconcurrent:5
      dev-qt/qtmultimedia:5
      app-text/cmark:0=
   )


I see. Thanks. Is the following ok ? Not sure if that's the correct way to apply the patch (?) (for the case it would be accepted by Gentoo, otherwise I just put it /etc/portage/patches with the modified ebuild in my localrepo of course)

Code:
--- /var/db/repos/gentoo/media-video/mkvtoolnix/mkvtoolnix-48.0.0.ebuild   2020-06-30 05:09:06.000000000 +0200
+++ mkvtoolnix-48.0.0.ebuild   2020-07-28 18:31:23.889610948 +0200
@@ -19,7 +19,7 @@
 
 LICENSE="GPL-2"
 SLOT="0"
-IUSE="debug dvd nls pch test qt5"
+IUSE="dbus debug dvd nls pch test qt5"
 RESTRICT="!test? ( test )"
 
 # check NEWS.md for build system changes entries for boost/libebml/libmatroska
@@ -37,8 +37,8 @@
    sys-libs/zlib
    dvd? ( media-libs/libdvdread:= )
    qt5? (
+    dbus? ( dev-qt/qtdbus:5 )
       dev-qt/qtcore:5
-      dev-qt/qtdbus:5
       dev-qt/qtgui:5
       dev-qt/qtnetwork:5
       dev-qt/qtwidgets:5
@@ -90,6 +90,10 @@
       --with-boost-libdir="${ESYSROOT}"/usr/$(get_libdir)
    )
 
+  if use !dbus ; then
+    epatch "${FILESDIR}/${P}-undef-qtdbus.patch"
+  fi
+
    if use qt5 ; then
       # ac/qt5.m4 finds default Qt version set by qtchooser, bug #532600
       myeconfargs+=(
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3514

PostPosted: Tue Jul 28, 2020 8:54 pm    Post subject: Reply with quote

sdauth wrote:
I see. Thanks. Is the following ok ? Not sure if that's the correct way to apply the patch (?) (for the case it would be accepted by Gentoo, otherwise I just put it /etc/portage/patches with the modified ebuild in my localrepo of course)

As was done in https://github.com/gentoo/gentoo/pull/16815 you should provide the modified ebuild as a whole.
You could ebump mkvtoolnix-48.0.0.ebuild and change the -r1 to your needs.

The line use !dbus && eapply "${FILESDIR}"/${P}-undef-qtdbus.patch goes into src_prepare().

Gentoo GitHub!
Back to top
View user's profile Send private message
sdauth
Apprentice
Apprentice


Joined: 19 Sep 2018
Posts: 195
Location: Ásgarðr

PostPosted: Wed Jul 29, 2020 1:23 am    Post subject: Reply with quote

Thanks charles17, I opened a pull request : https://github.com/gentoo/gentoo/pull/16889
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3514

PostPosted: Wed Jul 29, 2020 5:09 am    Post subject: Reply with quote

sdauth wrote:
Thanks charles17, I opened a pull request : https://github.com/gentoo/gentoo/pull/16889

You need to rebase and get all in one single commit.
Back to top
View user's profile Send private message
sdauth
Apprentice
Apprentice


Joined: 19 Sep 2018
Posts: 195
Location: Ásgarðr

PostPosted: Wed Jul 29, 2020 10:15 am    Post subject: Reply with quote

charles17 wrote:
sdauth wrote:
Thanks charles17, I opened a pull request : https://github.com/gentoo/gentoo/pull/16889

You need to rebase and get all in one single commit.


Someone commented :
Code:
Is this patch upstream or in the process of being upstreamed? The fact that it is a conditional patch indicates it is not upstreamable, and Gentoo can't accept it.

So it seems we have the confirmation that it needs to be solved upstream.

This is why I added two commit in fact. One to add dbus flag, one to add the patch and src_prepare "epatch". So now not sure what the next step is. Well at least I learned a bit of git I guess :lol:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum