summarylogtreecommitdiffstats
path: root/vesc-tool.patch
blob: ac59fa8e1ea1dba716997953f240a91a58d35fba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
--- /var/lib/archbuild/extra-x86_64/oskar/build/vesc_tool-git/vesc_tool/vesc_tool.pro	2024-04-14 14:07:19.371492688 +0200
+++ vesc_tool.pro	2024-04-14 14:09:40.747867361 +0200
@@ -1,106 +1,40 @@
-#-------------------------------------------------
-#
-# Project created by QtCreator 2016-08-12T21:55:19
-#
-#-------------------------------------------------
-
-# Version
 VT_VERSION = 6.05
 VT_INTRO_VERSION = 1
 VT_CONFIG_VERSION = 2
 
 # Set to 0 for stable versions and to test version number for development versions.
-VT_IS_TEST_VERSION = 2
-
-# GIT commit
-VT_GIT_COMMIT = $$system(git rev-parse --short=8 HEAD)
-
-VT_ANDROID_VERSION_ARMV7 = 134
-VT_ANDROID_VERSION_ARM64 = 135
-VT_ANDROID_VERSION_X86 = 136
-
-VT_ANDROID_VERSION = $$VT_ANDROID_VERSION_X86
+VT_IS_TEST_VERSION = 0
 
-# Ubuntu 18.04 (should work on raspbian buster too)
-# sudo apt install qml-module-qt-labs-folderlistmodel qml-module-qtquick-extras qml-module-qtquick-controls2 qt5-default libqt5quickcontrols2-5 qtquickcontrols2-5-dev qtcreator qtcreator-doc libqt5serialport5-dev build-essential qml-module-qt3d qt3d5-dev qtdeclarative5-dev qtconnectivity5-dev qtmultimedia5-dev qtpositioning5-dev qtpositioning5-dev libqt5gamepad5-dev qml-module-qt-labs-settings qml-module-qt-labs-platform libqt5svg5-dev
+TEMPLATE = app
 
 DEFINES += VT_VERSION=$$VT_VERSION
 DEFINES += VT_INTRO_VERSION=$$VT_INTRO_VERSION
 DEFINES += VT_CONFIG_VERSION=$$VT_CONFIG_VERSION
 DEFINES += VT_IS_TEST_VERSION=$$VT_IS_TEST_VERSION
-DEFINES += VT_GIT_COMMIT=$$VT_GIT_COMMIT
 QT_LOGGING_RULES="qt.qml.connections=false"
-#CONFIG += qtquickcompiler
 
 CONFIG += c++11
 CONFIG += resources_big
-ios: {
-    QMAKE_CXXFLAGS_DEBUG += -Wall
-}
-
-!win32-msvc*: { !android: {
-    QMAKE_CXXFLAGS += -Wno-deprecated-copy
-}}
-
-# Build mobile GUI
-#CONFIG += build_mobile
-
+QMAKE_CXXFLAGS += -Wno-deprecated-copy
+QMAKE_LFLAGS += -fuse-ld=mold
+LIBS += -fuse-ld=mold
 # Exclude built-in firmwares
-#CONFIG += exclude_fw
-
-ios: {
-    CONFIG    += build_mobile
-    DEFINES   += QT_NO_PRINTER
-}
-
-# Debug build (e.g. F5 to reload QML files)
-#DEFINES += DEBUG_BUILD
-
-# If BLE disconnects on ubuntu after about 90 seconds the reason is most likely that the connection interval is incompatible. This can be fixed with:
-# sudo bash -c 'echo 6 > /sys/kernel/debug/bluetooth/hci0/conn_min_interval'
-
-# Clear old bluetooth devices
-# sudo rm -rf /var/lib/bluetooth/*
-# sudo service bluetooth restart
-
+CONFIG += exclude_fw
 # Bluetooth available
 DEFINES += HAS_BLUETOOTH
 
 # CAN bus available
 # Adding serialbus to Qt seems to break the serial port on static builds. TODO: Figure out why.
-#DEFINES += HAS_CANBUS
+DEFINES += HAS_CANBUS
 
 # Positioning
 DEFINES += HAS_POS
 
-!ios: {
-    QT       += printsupport
-!android: {
-    # Serial port available
-    DEFINES += HAS_SERIALPORT
-    DEFINES += HAS_GAMEPAD
-}
-}
-
-win32: {
-    DEFINES += _USE_MATH_DEFINES
-}
-
-# https://stackoverflow.com/questions/61444320/what-are-the-configure-options-for-qt-that-enable-dead-keys-usage
-unix: {
-!ios: {
-    QTPLUGIN += composeplatforminputcontextplugin
-}
-}
-
-# Options
-#CONFIG += build_original
-#CONFIG += build_platinum
-#CONFIG += build_gold
-#CONFIG += build_silver
-#CONFIG += build_bronze
-#CONFIG += build_free
+DEFINES += HAS_SERIALPORT
+DEFINES += HAS_GAMEPAD
 
+QTPLUGIN += composeplatforminputcontextplugin
+QT       += printsupport
 QT       += core gui
 QT       += widgets
 QT       += network
@@ -130,81 +64,11 @@
     QT       += gamepad
 }
 
-android: QT += androidextras
-
-ios | macx: {
-    TARGET = "VESC Tool"
-}else: {
-    android:{
-        TARGET = "vesc_tool"
-    }else:{
-
-        TARGET = vesc_tool_$$VT_VERSION
-    }
-}
-
-ANDROID_VERSION = 1
-
-android:contains(QT_ARCH, i386) {
-    VT_ANDROID_VERSION = $$VT_ANDROID_VERSION_X86
-}
-
-contains(ANDROID_TARGET_ARCH, arm64-v8a) {
-    VT_ANDROID_VERSION = $$VT_ANDROID_VERSION_ARM64
-}
-
-contains(ANDROID_TARGET_ARCH, armeabi-v7a) {
-    VT_ANDROID_VERSION = $$VT_ANDROID_VERSION_ARMV7
-}
-
-android: {
-    manifest.input = $$PWD/android/AndroidManifest.xml.in
-    manifest.output = $$PWD/android/AndroidManifest.xml
-    QMAKE_SUBSTITUTES += manifest
-}
+TARGET = vesc_tool
 
 TEMPLATE = app
-
-release_win {
-    DESTDIR = build/win
-    OBJECTS_DIR = build/win/obj
-    MOC_DIR = build/win/obj
-    RCC_DIR = build/win/obj
-    UI_DIR = build/win/obj
-}
-
-release_lin {
-    # http://micro.nicholaswilson.me.uk/post/31855915892/rules-of-static-linking-libstdc-libc-libgcc
-    # http://insanecoding.blogspot.se/2012/07/creating-portable-linux-binaries.html
-    QMAKE_LFLAGS += -static-libstdc++ -static-libgcc
     DESTDIR = build/lin
     OBJECTS_DIR = build/lin/obj
-    MOC_DIR = build/lin/obj
-    RCC_DIR = build/lin/obj
-    UI_DIR = build/lin/obj
-}
-
-release_macos {
-    # brew install qt
-    DESTDIR = build/macos
-    OBJECTS_DIR = build/macos/obj
-    MOC_DIR = build/macos/obj
-    RCC_DIR = build/macos/obj
-    UI_DIR = build/macos/obj
-}
-
-release_android {
-    DESTDIR = build/android
-    OBJECTS_DIR = build/android/obj
-    MOC_DIR = build/android/obj
-    RCC_DIR = build/android/obj
-    UI_DIR = build/android/obj
-}
-
-build_mobile {
-    DEFINES += USE_MOBILE
-}
-
 SOURCES += main.cpp\
     bleuartdummy.cpp \
     codeloader.cpp \
@@ -278,94 +142,18 @@
     res_custom_module.qrc \
     res_lisp.qrc \
     res_qml.qrc
-RESOURCES += res_config.qrc
+RESOURCES += res_config.qrc res_original.qrc
+DEFINES += VER_ORIGINAL
 
 !exclude_fw {
     RESOURCES += res_fw_bms.qrc
     RESOURCES += res/firmwares/res_fw.qrc
     RESOURCES += res/firmwares_esp/res_fw_esp.qrc
 }
-
-build_original {
-    RESOURCES += res_original.qrc
-    DEFINES += VER_ORIGINAL
-} else:build_platinum {
-    RESOURCES += res_platinum.qrc
-    DEFINES += VER_PLATINUM
-} else:build_gold {
-    RESOURCES += res_gold.qrc
-    DEFINES += VER_GOLD
-} else:build_silver {
-    RESOURCES += res_silver.qrc
-    DEFINES += VER_SILVER
-} else:build_bronze {
-    RESOURCES += res_bronze.qrc
-    DEFINES += VER_BRONZE
-} else:build_free {
-    RESOURCES += res_free.qrc
-    DEFINES += VER_FREE
-} else {
-    RESOURCES += res_neutral.qrc
-    DEFINES += VER_NEUTRAL
-}
-
-DISTFILES += \
-    android/AndroidManifest.xml \
-    android/gradle/wrapper/gradle-wrapper.jar \
-    android/gradlew \
-    android/gradlew.bat \
-    android/res/values/libs.xml \
-    android/build.gradle \
-    android/gradle/wrapper/gradle-wrapper.properties \
-    android/src/com/vedder/vesc/VForegroundService.java \
-    android/src/com/vedder/vesc/Utils.java
-
-ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
-
-macx-clang:contains(QMAKE_HOST.arch, arm.*): {
-   QMAKE_APPLE_DEVICE_ARCHS=arm64
-}
-
-macx {
-    ICON        =  macos/appIcon.icns
-    QMAKE_INFO_PLIST = macos/Info.plist
-    DISTFILES += macos/Info.plist
-    QMAKE_CFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
-    QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO
-    QMAKE_OBJECTIVE_CFLAGS_RELEASE = $$QMAKE_OBJECTIVE_CFLAGS_RELEASE_WITH_DEBUGINFO
-    QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO
-}
-
-ios {
-    QMAKE_INFO_PLIST = ios/Info.plist
-    HEADERS += ios/src/setIosParameters.h
-    SOURCES += ios/src/setIosParameters.mm
-    DISTFILES += ios/Info.plist \
-                 ios/*.storyboard
-    QMAKE_ASSET_CATALOGS = $$PWD/ios/Images.xcassets
-    QMAKE_ASSET_CATALOGS_APP_ICON = "AppIcon"
-
-    ios_artwork.files = $$files($$PWD/ios/iTunesArtwork*.png)
-    QMAKE_BUNDLE_DATA += ios_artwork
-    app_launch_images.files = $$files($$PWD/ios/LaunchImage*.png)
-    QMAKE_BUNDLE_DATA += app_launch_images
-    app_launch_screen.files = $$files($$PWD/ios/MyLaunchScreen.storyboard)
-    QMAKE_BUNDLE_DATA += app_launch_screen
-
-    #QMAKE_IOS_DEPLOYMENT_TARGET = 11.0
-
-    disable_warning.name = GCC_WARN_64_TO_32_BIT_CONVERSION
-    disable_warning.value = NO
-
-    QMAKE_MAC_XCODE_SETTINGS += disable_warning
-
-    # Note for devices: 1=iPhone, 2=iPad, 1,2=Universal.
-    CONFIG -= warn_on
-    QMAKE_APPLE_TARGETED_DEVICE_FAMILY = 1,2
-}
 CONFIG -= warn_on
 
-contains(ANDROID_TARGET_ARCH,) {
-    ANDROID_ABIS = \
-        armeabi-v7a
+isEmpty(PREFIX) {
+	PREFIX = /usr/local
 }
+target.path = $${PREFIX}/bin
+INSTALLS += target