Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 602334 - sci-geosciences/qmapshack: Add USE=dbus
Summary: sci-geosciences/qmapshack: Add USE=dbus
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Andrey Grozin
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2016-12-11 12:36 UTC by martin.schmidt13
Modified: 2017-04-02 15:30 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch for honoring the dbus use variable (qmapshack-1.7.1-dbus.patch,4.59 KB, patch)
2016-12-11 12:36 UTC, martin.schmidt13
Details | Diff
Little typo in first patch -> now corrected (qmapshack-1.7.1-dbus.patch,4.59 KB, patch)
2016-12-11 12:49 UTC, martin.schmidt13
Details | Diff
New ebuild for qmapshack-1.8.0 (qmapshack-1.8.0.ebuild,904 bytes, text/plain)
2017-04-02 15:18 UTC, martin.schmidt13
Details
quazip patch for qmapshack-1.8.0 (qmapshack-1.8.0-quazip.patch,548 bytes, patch)
2017-04-02 15:19 UTC, martin.schmidt13
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description martin.schmidt13 2016-12-11 12:36:37 UTC
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
+)
+
Comment 1 Andreas Sturmlechner gentoo-dev 2016-12-11 12:46:04 UTC
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.
Comment 2 martin.schmidt13 2016-12-11 12:49:15 UTC
Created attachment 455848 [details, diff]
Little typo in first patch -> now corrected

In exchange for the first patch
Comment 3 Andrey Grozin gentoo-dev 2016-12-11 13:26:52 UTC
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.
Comment 4 martin.schmidt13 2016-12-11 13:53:46 UTC
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...
Comment 5 Andrey Grozin gentoo-dev 2016-12-11 14:22:17 UTC
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.
Comment 6 martin.schmidt13 2016-12-11 14:57:32 UTC
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 :-)
Comment 7 Andreas Sturmlechner gentoo-dev 2016-12-11 17:06:36 UTC
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.
Comment 8 martin.schmidt13 2016-12-14 08:55:15 UTC
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?
Comment 9 martin.schmidt13 2017-04-02 15:18:00 UTC
Created attachment 469000 [details]
New ebuild for qmapshack-1.8.0
Comment 10 martin.schmidt13 2017-04-02 15:19:01 UTC
Created attachment 469002 [details, diff]
quazip patch for qmapshack-1.8.0
Comment 11 martin.schmidt13 2017-04-02 15:20:32 UTC
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 :-)
Comment 12 martin.schmidt13 2017-04-02 15:30:28 UTC
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!