status-desktop/ui/nim-status-client.pro

91 lines
3.2 KiB
Prolog
Raw Normal View History

QT += quick
QT += webchannel
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Refer to the documentation for the
# deprecated API to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
2020-06-18 20:11:12 +00:00
lupdate_only{
SOURCES = *.qml \
app/*.qml \
imports/*.qml \
imports/shared/*.qml \
imports/shared/controls/*.qml \
imports/shared/keycard/*.qml \
imports/shared/panels/*.qml \
imports/shared/popups/*.qml \
imports/shared/status/*.qml \
imports/shared/views/*.qml \
2020-06-18 20:11:12 +00:00
app/AppLayouts/*.qml \
2020-09-22 15:12:48 +00:00
app/AppLayouts/Browser/*.qml \
2020-06-18 20:11:12 +00:00
app/AppLayouts/Chat/*.qml \
2020-12-11 20:38:10 +00:00
app/AppLayouts/Chat/CommunityComponents/*.qml \
2020-06-18 20:11:12 +00:00
app/AppLayouts/Chat/ChatColumn/*.qml \
2020-08-26 15:52:26 +00:00
app/AppLayouts/Chat/ChatColumn/ChatComponents/*.qml \
app/AppLayouts/Chat/ChatColumn/MessageComponents/*.qml \
app/AppLayouts/Chat/ChatColumn/MessageComponents/TransactionComponents/*.qml \
app/AppLayouts/Chat/ContactsColumn/*.qml \
2020-06-18 20:11:12 +00:00
app/AppLayouts/Chat/components/*.qml \
app/AppLayouts/Node/*.qml \
app/AppLayouts/Profile/*.qml \
app/AppLayouts/Profile/LeftTab/*.qml \
2020-08-26 15:52:26 +00:00
app/AppLayouts/Profile/LeftTab/components/*.qml \
2020-06-18 20:11:12 +00:00
app/AppLayouts/Profile/Sections/*.qml \
2021-03-15 20:51:15 +00:00
app/AppLayouts/Profile/Sections/BrowserModals/*.qml \
2020-06-18 20:11:12 +00:00
app/AppLayouts/Profile/Sections/Contacts/*.qml \
2021-03-15 20:51:15 +00:00
app/AppLayouts/Profile/Sections/Data/*.qml \
app/AppLayouts/Profile/Sections/Ens/*.qml \
2021-03-15 20:51:15 +00:00
app/AppLayouts/Profile/Sections/Privileges/*.qml \
app/AppLayouts/Timeline/*.qml\
2020-06-18 20:11:12 +00:00
app/AppLayouts/Wallet/*.qml \
chore: refactor Linux and macOS build/packaging steps Replaces PR #105. Implement a `pkg-macos` target that ultimately results in `Status.dmg` being written to `pkg/`. Due to [limitations][limits] of the OpenSSL `.dylib`s in `/usr/lib/` on macOS, `libssl.a` and `libcrypto.a` are statically linked into `bin/nim_status_client` from a [Homebrew][brew] "bottle" that is compatible with macOS 10.13 (the oldest macOS version compatible with Qt v5.14). `pkg-macos` creates an `.app` bundle layout in `tmp/macos/dist` based partly on information in a very helpful [StackOverflow answer][so-answer]. Note the part of the answer (toward the end) that explains a problem with the working directory and how to fix it. That's the reason for the `nim_status_client.sh` script introduced in this commit (it gets copied into the bundle). It's also the reason for having `Info.plist` copied into the bundle before `macdeployqt` is run (see below) and then overwriting it with `Info.runner.plist` before creating the `.dmg` file. The app icons file `status-icon.icns` was taken from `deployment/macos/` in the [status-react][sr] repo. The [`macdeployqt`][macdeployqt] tool is used to copy the needed portions of Qt into the bundle; it automatically updates `rpath`, etc. so the `nim_status_client` executable in the bundle can locate the libs within the bundle. `macdeployqt` is run twice, for the "outer" and "inner" `.app` bundles, because of an apparent bug in `macdeployqt` that results in QtWebEngine related resources not being processed correctly on the first pass. This results in some bloat in the final bundle but it seems unavoidable at present. The [create-dmg][cdmg] tool is used to package the bundle into a `.dmg` file. There are two reasons for this: 1. It produces a nice looking icon for the `.dmg` that overlays the Status logo on an external disk icon. 2. `Info.plist` needs to be overwritten after running `macdeployqt` (see explanation above) but before creating the `.dmg` file. If we passed the `-dmg` cli option to `macdeployqt` to have it generate the `.dmg` file then it wouldn't be possible to overwrite `Info.plist`. So there is a cosmetic reason and a practical reason for using another tool. Probably the biggest downside is that `create-dmg` is implemented in Node.js so it needs to be installed with `npm`; that's the reason this commit introduces `package.json`, etc. Note that zero code from `node_modules` ends up in the `.app` bundle or the `.dmg` file. Code signing of the macOS `.app` bundle and `.dmg` is attempted if the environment variable `MACOS_CODESIGN_IDENT` is defined. In that case, the environment variable `MACOS_KEYCHAIN_OPT` may optionally be defined with the path to a preferred keychain database file. Refactor a number of sections in the Makefile for consistency's sake, e.g. the `appimage` target becomes `pkg-linux` and ultimately results in `NimStatusClient-x86_64.AppImage` being written to `pkg/`. Make a number of changes to bring the Linux packaging steps up-to-date and use the `-qmlimport` cli option of `linuxdeployqt` to simplify resolution of Qt plugins. Note that `make pkg` will correctly resolve to `make pkg-linux` or `make pkg-macos` depending on the OS in use. Consistently use lower-case "c" in the name of *components* directories and imports. [limits]: https://developer.apple.com/forums/thread/124782 [brew]: https://brew.sh/ [so-answer]: https://stackoverflow.com/a/3251285 [sr]: https://github.com/status-im/status-react/tree/develop/deployment/macos [macdeployqt]: https://doc.qt.io/qt-5/macos-deployment.html [cdmg]: https://github.com/sindresorhus/create-dmg
2020-06-04 20:56:44 +00:00
app/AppLayouts/Wallet/components/*.qml \
app/AppLayouts/Wallet/components/collectiblesComponents/*.qml \
app/AppLayouts/Wallet/data/Currencies.qml \
2020-06-18 20:11:12 +00:00
}
TRANSLATIONS += \
i18n/base.ts \
i18n/qml_en.ts \
i18n/qml_fr.ts \
i18n/qml_it.ts \
i18n/qml_ko.ts \
i18n/qml_ru.ts \
i18n/qml_tr.ts \
i18n/qml_es.ts \
i18n/qml_id.ts \
i18n/qml_de.ts \
i18n/qml_pt_BR.ts \
i18n/qml_fil.ts \
i18n/qml_zh.ts \
i18n/qml_zh_TW.ts \
i18n/qml_ar.ts \
i18n/qml_ur.ts
2020-06-18 20:55:01 +00:00
RESOURCES += \
2020-05-28 14:58:25 +00:00
imports/Constants.qml \
imports/Style.qml \
main.qml
OTHER_FILES += $$files("$$PWD/*.qml", true)
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH = $$PWD/imports \
$$PWD/StatusQ/src
# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH = $$PWD/imports
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
RESOURCES += resources.qrc