Created attachment 455846 [details, diff] patch for honoring the dbus use variable I try to help out as good as i can and attach a patch for the source: This patch is far beyound from perfection and more a draft because I'm a gentoo newbie. But maybe someone more experienced can improve it a little bit. Especially the hacks in the following 2 files src/device/IDevice.cpp and src/gis/CGisListWks.cpp at the moment work only in the case you *dont* want dbus. Unfortunately I dont know how i can define things in cpp files out from the ebuild... Here's the patch for the ebuild itself diff -ur a/qmapshack-1.7.1.ebuild b/qmapshack-1.7.1.ebuild --- a/qmapshack-1.7.1.ebuild 2016-11-24 17:22:22.000000000 +0100 +++ b/qmapshack-1.7.1.ebuild 2016-12-11 11:28:38.000000000 +0100 @@ -12,15 +12,24 @@ LICENSE="GPL-3+" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="" +IUSE="dbus" RDEPEND="dev-qt/qtwebkit:5 dev-qt/qtscript:5 dev-qt/qtprintsupport:5 - dev-qt/qtdbus:5 + dev-qt/qttest:5 dev-qt/qtnetwork:5[ssl] >=sci-geosciences/routino-3.1.1 sci-libs/gdal - sci-libs/proj" + sci-libs/proj + + dbus? ( dev-qt/qtdbus:5 ) +" + DEPEND="${RDEPEND} dev-qt/linguist-tools:5" + +PATCHES=( + "${FILESDIR}"/${PN}-1.7.1-dbus.patch +) +
Please remove unnecessary blank lines in DEPEND and use tab for indentation. To pass the option the build system, you'll have to add a src_configure section. Take a look at qgis, for example. You should try to get your patch upstreamed, though.
Created attachment 455848 [details, diff] Little typo in first patch -> now corrected In exchange for the first patch
Is there a serious reason to wish to emerge qmapshack without dbus? From your patches to the cpp files I see that qmapshack with USE=dbus will not behave exactly in the same way as the current qmapshack. Please try to contact the upstream. Maybe, they will propose a better solution.
My "serious reason" for this is simply that my whole system runs completely without dbus. https://en.wikipedia.org/wiki/KISS_principle I try to keep my OS as simple as possible and therefor i run gentoo because it has this flexibility...
You can use this flexibility and add your patch to /etc/portage/patches/sci-geosciences/qmapshack/ Then it will be applied on your local system, and not disable some functionality for most qmapshack users (who have dbus). Seriously, such a change should be proposed upstream. Maybe, they will be interested in including it (perhaps, with some modifications) into a future release.
OK. Maybe there is no public interest for this... So I'll develop this further on my local system only. Thanks for the idea with /etc/portage/patches I didn't knew about that - until now Have a nice day :-)
Well maybe there is, and there are examples of packages were DBus is optional upstream - that's where it should be done, and that would greatly improve chances of integrating in Gentoo. Btw from what I can see the CMakeLists.txt does not make Qt5DBus required, which means instead of adding the option you could do something like if(Qt5DBus_FOUND) ... add_definitions(-DHAVE_DBUS) and use that in your ifdefs. I can imagine upstream would prefer that. The ebuild could then disable finding the package through -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Dbus=ON.
Upstream proposes to "add a flag" though... ( https://bitbucket.org/maproom/qmapshack/issues/186/doesnt-compile-without-dbus-on-linux ) Is there a way to change such a flag via the ebuild?
Created attachment 469000 [details] New ebuild for qmapshack-1.8.0
Created attachment 469002 [details, diff] quazip patch for qmapshack-1.8.0
Luckily i got this "upstreamed". (Big thanks again to the devs) See amongst others: ( https://bitbucket.org/maproom/qmapshack/commits/b64bb85b2ce9b244e0fed6ac2e93810a49e9ce5e ) The adaptations are now included in qmapshack-1.8.0. To use this new version in gentoo i created a new ebuild for 1.8.0. To achieve this mostly 3 modifications were necessary: - added quazip as build dependancy - added a patch so that quazip configures properly - finally respect the use flag "dbus" I just added the new ebuild and the quazip patch. I hope, the gentoo community is happy and can use this work :-)
Oh Sh*t. Seems like we just worked in parallel and the new ebuild for 1.8.0 is in gentoo since today 15:48 (but i didn't know about) ;-) So you only have to use the IUSE="dbus" and the src_configure section to fix the "dbus thing" Hope you use it - it works for me!
I think this can be closed. The most recent 1.17.1_p602 has it.
(In reply to Henning Schild from comment #13) > I think this can be closed. The most recent 1.17.1_p602 has it. Yes