1 |
commit: 612ad41ff7c2e1766aa2e9e807f142fe256b1ce6 |
2 |
Author: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jan 30 08:12:52 2023 +0000 |
4 |
Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jan 30 08:19:39 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=612ad41f |
7 |
|
8 |
sci-geosciences/gpsbabel: drop use gui, add use qt6 |
9 |
|
10 |
Though the build system provides separate targets for |
11 |
the gui and cli tools, the cmake configure files do not |
12 |
reflect this and they will search for qt unconditionally. |
13 |
Patching is non-trivial because the source files for the |
14 |
gui and for the cli are not completely separated. |
15 |
|
16 |
The package does support qt6 but the upstream cmake files |
17 |
do not provide a means of selecting which to use and will |
18 |
choose a version automagically. A simple patch is enough |
19 |
to fix this. |
20 |
|
21 |
Closes: https://bugs.gentoo.org/852836 |
22 |
Closes: https://bugs.gentoo.org/892559 |
23 |
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org> |
24 |
|
25 |
.../gpsbabel-1.8.0-no-automagic-qt5-qt6.patch | 34 +++++++++++++++ |
26 |
...babel-1.8.0.ebuild => gpsbabel-1.8.0-r1.ebuild} | 48 ++++++++++++++-------- |
27 |
2 files changed, 64 insertions(+), 18 deletions(-) |
28 |
|
29 |
diff --git a/sci-geosciences/gpsbabel/files/gpsbabel-1.8.0-no-automagic-qt5-qt6.patch b/sci-geosciences/gpsbabel/files/gpsbabel-1.8.0-no-automagic-qt5-qt6.patch |
30 |
new file mode 100644 |
31 |
index 000000000000..47a1a37e1ba3 |
32 |
--- /dev/null |
33 |
+++ b/sci-geosciences/gpsbabel/files/gpsbabel-1.8.0-no-automagic-qt5-qt6.patch |
34 |
@@ -0,0 +1,34 @@ |
35 |
+diff --git a/CMakeLists.txt b/CMakeLists.txt |
36 |
+index 2a7d805..65bd4db 100644 |
37 |
+--- a/CMakeLists.txt |
38 |
++++ b/CMakeLists.txt |
39 |
+@@ -26,7 +26,11 @@ set(CMAKE_AUTORCC ON) |
40 |
+ add_executable(gpsbabel) |
41 |
+ |
42 |
+ # Find the QtCore library |
43 |
+-find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED) |
44 |
++if(USE_QT6) |
45 |
++ find_package(QT NAMES Qt6 COMPONENTS Core REQUIRED) |
46 |
++else() |
47 |
++ find_package(QT NAMES Qt5 COMPONENTS Core REQUIRED) |
48 |
++endif() |
49 |
+ find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED) |
50 |
+ list(APPEND QT_LIBRARIES Qt${QT_VERSION_MAJOR}::Core) |
51 |
+ if(${Qt${QT_VERSION_MAJOR}Core_VERSION} VERSION_LESS 5.12) |
52 |
+diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt |
53 |
+index 4c839c2..ac329dd 100644 |
54 |
+--- a/gui/CMakeLists.txt |
55 |
++++ b/gui/CMakeLists.txt |
56 |
+@@ -23,7 +23,11 @@ endif() |
57 |
+ add_executable(${TARGET} WIN32 MACOSX_BUNDLE) |
58 |
+ |
59 |
+ # Find the QtCore library |
60 |
+-find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED) |
61 |
++if(USE_QT6) |
62 |
++ find_package(QT NAMES Qt6 COMPONENTS Core REQUIRED) |
63 |
++else() |
64 |
++ find_package(QT NAMES Qt5 COMPONENTS Core REQUIRED) |
65 |
++endif() |
66 |
+ find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Network SerialPort Widgets Xml REQUIRED) |
67 |
+ list(APPEND QT_LIBRARIES Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Network Qt${QT_VERSION_MAJOR}::SerialPort Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Xml) |
68 |
+ if(${Qt${QT_VERSION_MAJOR}Core_VERSION} VERSION_LESS 5.12) |
69 |
|
70 |
diff --git a/sci-geosciences/gpsbabel/gpsbabel-1.8.0.ebuild b/sci-geosciences/gpsbabel/gpsbabel-1.8.0-r1.ebuild |
71 |
similarity index 68% |
72 |
rename from sci-geosciences/gpsbabel/gpsbabel-1.8.0.ebuild |
73 |
rename to sci-geosciences/gpsbabel/gpsbabel-1.8.0-r1.ebuild |
74 |
index 47952f41dd2f..cfe639e603e8 100644 |
75 |
--- a/sci-geosciences/gpsbabel/gpsbabel-1.8.0.ebuild |
76 |
+++ b/sci-geosciences/gpsbabel/gpsbabel-1.8.0-r1.ebuild |
77 |
@@ -23,7 +23,7 @@ fi |
78 |
|
79 |
LICENSE="GPL-2" |
80 |
SLOT="0" |
81 |
-IUSE="doc gui" |
82 |
+IUSE="doc qt6" |
83 |
|
84 |
BDEPEND=" |
85 |
virtual/pkgconfig |
86 |
@@ -32,29 +32,42 @@ BDEPEND=" |
87 |
dev-lang/perl |
88 |
dev-libs/libxslt |
89 |
) |
90 |
- gui? ( dev-qt/linguist-tools:5 ) |
91 |
+ !qt6? ( dev-qt/linguist-tools:5 ) |
92 |
+ qt6? ( dev-qt/qttools:6[linguist] ) |
93 |
" |
94 |
-# Even with gui disabled, still links with qtcore |
95 |
+ |
96 |
RDEPEND=" |
97 |
dev-libs/expat |
98 |
sci-libs/shapelib:= |
99 |
sys-libs/zlib:=[minizip] |
100 |
virtual/libusb:1 |
101 |
- dev-qt/qtcore:5 |
102 |
- gui? ( |
103 |
+ !qt6? ( |
104 |
+ dev-qt/qtcore:5 |
105 |
dev-qt/qtgui:5 |
106 |
dev-qt/qtnetwork:5 |
107 |
- dev-qt/qttranslations:5 |
108 |
+ dev-qt/qtserialport:5 |
109 |
dev-qt/qtwebchannel:5 |
110 |
dev-qt/qtwebengine:5[widgets] |
111 |
dev-qt/qtwidgets:5 |
112 |
dev-qt/qtxml:5 |
113 |
) |
114 |
+ qt6? ( |
115 |
+ dev-qt/qtbase:6[gui,network,widgets,xml] |
116 |
+ dev-qt/qtserialport:6 |
117 |
+ dev-qt/qtwebchannel:6 |
118 |
+ dev-qt/qtwebengine:6[widgets] |
119 |
+ dev-qt/qt5compat:6 |
120 |
+ ) |
121 |
" |
122 |
+ |
123 |
DEPEND="${RDEPEND}" |
124 |
|
125 |
DOCS=( AUTHORS NEWS README.{contrib,igc,mapconverter,md} gui/README.{contrib,gui} ) |
126 |
|
127 |
+PATCHES=( |
128 |
+ "${FILESDIR}/${PN}-1.8.0-no-automagic-qt5-qt6.patch" |
129 |
+) |
130 |
+ |
131 |
src_prepare() { |
132 |
cmake_src_prepare |
133 |
|
134 |
@@ -63,13 +76,14 @@ src_prepare() { |
135 |
} |
136 |
|
137 |
src_configure() { |
138 |
- mycmakeargs=( |
139 |
+ local mycmakeargs=( |
140 |
-DGPSBABEL_WITH_LIBUSB=pkgconfig |
141 |
-DGPSBABEL_WITH_SHAPELIB=pkgconfig |
142 |
-DGPSBABEL_WITH_ZLIB=pkgconfig |
143 |
- -DGPSBABEL_MAPPREVIEW=$(usex gui) |
144 |
- -DGPSBABEL_EMBED_MAP=$(usex gui) |
145 |
- -DGPSBABEL_EMBED_TRANSLATIONS=$(usex gui) |
146 |
+ -DGPSBABEL_MAPPREVIEW=ON |
147 |
+ -DGPSBABEL_EMBED_MAP=ON |
148 |
+ -DGPSBABEL_EMBED_TRANSLATIONS=ON |
149 |
+ -DUSE_QT6="$(usex qt6)" |
150 |
) |
151 |
|
152 |
cmake_src_configure |
153 |
@@ -77,7 +91,7 @@ src_configure() { |
154 |
|
155 |
cmake_src_compile() { |
156 |
cmake_build gpsbabel |
157 |
- use gui && cmake_build gpsbabelfe |
158 |
+ cmake_build gpsbabelfe |
159 |
use doc && cmake_build gpsbabel.html |
160 |
} |
161 |
|
162 |
@@ -86,11 +100,9 @@ src_install() { |
163 |
einstalldocs |
164 |
|
165 |
dobin gpsbabel |
166 |
- if use gui; then |
167 |
- dobin gui/GPSBabelFE/gpsbabelfe |
168 |
- insinto /usr/share/${PN}/translations/ |
169 |
- doins gui/gpsbabel*_*.qm |
170 |
- newicon gui/images/appicon.png ${PN}.png |
171 |
- domenu gui/gpsbabel.desktop |
172 |
- fi |
173 |
+ dobin gui/GPSBabelFE/gpsbabelfe |
174 |
+ insinto /usr/share/${PN}/translations/ |
175 |
+ doins gui/gpsbabel*_*.qm |
176 |
+ newicon gui/images/appicon.png ${PN}.png |
177 |
+ domenu gui/gpsbabel.desktop |
178 |
} |