remove ia64 keywords
[gentoo-zh.git] / x11-misc / fqterm / files / fqterm-0.9.10.1-drop-qt4.patch
blob1e396bd4c65aa342099804b814eaf0b4a83ef76f
1 From 55d08df3c15818e238a44dc93aa92b0befad36fa Mon Sep 17 00:00:00 2001
2 From: Iru Cai <mytbk920423@gmail.com>
3 Date: Tue, 11 Aug 2020 12:43:52 +0800
4 Subject: [PATCH] drop Qt4 support
6 ---
7 CMakeLists.txt | 53 +++++++------------------------
8 CMakeLists.txt.linux | 28 +++++-----------
9 README.md | 5 ++-
10 src/common/CMakeLists.txt | 21 +++---------
11 src/fqterm/CMakeLists.txt | 47 +++++++++++----------------
12 src/protocol/CMakeLists.txt | 11 ++-----
13 src/terminal/CMakeLists.txt | 11 +++----
14 src/ui/CMakeLists.txt | 16 +---------
15 src/ui/imageviewer/CMakeLists.txt | 4 +--
16 src/utilities/CMakeLists.txt | 11 +++----
17 10 files changed, 57 insertions(+), 150 deletions(-)
19 diff --git a/CMakeLists.txt b/CMakeLists.txt
20 index 5bc5f61..5dda9e7 100644
21 --- a/CMakeLists.txt
22 +++ b/CMakeLists.txt
23 @@ -22,30 +22,17 @@ ELSE(MCGGIT_WC_REVISION MATCHES "NOTFOUND")
24 message("Git revision: " ${MCGGIT_WC_REVISION})
25 ENDIF(MCGGIT_WC_REVISION MATCHES "NOTFOUND")
27 -SET(USE_QT5 OFF CACHE PATH "Do the Qt5 build")
29 -IF(USE_QT5)
30 - set(CMAKE_INCLUDE_CURRENT_DIR ON)
31 - set(CMAKE_AUTOMOC ON)
32 - find_package(Qt5Core REQUIRED)
33 - find_package(Qt5Widgets REQUIRED)
34 - find_package(Qt5LinguistTools REQUIRED)
35 - qt5_add_translation(fqterm_qm_files
36 - ${CMAKE_SOURCE_DIR}/res/dict/fqterm_zh_CN.ts
37 - ${CMAKE_SOURCE_DIR}/res/dict/ui_zh_CN.ts
38 - ${CMAKE_SOURCE_DIR}/res/dict/protocol_zh_CN.ts
39 - ${CMAKE_SOURCE_DIR}/res/dict/common_zh_CN.ts
40 - )
41 -ELSE(USE_QT5)
42 - find_package(Qt4 COMPONENTS QtCore QtGui QtNetwork QtScript QtXml REQUIRED)
43 - include(${QT_USE_FILE})
44 - qt4_add_translation(fqterm_qm_files
45 - ${CMAKE_SOURCE_DIR}/res/dict/fqterm_zh_CN.ts
46 - ${CMAKE_SOURCE_DIR}/res/dict/ui_zh_CN.ts
47 - ${CMAKE_SOURCE_DIR}/res/dict/protocol_zh_CN.ts
48 - ${CMAKE_SOURCE_DIR}/res/dict/common_zh_CN.ts
49 - )
50 -ENDIF(USE_QT5)
51 +set(CMAKE_INCLUDE_CURRENT_DIR ON)
52 +set(CMAKE_AUTOMOC ON)
53 +find_package(Qt5Core REQUIRED)
54 +find_package(Qt5Widgets REQUIRED)
55 +find_package(Qt5LinguistTools REQUIRED)
56 +qt5_add_translation(fqterm_qm_files
57 + ${CMAKE_SOURCE_DIR}/res/dict/fqterm_zh_CN.ts
58 + ${CMAKE_SOURCE_DIR}/res/dict/ui_zh_CN.ts
59 + ${CMAKE_SOURCE_DIR}/res/dict/protocol_zh_CN.ts
60 + ${CMAKE_SOURCE_DIR}/res/dict/common_zh_CN.ts
61 + )
63 add_custom_target(fqterm_qm_target
64 DEPENDS ${fqterm_qm_files}
65 @@ -59,24 +46,6 @@ else (PYTHONLIBS_FOUND)
66 SET(PYTHON_LIB)
67 endif (PYTHONLIBS_FOUND)
69 -if (NOT USE_QT5)
70 - IF(WIN32)
71 - FILE(READ ${QT_LIBRARY_DIR}/QtCore.prl FQ_CORE_QT_CONFIG)
72 - ELSE(WIN32)
73 - IF(APPLE)
74 - FILE(READ ${QT_LIBRARY_DIR}/QtCore.framework/QtCore.prl FQ_CORE_QT_CONFIG)
75 - ELSE(APPLE)
76 - FILE(READ ${QT_LIBRARY_DIR}/libQtCore.prl FQ_CORE_QT_CONFIG)
77 - ENDIF(APPLE)
78 - ENDIF(WIN32)
80 - IF(NOT FQ_CORE_QT_CONFIG MATCHES "static")
81 - SET(FQTERM_USE_STATIC_QT false)
82 - ELSE(NOT FQ_CORE_QT_CONFIG MATCHES "static")
83 - SET(FQTERM_USE_STATIC_QT true)
84 - ENDIF(NOT FQ_CORE_QT_CONFIG MATCHES "static")
85 -endif(NOT USE_QT5)
87 SET(SUB_CMAKELIST "UNKNOWN")
89 ADD_DEFINITIONS(-D "FQTERM_VERSION_STRING=\\\"${FQTERM_VERSION}\\\"")
90 diff --git a/CMakeLists.txt.linux b/CMakeLists.txt.linux
91 index ea457f5..1c890d5 100644
92 --- a/CMakeLists.txt.linux
93 +++ b/CMakeLists.txt.linux
94 @@ -32,23 +32,13 @@ IF (WITH_ASAN)
95 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
96 ENDIF(WITH_ASAN)
98 -IF(USE_QT5)
99 - find_package(Qt5Core REQUIRED)
100 - find_package(Qt5Widgets REQUIRED)
101 - find_package(Qt5Network REQUIRED)
102 - find_package(Qt5Script REQUIRED)
103 - find_package(Qt5Multimedia REQUIRED)
104 - find_package(Qt5Xml REQUIRED)
105 -ELSE(USE_QT5)
106 -ENDIF(USE_QT5)
108 -IF(NOT USE_QT5)
109 - include_directories(
110 - ${QT_INCLUDE_DIR}
111 - ${QT_QTCORE_INCLUDE_DIR}
112 - ${QT_QTGUI_INCLUDE_DIR}
114 -ENDIF(NOT USE_QT5)
115 +find_package(Qt5Core REQUIRED)
116 +find_package(Qt5Widgets REQUIRED)
117 +find_package(Qt5Network REQUIRED)
118 +find_package(Qt5Script REQUIRED)
119 +find_package(Qt5Multimedia REQUIRED)
120 +find_package(Qt5Xml REQUIRED)
122 include_directories(
123 ${CMAKE_CURRENT_SOURCE_DIR}/src/common
124 ${CMAKE_CURRENT_SOURCE_DIR}/src/protocol
125 @@ -89,9 +79,7 @@ target_link_libraries(fqterm.bin
129 -IF(USE_QT5)
130 - target_link_libraries(fqterm.bin Qt5::Core Qt5::Widgets)
131 -ENDIF(USE_QT5)
132 +target_link_libraries(fqterm.bin Qt5::Core Qt5::Widgets)
134 add_dependencies(fqterm.bin
135 fqterm_main
136 diff --git a/README.md b/README.md
137 index f8cb574..5fd7455 100644
138 --- a/README.md
139 +++ b/README.md
140 @@ -33,21 +33,20 @@ git clone https://github.com/mytbk/fqterm.git
141 # 假设FQTerm源码目录为fqterm
142 mkdir build
143 cd build
144 -# 用cmake生成Makefile,默认为Qt4版本,Qt5版本请添加-DUSE_QT5=1参数
145 cmake ../fqterm
146 make
147 # 以root身份安装,以下用sudo获取root权限
148 sudo make install
151 -在 macOS (Sierra) 中编译建议使用 Qt5 分支,利用 HomeBrew 安装依赖。目前支持并不完善。
152 +在 macOS (Sierra) 中编译,利用 HomeBrew 安装依赖。目前支持并不完善。
153 ```shell
154 brew install openssl qt5
155 mkdir build
156 cd build
157 CMAKE_PREFIX_PATH=/usr/local/opt/qt5/lib/cmake \
158 OPENSSL_ROOT_DIR=/usr/local/opt/openssl \
159 -cmake ../fqterm -DUSE_QT5=1
160 +cmake ../fqterm
161 make
162 make install
164 diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
165 index cc4a354..2f4f14e 100644
166 --- a/src/common/CMakeLists.txt
167 +++ b/src/common/CMakeLists.txt
168 @@ -24,24 +24,13 @@ set(fqterm_common_SRCS
169 fqterm_shortcuthelper.cpp
172 -if(USE_QT5)
173 - set(CMAKE_INCLUDE_CURRENT_DIR ON)
174 - find_package(Qt5Core REQUIRED)
175 - find_package(Qt5Widgets REQUIRED)
176 - find_package(Qt5Multimedia REQUIRED)
177 -else(USE_QT5)
178 - include_directories(
179 - ${QT_INCLUDE_DIR}
180 - ${QT_QTCORE_INCLUDE_DIR}
181 - ${QT_QTGUI_INCLUDE_DIR}
182 - ${CMAKE_CURRENT_BINARY_DIR}
184 -endif(USE_QT5)
185 +set(CMAKE_INCLUDE_CURRENT_DIR ON)
186 +find_package(Qt5Core REQUIRED)
187 +find_package(Qt5Widgets REQUIRED)
188 +find_package(Qt5Multimedia REQUIRED)
190 add_library(fqterm_common
191 ${fqterm_common_SRCS}
194 -if(USE_QT5)
195 - target_link_libraries(fqterm_common Qt5::Core Qt5::Widgets Qt5::Multimedia)
196 -endif(USE_QT5)
197 +target_link_libraries(fqterm_common Qt5::Core Qt5::Widgets Qt5::Multimedia)
198 diff --git a/src/fqterm/CMakeLists.txt b/src/fqterm/CMakeLists.txt
199 index 80bc734..72f9fa7 100644
200 --- a/src/fqterm/CMakeLists.txt
201 +++ b/src/fqterm/CMakeLists.txt
202 @@ -28,10 +28,8 @@ ELSE(WIN32)
203 set(global_shortcut_impl_SRCS 3rdparty/qxtglobalshortcut_mac.cpp)
204 ELSE(APPLE)
205 set(global_shortcut_impl_SRCS 3rdparty/qxtglobalshortcut_x11.cpp)
206 - IF(USE_QT5)
207 - find_package(Qt5X11Extras REQUIRED)
208 - set(QXTLIB Qt5::X11Extras)
209 - ENDIF(USE_QT5)
210 + find_package(Qt5X11Extras REQUIRED)
211 + set(QXTLIB Qt5::X11Extras)
212 ENDIF(APPLE)
213 ENDIF(WIN32)
214 set(GLOBAL_SHORTCUT_SRC
215 @@ -53,22 +51,15 @@ set(3rdparty_SRCS
216 ${GLOBAL_SHORTCUT_SRC}
219 -if(USE_QT5)
220 - find_package(Qt5Core REQUIRED)
221 - find_package(Qt5Widgets REQUIRED)
222 - find_package(Qt5Network REQUIRED)
223 - find_package(Qt5Script REQUIRED)
224 +find_package(Qt5Core REQUIRED)
225 +find_package(Qt5Widgets REQUIRED)
226 +find_package(Qt5Network REQUIRED)
227 +find_package(Qt5Script REQUIRED)
229 - qt5_create_translation(fqterm_qm_file
230 - ${fqterm_SRCS}
231 - ${CMAKE_SOURCE_DIR}/res/dict/fqterm_zh_CN.ts
233 -else(USE_QT5)
234 - qt4_create_translation(fqterm_qm_file
235 - ${fqterm_SRCS}
236 - ${CMAKE_SOURCE_DIR}/res/dict/fqterm_zh_CN.ts
238 -endif(USE_QT5)
239 +qt5_create_translation(fqterm_qm_file
240 + ${fqterm_SRCS}
241 + ${CMAKE_SOURCE_DIR}/res/dict/fqterm_zh_CN.ts
244 include_directories(
245 ${QT_INCLUDE_DIR}
246 @@ -100,13 +91,11 @@ add_dependencies(fqterm_main
247 fqterm_utilities
250 -if(USE_QT5)
251 - target_link_libraries(
252 - fqterm_main
253 - Qt5::Core
254 - Qt5::Widgets
255 - Qt5::Network
256 - Qt5::Script
257 - ${QXTLIB}
259 -endif(USE_QT5)
260 +target_link_libraries(
261 + fqterm_main
262 + Qt5::Core
263 + Qt5::Widgets
264 + Qt5::Network
265 + Qt5::Script
266 + ${QXTLIB}
268 diff --git a/src/protocol/CMakeLists.txt b/src/protocol/CMakeLists.txt
269 index 0b505af..ddd7707 100644
270 --- a/src/protocol/CMakeLists.txt
271 +++ b/src/protocol/CMakeLists.txt
272 @@ -52,11 +52,8 @@ set(internal_SRCS
273 internal/fqterm_ssh_channel.cpp
276 -if(USE_QT5)
277 - find_package(Qt5Core REQUIRED)
278 - find_package(Qt5Network REQUIRED)
279 -else(USE_QT5)
280 -endif(USE_QT5)
281 +find_package(Qt5Core REQUIRED)
282 +find_package(Qt5Network REQUIRED)
284 include_directories(
285 ${QT_INCLUDE_DIR}
286 @@ -77,6 +74,4 @@ add_dependencies(fqterm_protocol
287 fqterm_common
290 -if(USE_QT5)
291 - target_link_libraries(fqterm_protocol Qt5::Core Qt5::Network)
292 -endif(USE_QT5)
293 +target_link_libraries(fqterm_protocol Qt5::Core Qt5::Network)
294 diff --git a/src/terminal/CMakeLists.txt b/src/terminal/CMakeLists.txt
295 index 5abe2c6..26deb8b 100644
296 --- a/src/terminal/CMakeLists.txt
297 +++ b/src/terminal/CMakeLists.txt
298 @@ -42,10 +42,7 @@ add_dependencies(fqterm_terminal
299 fqterm_utilities
302 -if(USE_QT5)
303 - find_package(Qt5Core REQUIRED)
304 - find_package(Qt5Network REQUIRED)
305 - find_package(Qt5Widgets REQUIRED)
306 - target_link_libraries(fqterm_terminal Qt5::Core Qt5::Widgets Qt5::Network)
307 -else(USE_QT5)
308 -endif(USE_QT5)
309 +find_package(Qt5Core REQUIRED)
310 +find_package(Qt5Network REQUIRED)
311 +find_package(Qt5Widgets REQUIRED)
312 +target_link_libraries(fqterm_terminal Qt5::Core Qt5::Widgets Qt5::Network)
313 diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt
314 index c42c262..e5c9a07 100644
315 --- a/src/ui/CMakeLists.txt
316 +++ b/src/ui/CMakeLists.txt
317 @@ -85,7 +85,6 @@ set(fqterm_ui_UIS
318 defineescape.ui
321 -if(USE_QT5)
322 qt5_wrap_ui(fqterm_ui_UIS_H
323 ${fqterm_ui_UIS}
325 @@ -99,17 +98,6 @@ qt5_create_translation(fqterm_ui_qm_file
326 ${fqterm_ui_SRCS}
327 ${CMAKE_SOURCE_DIR}/res/dict/ui_zh_CN.ts
329 -else(USE_QT5)
330 -qt4_wrap_ui(fqterm_ui_UIS_H
331 - ${fqterm_ui_UIS}
334 -qt4_create_translation(fqterm_ui_qm_file
335 - ${fqterm_ui_UIS}
336 - ${fqterm_ui_SRCS}
337 - ${CMAKE_SOURCE_DIR}/res/dict/ui_zh_CN.ts
339 -endif(USE_QT5)
341 include_directories(
342 ${QT_INCLUDE_DIR}
343 @@ -134,6 +122,4 @@ IF(NOT MCGGIT_WC_REVISION MATCHES "NOTFOUND")
344 ADD_DEFINITIONS(-D "FQTERM_GIT_REVISION=\\\"${MCGGIT_WC_REVISION}\\\"")
345 ENDIF(NOT MCGGIT_WC_REVISION MATCHES "NOTFOUND")
347 -if(USE_QT5)
348 - target_link_libraries(fqterm_ui Qt5::Core Qt5::Widgets)
349 -endif(USE_QT5)
350 +target_link_libraries(fqterm_ui Qt5::Core Qt5::Widgets)
351 diff --git a/src/ui/imageviewer/CMakeLists.txt b/src/ui/imageviewer/CMakeLists.txt
352 index d8cf46a..54f087c 100644
353 --- a/src/ui/imageviewer/CMakeLists.txt
354 +++ b/src/ui/imageviewer/CMakeLists.txt
355 @@ -31,6 +31,4 @@ include_directories(
356 add_library(fqterm_imageviewer
357 ${fqterm_imageviewer_SRCS})
359 -if(USE_QT5)
360 - target_link_libraries(fqterm_imageviewer Qt5::Core Qt5::Widgets)
361 -endif(USE_QT5)
362 +target_link_libraries(fqterm_imageviewer Qt5::Core Qt5::Widgets)
363 diff --git a/src/utilities/CMakeLists.txt b/src/utilities/CMakeLists.txt
364 index 8470516..a657b18 100644
365 --- a/src/utilities/CMakeLists.txt
366 +++ b/src/utilities/CMakeLists.txt
367 @@ -28,10 +28,7 @@ add_dependencies(fqterm_utilities
368 fqterm_common
371 -if(USE_QT5)
372 - find_package(Qt5Core REQUIRED)
373 - find_package(Qt5Widgets REQUIRED)
374 - find_package(Qt5Network REQUIRED)
375 - target_link_libraries(fqterm_utilities Qt5::Core Qt5::Widgets Qt5::Network)
376 -else(USE_QT5)
377 -endif(USE_QT5)
378 +find_package(Qt5Core REQUIRED)
379 +find_package(Qt5Widgets REQUIRED)
380 +find_package(Qt5Network REQUIRED)
381 +target_link_libraries(fqterm_utilities Qt5::Core Qt5::Widgets Qt5::Network)