Skip to content

Commit 7c1c178

Browse files
QR code scanner (QML component) (#9464)
Co-authored-by: Richard Ramos <[email protected]>
1 parent eed9880 commit 7c1c178

24 files changed

+293
-16
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,6 @@
116116
[submodule "vendor/nim-taskpools"]
117117
path = vendor/nim-taskpools
118118
url = https://github.com/status-im/nim-taskpools.git
119+
[submodule "ui/StatusQ/vendor/qzxing"]
120+
path = ui/StatusQ/vendor/qzxing
121+
url = https://github.com/status-im/qzxing.git

Info.dev.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,7 @@
3737
<integer>0</integer>
3838
<key>NSHighResolutionCapable</key>
3939
<string>True</string>
40+
<key>NSCameraUsageDescription</key>
41+
<string>Scan QR codes</string>
4042
</dict>
4143
</plist>

Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,7 @@
3737
<integer>0</integer>
3838
<key>NSHighResolutionCapable</key>
3939
<string>True</string>
40+
<key>NSCameraUsageDescription</key>
41+
<string>Scan QR codes</string>
4042
</dict>
4143
</plist>

Makefile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ endif
149149

150150
MONITORING ?= false
151151
ifneq ($(MONITORING), false)
152-
DOTHERSIDE_CMAKE_PARAMS := ${DOTHERSIDE_CMAKE_PARAMS} -DMONITORING:BOOL=ON -DMONITORING_QML_ENTRY_POINT:STRING="/../monitoring/Main.qml"
152+
DOTHERSIDE_CMAKE_PARAMS += -DMONITORING:BOOL=ON -DMONITORING_QML_ENTRY_POINT:STRING="/../monitoring/Main.qml"
153153
endif
154154

155155

@@ -175,18 +175,23 @@ ifneq ($(detected_OS),Windows)
175175
NIM_PARAMS += --passL:"-L$(QT5_LIBDIR)"
176176
endif
177177
endif
178+
# We manually link QZXing to Nim application,
179+
# because static libraries are not compiled into other static libraries (DOtherSide).
180+
QZXING := vendor/DOtherSide/build/qzxing/libqzxing.a
178181
DOTHERSIDE := vendor/DOtherSide/build/lib/libDOtherSideStatic.a
179182
DOTHERSIDE_CMAKE_PARAMS += -DENABLE_DYNAMIC_LIBS=OFF -DENABLE_STATIC_LIBS=ON
180183
# order matters here, due to "-Wl,-as-needed"
181-
NIM_PARAMS += --passL:"$(DOTHERSIDE)" --passL:"$(shell PKG_CONFIG_PATH="$(QT5_PCFILEDIR)" pkg-config --libs Qt5Core Qt5Qml Qt5Gui Qt5Quick Qt5QuickControls2 Qt5Widgets Qt5Svg Qt5Multimedia)"
184+
NIM_PARAMS += --passL:"$(DOTHERSIDE)" --passL:"$(QZXING)" --passL:"$(shell PKG_CONFIG_PATH="$(QT5_PCFILEDIR)" pkg-config --libs Qt5Core Qt5Qml Qt5Gui Qt5Quick Qt5QuickControls2 Qt5Widgets Qt5Svg Qt5Multimedia)"
182185
else
183186
ifneq ($(QML_DEBUG), false)
187+
QZXING := vendor/DOtherSide/build/qzxing/Debug/qzxing.lib
184188
DOTHERSIDE := vendor/DOtherSide/build/lib/Debug/DOtherSide.dll
185189
else
190+
QZXING := vendor/DOtherSide/build/qzxing/Release/qzxing.lib
186191
DOTHERSIDE := vendor/DOtherSide/build/lib/Release/DOtherSide.dll
187192
endif
188193
DOTHERSIDE_CMAKE_PARAMS += -T"v141" -A x64 -DENABLE_DYNAMIC_LIBS=ON -DENABLE_STATIC_LIBS=OFF
189-
NIM_PARAMS += -L:$(DOTHERSIDE)
194+
NIM_PARAMS += -L:$(DOTHERSIDE) -L:$(QZXING)
190195
NIM_EXTRA_PARAMS := --passL:"-lsetupapi -lhid"
191196
endif
192197

@@ -238,6 +243,9 @@ $(DOTHERSIDE): | deps
238243
cmake $(DOTHERSIDE_CMAKE_PARAMS)\
239244
-DENABLE_DOCS=OFF \
240245
-DENABLE_TESTS=OFF \
246+
-DQZXING_USE_QML=ON \
247+
-DQZXING_MULTIMEDIA=ON \
248+
-DQZXING_USE_DECODER_QR_CODE=ON \
241249
.. $(HANDLE_OUTPUT) && \
242250
$(DOTHERSIDE_BUILD_CMD)
243251

build-linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ docker run -it --rm \
1313
-u jenkins:$(getent group $(whoami) | cut -d: -f3) \
1414
-v "${PWD}:/status-desktop" \
1515
-w /status-desktop \
16-
statusteam/nim-status-client-build:1.2.0-qt5.15.2 \
16+
statusteam/nim-status-client-build:1.2.1-qt5.15.2 \
1717
./docker-linux-app-image.sh

ci/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ RUN apt update -yq && apt install -yq software-properties-common \
4040
&& add-apt-repository -y ppa:git-core/ppa \
4141
&& add-apt-repository -y ppa:ubuntu-toolchain-r/test \
4242
&& apt update -yq && apt full-upgrade -yq && apt install -yq --no-install-recommends --fix-missing \
43-
gnupg2 openssh-client ca-certificates locales sudo jq curl wget fuse s3cmdfile llvm tk-dev xz-utils \
43+
gnupg2 openssh-client ca-certificates locales sudo jq curl wget fuse s3cmd file llvm tk-dev xz-utils \
4444
git make build-essential pkg-config cmake extra-cmake-modules gcc-9 g++-9 \
4545
libgl1-mesa-dev libsm6 libice6 libfontconfig1 libdbus-1-3 libssl-dev libz-dev \
46-
zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev \
46+
zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev unixodbc-dev libpq-dev \
4747
libncurses5-dev libncursesw5-dev libpcsclite-dev libpcre3-dev libnss3 \
4848
gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \
4949
gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-alsa libpulse-mainloop-glib0 \

ci/Jenkinsfile.linux

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pipeline {
77
agent {
88
docker {
99
label 'linux'
10-
image 'statusteam/nim-status-client-build:1.2.0-qt5.15.2'
10+
image 'statusteam/nim-status-client-build:1.2.1-qt5.15.2'
1111
/* allows jenkins use cat and mounts '/dev/fuse' for linuxdeployqt */
1212
args '--entrypoint="" --cap-add SYS_ADMIN --security-opt apparmor:unconfined --device /dev/fuse'
1313
}

ci/Jenkinsfile.tests-nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pipeline {
77
agent {
88
docker {
99
label 'linux'
10-
image 'statusteam/nim-status-client-build:1.2.0-qt5.15.2'
10+
image 'statusteam/nim-status-client-build:1.2.1-qt5.15.2'
1111
}
1212
}
1313

docker-linux-app-image.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
cp -R . ~/status-desktop
55
cd ~/status-desktop
66

7-
git clean -dfx && rm -rf vendor/* && make -j4 V=1 update
7+
git clean -dfx && rm -rf vendor/* && git checkout vendor/DOtherSide && make -j4 V=1 update
88
make V=1 pkg
99

1010
# Make AppImage build accessible to the docker host

scripts/ubuntu_build_setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function check_version {
1818
function install_build_dependencies {
1919
echo "Install build dependencies"
2020
apt update
21-
apt install -yq git build-essential pkg-config mesa-common-dev \
21+
apt install -yq git build-essential pkg-config mesa-common-dev unixodbc-dev libpq-dev \
2222
libglu1-mesa-dev wget libpcsclite-dev libpcre3-dev libssl-dev libpulse-mainloop-glib0 \
2323
libxkbcommon-x11-dev extra-cmake-modules cmake
2424
}

0 commit comments

Comments
 (0)