View previous topic :: View next topic |
Author |
Message |
sdauth l33t
Joined: 19 Sep 2018 Posts: 659 Location: Ásgarðr
|
Posted: Sun Aug 25, 2019 3:12 am Post subject: [mkvtoolnix] dbus dependency removal question |
|
|
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 |
|
Back to top |
|
|
fedeliallalinea Administrator
Joined: 08 Mar 2003 Posts: 31325 Location: here
|
Posted: Sun Aug 25, 2019 6:08 am Post subject: Re: [mkvtoolnix] dbus dependency removal question |
|
|
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 |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
|
Back to top |
|
|
sdauth l33t
Joined: 19 Sep 2018 Posts: 659 Location: Ásgarðr
|
Posted: Sun Aug 25, 2019 12:36 pm Post subject: |
|
|
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. (I'm too lazy right now to create an other account on github or whatever just to report it.. )
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 |
|
|
Naib Watchman
Joined: 21 May 2004 Posts: 6069 Location: Removed by Neddy
|
Posted: Sun Aug 25, 2019 1:23 pm Post subject: |
|
|
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 _________________ #define HelloWorld int
#define Int main()
#define Return printf
#define Print return
#include <stdio>
HelloWorld Int {
Return("Hello, world!\n");
Print 0; |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6170 Location: Dallas area
|
Posted: Sun Aug 25, 2019 1:49 pm Post subject: |
|
|
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/ _________________ UM780, 6.1 zen kernel, gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Last edited by Anon-E-moose on Sun Aug 25, 2019 1:56 pm; edited 1 time in total |
|
Back to top |
|
|
fedeliallalinea Administrator
Joined: 08 Mar 2003 Posts: 31325 Location: here
|
Posted: Sun Aug 25, 2019 1:56 pm Post subject: |
|
|
Why anyone open a upstream bug? _________________ Questions are guaranteed in life; Answers aren't. |
|
Back to top |
|
|
sdauth l33t
Joined: 19 Sep 2018 Posts: 659 Location: Ásgarðr
|
Posted: Wed Aug 28, 2019 4:40 pm Post subject: |
|
|
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. |
|
Back to top |
|
|
fedeliallalinea Administrator
Joined: 08 Mar 2003 Posts: 31325 Location: here
|
Posted: Wed Aug 28, 2019 4:54 pm Post subject: |
|
|
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 |
|
|
sdauth l33t
Joined: 19 Sep 2018 Posts: 659 Location: Ásgarðr
|
Posted: Wed Aug 28, 2019 5:24 pm Post subject: |
|
|
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.. )
https://gitlab.com/mbunkus/mkvtoolnix/issues
thanks in advance |
|
Back to top |
|
|
Koyan n00b
Joined: 07 Nov 2014 Posts: 32
|
Posted: Thu Sep 05, 2019 11:25 am Post subject: |
|
|
Thanks for this! But unfortunately the patch isn't available anymore on dpaste.com. Could you reupload it for me please? |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6170 Location: Dallas area
|
Posted: Thu Sep 05, 2019 11:47 am Post subject: |
|
|
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 |
_________________ UM780, 6.1 zen kernel, gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
Koyan n00b
Joined: 07 Nov 2014 Posts: 32
|
Posted: Thu Sep 05, 2019 1:17 pm Post subject: |
|
|
Anon-E-moose wrote: | The key is the undef QTDBUS |
Thank you! |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6170 Location: Dallas area
|
Posted: Thu Sep 05, 2019 5:50 pm Post subject: |
|
|
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 _________________ UM780, 6.1 zen kernel, gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
sdauth l33t
Joined: 19 Sep 2018 Posts: 659 Location: Ásgarðr
|
Posted: Tue Jul 28, 2020 2:58 pm Post subject: |
|
|
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 |
|
|
charles17 Advocate
Joined: 02 Mar 2008 Posts: 3685
|
Posted: Tue Jul 28, 2020 3:12 pm Post subject: |
|
|
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 |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6170 Location: Dallas area
|
Posted: Tue Jul 28, 2020 3:13 pm Post subject: |
|
|
$ 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). _________________ UM780, 6.1 zen kernel, gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Last edited by Anon-E-moose on Tue Jul 28, 2020 3:31 pm; edited 1 time in total |
|
Back to top |
|
|
sdauth l33t
Joined: 19 Sep 2018 Posts: 659 Location: Ásgarðr
|
Posted: Tue Jul 28, 2020 3:24 pm Post subject: |
|
|
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 |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6170 Location: Dallas area
|
Posted: Tue Jul 28, 2020 3:29 pm Post subject: |
|
|
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. _________________ UM780, 6.1 zen kernel, gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
charles17 Advocate
Joined: 02 Mar 2008 Posts: 3685
|
Posted: Tue Jul 28, 2020 3:46 pm Post subject: |
|
|
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 |
|
|
sdauth l33t
Joined: 19 Sep 2018 Posts: 659 Location: Ásgarðr
|
Posted: Tue Jul 28, 2020 4:34 pm Post subject: |
|
|
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. So I remembered the mkvtoolnix case..
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 |
|
|
charles17 Advocate
Joined: 02 Mar 2008 Posts: 3685
|
Posted: Tue Jul 28, 2020 8:54 pm Post subject: |
|
|
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 |
|
|
sdauth l33t
Joined: 19 Sep 2018 Posts: 659 Location: Ásgarðr
|
|
Back to top |
|
|
charles17 Advocate
Joined: 02 Mar 2008 Posts: 3685
|
Posted: Wed Jul 29, 2020 5:09 am Post subject: |
|
|
You need to rebase and get all in one single commit. |
|
Back to top |
|
|
sdauth l33t
Joined: 19 Sep 2018 Posts: 659 Location: Ásgarðr
|
Posted: Wed Jul 29, 2020 10:15 am Post subject: |
|
|
charles17 wrote: |
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 |
|
Back to top |
|
|
|