-
Notifications
You must be signed in to change notification settings - Fork 7
/
app.pro
377 lines (301 loc) · 10 KB
/
app.pro
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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
PREFIX = harbour
NAME = foilnotes
openrepos {
DEFINES += OPENREPOS
CONFIG += app_settings
}
TARGET = $${PREFIX}-$${NAME}
CONFIG += sailfishapp link_pkgconfig
PKGCONFIG += sailfishapp mlite5 keepalive glib-2.0 gobject-2.0 gio-unix-2.0
QT += qml quick sql
isEmpty(VERSION) {
VERSION = 1.1.0
}
V1 = $$system(echo $$VERSION | cut -f1 -d.)
V2 = $$system(echo $$VERSION | cut -f2 -d.)
V3 = $$system(echo $$VERSION | cut -f3 -d.)
DEFINES += VERSION_MAJOR=$$V1 VERSION_MINOR=$$V2 VERSION_MICRO=$$V3
QMAKE_CXXFLAGS += -Wno-unused-parameter
QMAKE_CFLAGS += -Wno-unused-parameter
app_settings {
# This path is hardcoded in jolla-settings
TRANSLATIONS_PATH = /usr/share/translations
} else {
TRANSLATIONS_PATH = /usr/share/$${TARGET}/translations
}
CONFIG(debug, debug|release) {
DEFINES += DEBUG HARBOUR_DEBUG
}
equals(QT_ARCH, arm64){
message(Linking with OpenSSL)
PKGCONFIG += libcrypto
}
# Fix libfoil compilation warnings:
DEFINES += GLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32
DEFINES += GLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_MAX_ALLOWED
# Directories
FOIL_UI_REL = foil-ui
FOIL_UI_DIR = $${_PRO_FILE_PWD_}/$${FOIL_UI_REL}
FOIL_UI_QML = $${FOIL_UI_DIR}
HARBOUR_LIB_REL = harbour-lib
HARBOUR_LIB_DIR = $${_PRO_FILE_PWD_}/$${HARBOUR_LIB_REL}
HARBOUR_LIB_INCLUDE = $${HARBOUR_LIB_DIR}/include
HARBOUR_LIB_SRC = $${HARBOUR_LIB_DIR}/src
HARBOUR_LIB_QML = $${HARBOUR_LIB_DIR}/qml
LIBGLIBUTIL_DIR = $${_PRO_FILE_PWD_}/libglibutil
LIBGNFCDC_DIR = $${_PRO_FILE_PWD_}/libgnfcdc
LIBQNFCDC_DIR = $${_PRO_FILE_PWD_}/libqnfcdc
FOIL_DIR = $${_PRO_FILE_PWD_}/foil
LIBFOIL_DIR = $${FOIL_DIR}/libfoil
LIBFOIL_INCLUDE = $${LIBFOIL_DIR}/include
LIBFOIL_SRC = $${LIBFOIL_DIR}/src
LIBFOILMSG_DIR = $${FOIL_DIR}/libfoilmsg
LIBFOILMSG_INCLUDE = $${LIBFOILMSG_DIR}/include
LIBFOILMSG_SRC = $${LIBFOILMSG_DIR}/src
LIBQRENCODE_DIR = $${_PRO_FILE_PWD_}/libqrencode
# Libraries
LIBS += libqrencode.a -ldl
OTHER_FILES += \
LICENSE \
*.desktop \
qml/*.js \
qml/*.qml \
qml/images/*.svg \
icons/*.svg \
translations/*.ts
INCLUDEPATH += \
src \
$${LIBFOIL_SRC} \
$${LIBFOIL_INCLUDE} \
$${LIBFOILMSG_INCLUDE} \
$${LIBQRENCODE_DIR}
HEADERS += \
src/FoilNotes.h \
src/FoilNotesBaseModel.h \
src/FoilNotesDefs.h \
src/FoilNotesHints.h \
src/FoilNotesModel.h \
src/FoilNotesNfcShare.h \
src/FoilNotesNfcShareClient.h \
src/FoilNotesNfcShareService.h \
src/FoilNotesNfcShareProtocol.h \
src/FoilNotesPlaintextModel.h \
src/FoilNotesSearchModel.h \
src/FoilNotesSettings.h
SOURCES += \
src/FoilNotes.cpp \
src/FoilNotesBaseModel.cpp \
src/FoilNotesHints.cpp \
src/FoilNotesModel.cpp \
src/FoilNotesNfcShareClient.cpp \
src/FoilNotesNfcShareService.cpp \
src/FoilNotesNfcShareProtocol.cpp \
src/FoilNotesPlaintextModel.cpp \
src/FoilNotesSearchModel.cpp \
src/FoilNotesSettings.cpp \
src/main.cpp
SOURCES += \
$${LIBFOIL_SRC}/*.c \
$${LIBFOIL_SRC}/openssl/*.c \
$${LIBFOILMSG_SRC}/*.c
HEADERS += \
$${LIBFOIL_INCLUDE}/*.h \
$${LIBFOILMSG_INCLUDE}/*.h \
# NFC stuff
# libqnfcdc
LIBQNFCDC_INCLUDE = $${LIBQNFCDC_DIR}/include
LIBQNFCDC_SRC = $${LIBQNFCDC_DIR}/src
INCLUDEPATH += \
$${LIBQNFCDC_INCLUDE}
HEADERS += \
$${LIBQNFCDC_INCLUDE}/NfcAdapter.h \
$${LIBQNFCDC_INCLUDE}/NfcMode.h \
$${LIBQNFCDC_INCLUDE}/NfcSystem.h \
$${LIBQNFCDC_INCLUDE}/NfcPeer.h
SOURCES += \
$${LIBQNFCDC_SRC}/NfcAdapter.cpp \
$${LIBQNFCDC_SRC}/NfcMode.cpp \
$${LIBQNFCDC_SRC}/NfcSystem.cpp \
$${LIBQNFCDC_SRC}/NfcPeer.cpp
# libglibutil
LIBGLIBUTIL_SRC = $${LIBGLIBUTIL_DIR}/src
LIBGLIBUTIL_INCLUDE = $${LIBGLIBUTIL_DIR}/include
INCLUDEPATH += \
$${LIBGLIBUTIL_INCLUDE}
HEADERS += \
$${LIBGLIBUTIL_INCLUDE}/*.h
SOURCES += \
$${LIBGLIBUTIL_DIR}/src/*.c
# libgnfcdc
LIBGNFCDC_INCLUDE = $${LIBGNFCDC_DIR}/include
LIBGNFCDC_SRC = $${LIBGNFCDC_DIR}/src
LIBGNFCDC_SPEC = $${LIBGNFCDC_DIR}/spec
INCLUDEPATH += \
$${LIBGNFCDC_INCLUDE}
HEADERS += \
$${LIBGNFCDC_INCLUDE}/*.h \
$${LIBGNFCDC_SRC}/*.h
SOURCES += \
$${LIBGNFCDC_SRC}/*.c
OTHER_FILES += \
$${LIBGNFCDC_SPEC}/*.xml
defineTest(generateStub) {
xml = $${LIBGNFCDC_SPEC}/org.sailfishos.nfc.$${1}.xml
cmd = gdbus-codegen --generate-c-code org.sailfishos.nfc.$${1} $${xml}
gen_h = org.sailfishos.nfc.$${1}.h
gen_c = org.sailfishos.nfc.$${1}.c
target_h = org_sailfishos_nfc_$${1}_h
target_c = org_sailfishos_nfc_$${1}_c
$${target_h}.target = $${gen_h}
$${target_h}.depends = $${xml}
$${target_h}.commands = $${cmd}
export($${target_h}.target)
export($${target_h}.depends)
export($${target_h}.commands)
GENERATED_HEADERS += $${gen_h}
PRE_TARGETDEPS += $${gen_h}
QMAKE_EXTRA_TARGETS += $${target_h}
$${target_c}.target = $${gen_c}
$${target_c}.depends = $${gen_h}
export($${target_c}.target)
export($${target_c}.depends)
GENERATED_SOURCES += $${gen_c}
QMAKE_EXTRA_TARGETS += $${target_c}
PRE_TARGETDEPS += $${gen_c}
export(QMAKE_EXTRA_TARGETS)
export(GENERATED_SOURCES)
export(PRE_TARGETDEPS)
}
generateStub(Adapter)
generateStub(Daemon)
generateStub(IsoDep)
generateStub(LocalService)
generateStub(Settings)
generateStub(Peer)
generateStub(Tag)
# foil-ui
FOIL_UI_COMPONENTS = \
$${FOIL_UI_QML}/FoilUiAppsWarning.qml \
$${FOIL_UI_QML}/FoilUiChangePasswordPage.qml \
$${FOIL_UI_QML}/FoilUiConfirmPasswordDialog.qml \
$${FOIL_UI_QML}/FoilUiEnterPasswordView.qml \
$${FOIL_UI_QML}/FoilUiGenerateKeyPage.qml \
$${FOIL_UI_QML}/FoilUiGenerateKeyView.qml \
$${FOIL_UI_QML}/FoilUiGenerateKeyWarning.qml \
$${FOIL_UI_QML}/FoilUiGeneratingKeyView.qml
FOIL_UI_IMAGES = $${FOIL_UI_QML}/images/*.svg
OTHER_FILES += $${FOIL_UI_COMPONENTS}
foil_ui_components.files = $${FOIL_UI_COMPONENTS}
foil_ui_components.path = /usr/share/$${TARGET}/qml/foil-ui
INSTALLS += foil_ui_components
OTHER_FILES += $${FOIL_UI_IMAGES}
foil_ui_images.files = $${FOIL_UI_IMAGES}
foil_ui_images.path = /usr/share/$${TARGET}/qml/foil-ui/images
INSTALLS += foil_ui_images
# harbour-lib
INCLUDEPATH += \
$${HARBOUR_LIB_INCLUDE}
HEADERS += \
$${HARBOUR_LIB_INCLUDE}/HarbourBase32.h \
$${HARBOUR_LIB_INCLUDE}/HarbourColorEditorModel.h \
$${HARBOUR_LIB_INCLUDE}/HarbourDebug.h \
$${HARBOUR_LIB_INCLUDE}/HarbourProcessState.h \
$${HARBOUR_LIB_INCLUDE}/HarbourOrganizeListModel.h \
$${HARBOUR_LIB_INCLUDE}/HarbourQrCodeGenerator.h \
$${HARBOUR_LIB_INCLUDE}/HarbourQrCodeImageProvider.h \
$${HARBOUR_LIB_INCLUDE}/HarbourSystemInfo.h \
$${HARBOUR_LIB_INCLUDE}/HarbourSystemState.h \
$${HARBOUR_LIB_INCLUDE}/HarbourTask.h \
$${HARBOUR_LIB_INCLUDE}/HarbourWakeupTimer.h \
$${HARBOUR_LIB_SRC}/HarbourMce.h
SOURCES += \
$${HARBOUR_LIB_SRC}/HarbourBase32.cpp \
$${HARBOUR_LIB_SRC}/HarbourColorEditorModel.cpp \
$${HARBOUR_LIB_SRC}/HarbourMce.cpp \
$${HARBOUR_LIB_SRC}/HarbourOrganizeListModel.cpp \
$${HARBOUR_LIB_SRC}/HarbourProcessState.cpp \
$${HARBOUR_LIB_SRC}/HarbourQrCodeGenerator.cpp \
$${HARBOUR_LIB_SRC}/HarbourQrCodeImageProvider.cpp \
$${HARBOUR_LIB_SRC}/HarbourSystemInfo.cpp \
$${HARBOUR_LIB_SRC}/HarbourSystemState.cpp \
$${HARBOUR_LIB_SRC}/HarbourTask.cpp \
$${HARBOUR_LIB_SRC}/HarbourWakeupTimer.cpp
HARBOUR_QML_COMPONENTS = \
$${HARBOUR_LIB_QML}/HarbourColorEditorDialog.qml \
$${HARBOUR_LIB_QML}/HarbourColorHueItem.qml \
$${HARBOUR_LIB_QML}/HarbourColorPickerDialog.qml \
$${HARBOUR_LIB_QML}/HarbourFitLabel.qml \
$${HARBOUR_LIB_QML}/HarbourHighlightIcon.qml \
$${HARBOUR_LIB_QML}/HarbourHintIconButton.qml \
$${HARBOUR_LIB_QML}/HarbourHorizontalSwipeHint.qml\
$${HARBOUR_LIB_QML}/HarbourIconTextButton.qml \
$${HARBOUR_LIB_QML}/HarbourPasswordInputField.qml \
$${HARBOUR_LIB_QML}/HarbourPressEffect.qml \
$${HARBOUR_LIB_QML}/HarbourShakeAnimation.qml
OTHER_FILES += $${HARBOUR_QML_COMPONENTS}
qml_components.files = $${HARBOUR_QML_COMPONENTS}
qml_components.path = /usr/share/$${TARGET}/qml/harbour
INSTALLS += qml_components
# openssl
!equals(QT_ARCH, arm64){
SOURCES += \
$${HARBOUR_LIB_SRC}/libcrypto.c
}
# Icons
ICON_SIZES = 86 108 128 172 256
for(s, ICON_SIZES) {
icon_target = icon$${s}
icon_dir = icons/$${s}x$${s}
$${icon_target}.files = $${icon_dir}/$${TARGET}.png
$${icon_target}.path = /usr/share/icons/hicolor/$${s}x$${s}/apps
INSTALLS += $${icon_target}
}
# Settings
app_settings {
settings_json.files = settings/$${TARGET}.json
settings_json.path = /usr/share/jolla-settings/entries/
settings_qml.files = settings/*.qml
settings_qml.path = /usr/share/$${TARGET}/qml/settings/
INSTALLS += settings_qml settings_json
}
OTHER_FILES += \
settings/*.qml \
settings/*.json
# Translations
TRANSLATION_IDBASED=-idbased
TRANSLATION_SOURCES = \
$${_PRO_FILE_PWD_}/qml \
$${_PRO_FILE_PWD_}/settings
defineTest(addTrFile) {
rel = translations/$${1}
OTHER_FILES += $${rel}.ts
export(OTHER_FILES)
in = $${_PRO_FILE_PWD_}/$$rel
out = $${OUT_PWD}/$$rel
s = $$replace(1,-,_)
lupdate_target = lupdate_$$s
qm_target = qm_$$s
$${lupdate_target}.commands = lupdate -noobsolete -locations none $${TRANSLATION_SOURCES} -ts \"$${in}.ts\" && \
mkdir -p \"$${OUT_PWD}/translations\" && [ \"$${in}.ts\" != \"$${out}.ts\" ] && \
cp -af \"$${in}.ts\" \"$${out}.ts\" || :
$${qm_target}.path = $$TRANSLATIONS_PATH
$${qm_target}.depends = $${lupdate_target}
$${qm_target}.commands = lrelease $$TRANSLATION_IDBASED \"$${out}.ts\" && \
$(INSTALL_FILE) \"$${out}.qm\" $(INSTALL_ROOT)$${TRANSLATIONS_PATH}/
QMAKE_EXTRA_TARGETS += $${lupdate_target} $${qm_target}
INSTALLS += $${qm_target}
export($${lupdate_target}.commands)
export($${qm_target}.path)
export($${qm_target}.depends)
export($${qm_target}.commands)
export(QMAKE_EXTRA_TARGETS)
export(INSTALLS)
}
LANGUAGES = de es fr pl ru sv zh_CN
addTrFile($${TARGET})
for(l, LANGUAGES) {
addTrFile($${TARGET}-$$l)
}
qm.path = $$TRANSLATIONS_PATH
qm.CONFIG += no_check_exist
INSTALLS += qm