Skip to content

Instantly share code, notes, and snippets.

@theshadowx
Last active September 24, 2021 17:35
Show Gist options
  • Save theshadowx/438297ac465874a5e226 to your computer and use it in GitHub Desktop.
Save theshadowx/438297ac465874a5e226 to your computer and use it in GitHub Desktop.
Qt/Qml With Chrome Native Client (NaCl)
#!/bin/bash
set -e
# Install NaCl
wget http://storage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/nacl_sdk.zip
unzip nacl_sdk.zip
rm nacl_sdk.zip
nacl_sdk/naclsdk list
# get the latest stable bender
nacl_sdk/naclsdk install pepper_47
NACL_SDK_ROOT=$(pwd)/$(find ./nacl_sdk -maxdepth 1 -type d -name "pepper*")
echo "export NACL_SDK_ROOT=$NACL_SDK_ROOT">> ~/.bashrc
source ~/.bashrc
# Checkout Qt 5.6.0
git clone git://code.qt.io/qt/qt5.git Qt5.6
cd Qt5.6
git checkout 5.6
perl init-repository
git checkout 5.6
cd ..
cd Qt5.6/qtbase
git checkout wip/nacl
cd ../qtdeclarative
git checkout wip/nacl
cd ../qtxmlpatterns
git apply ../../qtxmlpatterns.patch
cd ../..
mkdir QtNaCl_56
cd QtNaCl_56
../Qt5.6/qtbase/nacl-configure linux_x86_newlib release 64
make module-qtbase -j6
make module-qtdeclarative -j6
make module-qtquickcontrols -j6
#running the example
# cd ../Qt5.4.2/qtdeclarative/examples/nacl
# mkdir build
# cd build
# ../../../../../QtNacl_5.4/qtbase/bin/qmake ..
# make
# ../../../../../QtNacl_5.4/qtbase/bin/nacldeployqt nacl.nexe --run
diff --git a/tools/tools.pro b/tools/tools.pro
index 92bbaca..0040747 100644
--- a/tools/tools.pro
+++ b/tools/tools.pro
@@ -1,9 +1,11 @@
TEMPLATE = subdirs
load(qfeatures)
-!android|android_app {
- SUBDIRS += xmlpatterns
- !contains(QT_DISABLED_FEATURES, xmlschema) {
- SUBDIRS += xmlpatternsvalidator
+!nacl {
+ !android|android_app {
+ SUBDIRS += xmlpatterns
+ !contains(QT_DISABLED_FEATURES, xmlschema) {
+ SUBDIRS += xmlpatternsvalidator
+ }
}
}
diff --git a/tools/xmlpatterns/xmlpatterns.pro b/tools/xmlpatterns/xmlpatterns.pro
index 0f1ee4f..1172883 100644
--- a/tools/xmlpatterns/xmlpatterns.pro
+++ b/tools/xmlpatterns/xmlpatterns.pro
@@ -14,4 +14,4 @@ HEADERS = main.h \
load(qt_tool)
# with c++11 / __STRICT_ANSI__ mingw.org stdio.h doesn't declare e.g. _fileno
-win32-g++*: QMAKE_CXXFLAGS_CXX11 = -std=gnu++0x
\ No newline at end of file
+win32-g++*: QMAKE_CXXFLAGS_CXX11 = -std=gnu++0x
diff --git a/tools/xmlpatternsvalidator/xmlpatternsvalidator.pro b/tools/xmlpatternsvalidator/xmlpatternsvalidator.pro
index af9469f..21b1b18 100644
--- a/tools/xmlpatternsvalidator/xmlpatternsvalidator.pro
+++ b/tools/xmlpatternsvalidator/xmlpatternsvalidator.pro
@@ -1,6 +1,8 @@
-QT = core xmlpatterns
+!nacl {
+ QT = core xmlpatterns
-SOURCES = main.cpp
-HEADERS = main.h
+ SOURCES = main.cpp
+ HEADERS = main.h
-load(qt_tool)
+ load(qt_tool)
+}
@poltpolt
Copy link

i recommend running
git submodule update --init
after cd Qt5.6 in the script

otherwise I was getting
Submodule 'qtxmlpatterns' (git://code.qt.io/qt/qtxmlpatterns.git) registered for path 'qtxmlpatterns'

  • git config commit.template /home/polrus/qt-nacl/Qt5.6/.commit-template
  • git clone --no-checkout git://code.qt.io/qt/qt5/../qt3d.git qt3d
    Cloning into 'qt3d'...
    fatal: remote error: no such repository: /qt/qt5/../qt3d.git

the the same for qtactiveqt

@kom1che
Copy link

kom1che commented May 16, 2017

HI Ali,

First of all I would like to thank you for so outstanding wor done (script sharing, expalanation and video).

I am trying to do all the steps (with Ubuntu 14.10 64-bit, Qt cloned from https://github.com/qt/qt5.git (for writing application I used anoter version Qt 5.5.1), qt5-qtbase cloned from https://github.com/msorvig/qt5-qtbase-nacl.git and qt5-qtdeclarative cloned from https://github.com/msorvig/qt5-qtdeclarative-nacl.git) but on the step -

make module-qtdeclarative -j6
make module-qtquickcontrols -j6

  • the following error arised in the terminal:

Project ERROR: Unknown module(s) in QT_PRIVATE: zlib-private
make[2]: *** [sub-svg-make_first-ordered] Ошибка 3
make[2]: Выход из каталога /home/komche/QtNaCl_5_6/qtsvg/src' make[1]: *** [sub-src-make_first] Ошибка 2 make[1]: Выход из каталога /home/komche/QtNaCl_5_6/qtsvg'
make: *** [module-qtsvg] Ошибка 2

Also I tried to build Dockerfile but I received another error as follows:

Running configuration tests...
Warning: Disabling pkg-config since PKG_CONFIG_LIBDIR is not set.
Warning: Disabling pkg-config since PKG_CONFIG_SYSROOT_DIR is not set.
Determining architecture... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -g -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I../../../../Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I../../../../Qt5.4_src/qtbase/config.tests/arch -I/opt/nacl_sdk//include -I. -o arch.o ../../../../Qt5.4_src/qtbase/config.tests/arch/arch.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [arch.o] Error 127
Unable to determine architecture!

Couldnot determine the target architecture!
Turn on verbose messaging (-v) to see the final report.
Determining architecture... ()
g++ -c -pipe -g -Wall -W -fPIE -I../../../../Qt5.4_src/qtbase/mkspecs/linux-g++ -I../../../../Qt5.4_src/qtbase/config.tests/arch -I/opt/nacl_sdk//include -I. -o arch.o ../../../../Qt5.4_src/qtbase/config.tests/arch/arch.cpp
g++ -o arch arch.o -L/opt/nacl_sdk//lib/pnacl/Release
Found architecture in binary
CFG_HOST_ARCH="x86_64"
CFG_HOST_CPUFEATURES=" mmx sse sse2"
System architecture: 'unknown'
Host architecture: 'x86_64'
floatmath auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/floatmath -I/opt/nacl_sdk//include -I. -o floatmath.o /opt/Qt5.4_src/qtbase/config.tests/unix/floatmath/floatmath.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [floatmath.o] Error 127
floatmath disabled.
zlib auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/zlib -I/opt/nacl_sdk//include -I. -o zlib.o /opt/Qt5.4_src/qtbase/config.tests/unix/zlib/zlib.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [zlib.o] Error 127
zlib disabled.
mtdev auto-detection... ()
Project ERROR: mtdev development package not found
mtdev disabled.
libjpeg auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/libjpeg -I/opt/nacl_sdk//include -I. -o libjpeg.o /opt/Qt5.4_src/qtbase/config.tests/unix/libjpeg/libjpeg.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [libjpeg.o] Error 127
libjpeg disabled.
libpng auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/libpng -I/opt/nacl_sdk//include -I. -o libpng.o /opt/Qt5.4_src/qtbase/config.tests/unix/libpng/libpng.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [libpng.o] Error 127
libpng disabled.
DB2 auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/db2 -I/opt/nacl_sdk//include -I. -o db2.o /opt/Qt5.4_src/qtbase/config.tests/unix/db2/db2.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [db2.o] Error 127
DB2 disabled.
InterBase auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/ibase -I/opt/nacl_sdk//include -I. -o ibase.o /opt/Qt5.4_src/qtbase/config.tests/unix/ibase/ibase.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [ibase.o] Error 127
InterBase disabled.
MySQL (thread-safe) auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/mysql_r -I/opt/nacl_sdk//include -I. -o mysql.o /opt/Qt5.4_src/qtbase/config.tests/unix/mysql/mysql.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [mysql.o] Error 127
MySQL (thread-safe) disabled.
MySQL (thread-unsafe) auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/mysql -I/opt/nacl_sdk//include -I. -o mysql.o /opt/Qt5.4_src/qtbase/config.tests/unix/mysql/mysql.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [mysql.o] Error 127
MySQL (thread-unsafe) disabled.
OCI auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/oci -I/opt/nacl_sdk//include -I. -o oci.o /opt/Qt5.4_src/qtbase/config.tests/unix/oci/oci.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [oci.o] Error 127
OCI disabled.
ODBC auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/odbc -I/opt/nacl_sdk//include -I. -o odbc.o /opt/Qt5.4_src/qtbase/config.tests/unix/odbc/odbc.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [odbc.o] Error 127
ODBC disabled.
iODBC auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/iodbc -I/opt/nacl_sdk//include -I. -o iodbc.o /opt/Qt5.4_src/qtbase/config.tests/unix/iodbc/iodbc.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [iodbc.o] Error 127
iODBC disabled.
PostgreSQL auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/psql -I/opt/nacl_sdk//include -I. -o psql.o /opt/Qt5.4_src/qtbase/config.tests/unix/psql/psql.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [psql.o] Error 127
PostgreSQL disabled.
SQLite2 auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/sqlite2 -I/opt/nacl_sdk//include -I. -o sqlite2.o /opt/Qt5.4_src/qtbase/config.tests/unix/sqlite2/sqlite2.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [sqlite2.o] Error 127
SQLite2 disabled.
TDS auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/tds -I/opt/nacl_sdk//include -I. -o tds.o /opt/Qt5.4_src/qtbase/config.tests/unix/tds/tds.cpp
make: TDS disabled.
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [tds.o] Error 127
NIS auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/nis -I/opt/nacl_sdk//include -I. -o nis.o /opt/Qt5.4_src/qtbase/config.tests/unix/nis/nis.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [nis.o] Error 127
NIS disabled.
Cups auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/cups -I/opt/nacl_sdk//include -I. -o cups.o /opt/Qt5.4_src/qtbase/config.tests/unix/cups/cups.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [cups.o] Error 127
Cups disabled.
POSIX iconv auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/iconv -I/opt/nacl_sdk//include -I. -o iconv.o /opt/Qt5.4_src/qtbase/config.tests/unix/iconv/iconv.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [iconv.o] Error 127
POSIX iconv disabled.
SUN libiconv auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/sun-libiconv -I/opt/nacl_sdk//include -I. -o gnu-libiconv.o /opt/Qt5.4_src/qtbase/config.tests/unix/gnu-libiconv/gnu-libiconv.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [gnu-libiconv.o] Error 127
SUN libiconv disabled.
GNU libiconv auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/gnu-libiconv -I/opt/nacl_sdk//include -I. -o gnu-libiconv.o /opt/Qt5.4_src/qtbase/config.tests/unix/gnu-libiconv/gnu-libiconv.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [gnu-libiconv.o] Error 127
GNU libiconv disabled.
Glib auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/glib -I/opt/nacl_sdk//include -I. -o glib.o /opt/Qt5.4_src/qtbase/config.tests/unix/glib/glib.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [glib.o] Error 127
Glib disabled.
ICU auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/icu -I/opt/nacl_sdk//include -I. -o icu.o /opt/Qt5.4_src/qtbase/config.tests/unix/icu/icu.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [icu.o] Error 127
ICU disabled.
PulseAudio auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/pulseaudio -I/opt/nacl_sdk//include -I. -o pulseaudio.o /opt/Qt5.4_src/qtbase/config.tests/unix/pulseaudio/pulseaudio.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [pulseaudio.o] Error 127
PulseAudio disabled.
OpenGL auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/opengldesktop -I/opt/nacl_sdk//include -I. -o opengldesktop.o /opt/Qt5.4_src/qtbase/config.tests/unix/opengldesktop/opengldesktop.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [opengldesktop.o] Error 127
OpenGL disabled.
OpenGL ES 2.0 auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/opengles2 -I/opt/nacl_sdk//include -I. -o opengles2.o /opt/Qt5.4_src/qtbase/config.tests/unix/opengles2/opengles2.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [opengles2.o] Error 127
OpenGL ES 2.0 disabled.
FontConfig auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/fontconfig -I/opt/nacl_sdk//include -I. -o fontconfig.o /opt/Qt5.4_src/qtbase/config.tests/unix/fontconfig/fontconfig.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [fontconfig.o] Error 127
FontConfig disabled.
libudev auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/libudev -I/opt/nacl_sdk//include -I. -o libudev.o /opt/Qt5.4_src/qtbase/config.tests/unix/libudev/libudev.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [libudev.o] Error 127
libudev disabled.
evdev auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/evdev -I/opt/nacl_sdk//include -I. -o evdev.o /opt/Qt5.4_src/qtbase/config.tests/unix/evdev/evdev.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [evdev.o] Error 127
evdev disabled.
XLib auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/x11/xlib -I/opt/nacl_sdk//include -I. -o xlib.o /opt/Qt5.4_src/qtbase/config.tests/x11/xlib/xlib.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [xlib.o] Error 127
XLib disabled.
Xrender auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/x11/xrender -I/opt/nacl_sdk//include -I. -o xrender.o /opt/Qt5.4_src/qtbase/config.tests/x11/xrender/xrender.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [xrender.o] Error 127
Xrender disabled.
XInput2 auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/x11/xinput2 -I/opt/nacl_sdk//include -I. -o xinput2.o /opt/Qt5.4_src/qtbase/config.tests/x11/xinput2/xinput2.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [xinput2.o] Error 127
XInput2 disabled.
xcb auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/qpa/xcb -I/opt/nacl_sdk//include -I. -o xcb.o /opt/Qt5.4_src/qtbase/config.tests/qpa/xcb/xcb.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [xcb.o] Error 127
xcb disabled.
LinuxFB auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/qpa/linuxfb -I/opt/nacl_sdk//include -I. -o linuxfb.o /opt/Qt5.4_src/qtbase/config.tests/qpa/linuxfb/linuxfb.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [linuxfb.o] Error 127
LinuxFB disabled.
KMS auto-detection... ()
Project ERROR: egl development package not found
KMS disabled.
EGL auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/qpa/egl -I/opt/nacl_sdk//include -I. -o egl.o /opt/Qt5.4_src/qtbase/config.tests/qpa/egl/egl.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [egl.o] Error 127
EGL disabled.
FreeType auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/freetype -I/opt/nacl_sdk//include -I. -o freetype.o /opt/Qt5.4_src/qtbase/config.tests/unix/freetype/freetype.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [freetype.o] Error 127
FreeType disabled.
STL auto-detection... ()
/opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++ -c -pipe -O2 -Wall -W -fPIE -DQ_OS_NACL_PEPPER -I/opt/Qt5.4_src/qtbase/mkspecs/unsupported/pnacl-newlib-clang -I/opt/Qt5.4_src/qtbase/config.tests/unix/stl -I/opt/nacl_sdk//include -I. -o stltest.o /opt/Qt5.4_src/qtbase/config.tests/unix/stl/stltest.cpp
make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found
make: *** [stltest.o] Error 127
STL disabled.
STL functionality check failed! Cannot build Qt with this STL library.
Turn on verbose messaging (-v) to /opt/Qt5.4_src/qtbase/configure to see the final report.
INFO[3594] The command [/bin/sh -c bash -c " NACL_SDK_ROOT=/opt/nacl_sdk/$(find /opt/nacl_sdk -maxdepth 1 -type d -printf "%f\n" | grep 'pepper') /opt/Qt5.4_src/qtbase/nacl-configure linux_pnacl release 64 -v -release -nomake examples -nomake tests -nomake tools"] returned a non-zero code: 101

I will appreciate if you can help to find out what I did wrong.

Best regards,
Artem.

@kom1che
Copy link

kom1che commented May 17, 2017

Hi,

in addition, the following info showes when I configured Qt:

Creating qmake...
.........................................................................................Done.
Running configuration tests (phase 2)...
Warning: Disabling pkg-config since PKG_CONFIG_LIBDIR is not set and
the host's .pc files would be used (even if you set PKG_CONFIG_PATH).
Set this variable to the directory that contains target .pc files
for pkg-config to function correctly when cross-compiling or
use -pkg-config to override this test.
Warning: Disabling pkg-config since PKG_CONFIG_SYSROOT_DIR is not set.
Set this variable to your sysroot for pkg-config to function correctly when
cross-compiling or use -pkg-config to override this test.

WARNING: Using static linking will disable the WebKit module.

Done running configuration tests.

Configure summary

Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)
Building for: unsupported/pnacl-newlib-clang (unknown, CPU features: none detected)
Platform notes:

        - Also available for Linux: linux-clang linux-kcc linux-icc linux-cxx

Build options:
Configuration .......... accessibility audio-backend compile_examples concurrent cross_compile freetype full-config gif harfbuzz iconv jpeg large-config largefile medium-config minimal-config no-pkg-config no-qml-debug opengl opengles2 pcre png precompile_header private_tests qpa qpa reduce_exports release rpath small-config static use_gold_linker zlib
Build parts ............ libs
Mode ................... release
Using sanitizer(s)...... none
Using C++ standard ..... c++98
Using gold linker....... yes
Using new DTAGS ........ no
Using PCH .............. yes
Using LTCG ............. no
Target compiler supports:

Qt modules and options:
Qt D-Bus ............... no
Qt Concurrent .......... yes
Qt GUI ................. yes
Qt Widgets ............. yes
Large File ............. yes
QML debugging .......... no
Use system proxies ..... no

Support enabled for:
Accessibility .......... yes
ALSA ................... no
CUPS ................... no
Evdev .................. no
FontConfig ............. no
FreeType ............... yes (bundled copy)
Glib ................... no
GStreamer .............. no
GTK theme .............. no
HarfBuzz ............... yes (bundled copy)
Iconv .................. yes
ICU .................... no
Image formats:
GIF .................. yes (in QtGui, using bundled copy)
JPEG ................. yes (in QtGui, using bundled copy)
PNG .................. yes (in QtGui, using bundled copy)
libinput................ no
Logging backends:
journald ............... no
syslog ............... no
mtdev .................. no
Networking:
getaddrinfo .......... no
getifaddrs ........... no
IPv6 ifname .......... no
libproxy.............. no
OpenSSL .............. no
NIS .................... no
OpenGL / OpenVG:
EGL .................. no
OpenGL ............... yes (OpenGL ES 2.0+)
OpenVG ............... no
PCRE ................... yes (bundled copy)
pkg-config ............. no
PulseAudio ............. no
QPA backends:
DirectFB ............. no
EGLFS ................ no
EGLFS i.MX6 ........ no
EGLFS i.MX6 Wayland. no
EGLFS EGLDevice .... no
EGLFS GBM .......... no
EGLFS Mali ......... no
EGLFS Raspberry Pi . no
EGLFS X11 .......... no
LinuxFB .............. no
Mir client............ no
XCB .................. no
Session management ..... yes
SQL drivers:
DB2 .................. no
InterBase ............ no
MySQL ................ no
OCI .................. no
ODBC ................. no
PostgreSQL ........... no
SQLite 2 ............. no
SQLite ............... yes (plugin, using bundled copy)
TDS .................. no
tslib .................. no
udev ................... no
xkbcommon-x11........... no
xkbcommon-evdev......... no
zlib ................... yes (bundled copy)

WARNING: Using static linking will disable the use of dynamically
loaded plugins. Make sure to import all needed static plugins,
or compile needed modules into the library.
Info: creating super cache file /home/komche/QtNaCl_56/.qmake.super

    NOTICE: configure was unable to determine the architecture
    for the /home/komche/Qt5.6/qtbase/mkspecs/unsupported/pnacl-newlib-clang target.

    Qt will not use a specialized implementation for any atomic
    operations. Instead a generic implemention based on either GCC
    intrinsics or C++11 std::atomic<T> will be used (when
    available). The generic implementations are generally as fast
    as and always as safe as a specialized implementation.

    If no generic implementation is available, Qt will use a
    fallback UNIX implementation which uses a single
    pthread_mutex_t to protect all atomic operations. This
    implementation is the slow (but safe) fallback implementation
    for architectures Qt does not yet support.

    NOTICE: The -no-c++11 / --c++-level=c++98 option is deprecated.

    Qt 5.7 will require C++11 support. The options are in effect for this
    Qt 5.6 build, but you should update your build scripts to remove the
    option and, if necessary, upgrade your compiler.

Qt is now configured for building. Just run 'make'.
Once everything is built, Qt is installed.
You should not run 'make install'.

Prior to reconfiguration, make sure you remove any leftovers from
the previous build.

@theshadowx
Copy link
Author

Hi @kom1che
Sorry for the late answer (gist doesn't send notifications) .

make: /opt/nacl_sdk//toolchain/linux_pnacl/bin/pnacl-clang++: Command not found

I think there are some issues with the toolchain.
And for the configuration of the source, did you follow the same steps in the script ?


I have done a Docker image of Ubuntu 16.04 with Qt5.6 compiled with pepper_47 toolchain : --> https://hub.docker.com/r/theshadowx/qt_nacl/

To use it :
you should first install docker
https://docs.docker.com/engine/installation/linux/ubuntu/

and then download the image

$> docker pull theshadowx/qt_nacl:pepper47_qt56

How to use the image

Create build folder

$> docker run --rm -it -v /path/to/ProjectFolder:/data/example theshadowx/qt_nacl:pepper47_qt56 bash -c "mkdir /data/example/build/"

Generate Makefile

$> docker run --rm -it -v /path/to/ProjectFolder:/data/example theshadowx/qt_nacl:pepper47_qt56 bash -c  "/opt/QtNaCl_5.4/qtbase/bin/qmake /data/example -o /data/example/build/"

Compile the project

docker run --rm -it -v /path/to/ProjectFolder:/data/example theshadowx/qt5.4-nacl bash -c "cd /data/example/build && make"

Run the app

docker run --rm -it -p 8000:8000 -v /path/to/ProjectFolder:/data/example theshadowx/qt5.4-nacl bash -c "cd /data/example/build && /opt/QtNaCl_5.4/qtbase/bin/nacldeployqt ProjectName.bc --run"

In the Chrome browser use this address :

172.17.0.1:8000

If everything worked well you'll see the app loaded in Chrome browser

@theshadowx
Copy link
Author

@polrus
Sorry for the late response.

Have you been able to run an app successfully in Chrome with the script + your modifications ?

@kom1che
Copy link

kom1che commented May 22, 2017

Hi Ali,

Thank you for respond.
I tried to do all you advise, but unfortunately on the step "$ /path/to/QtNaCl.sh" I received the followinr error in the command line:

Ваша ветка обновлена в соответствии с (Your branch updated related to) «origin/5.6».
Checking out files: 100% (2035/2035), done.
Предыдущая позиция (Previous position) HEAD была (was) 50d9ee2... Improve QStringBuilder docs
Ветка (Branch) wip/nacl отслеживает внешнюю ветку (Keeps track of the external branch) wip/nacl из (from) origin.
Переключено на новую ветку (Switched to a new branch) «wip/nacl»
Checking out files: 100% (733/733), done.
Предыдущая позиция (Previous position) HEAD была (was) 2da8e40... QML: clear the property cache on QObjectWrapper destuction
Ветка (Branch) wip/nacl отслеживает внешнюю ветку (Keeps track of the external branch) wip/nacl из (from) origin.
Переключено на новую ветку (Switched to a new branch) «wip/nacl»

Directory not found: /home/komche/./nacl_sdk/pepper_47 ./nacl_sdk/pepper_49. Check NACL_SDK_ROOT.

make: *** Нет правила для сборки цели (There is no rule to build a goal) `module-qtbase'. Останов (Stoped).

May be I need to delete all previous Qt versions before start, or rebbot the OS? How do you think?

@theshadowx
Copy link
Author

@kom1che the issue is that you have two versions of pepper installed in your home directory
--> /home/komche/./nacl_sdk/pepper_47
--> /home/komche/./nacl_sdk/pepper_49

so when $(find ./nacl_sdk -maxdepth 1 -type d -name "pepper*") is executed it finds two elements that's why NACL_SDK_ROOT is /home/komche/./nacl_sdk/pepper_47 ./nacl_sdk/pepper_49 where it should be /home/komche/./nacl_sdk/pepper_47 if you had installed just pepper 47

@kom1che
Copy link

kom1che commented May 23, 2017

Thank you! It helped.

One more question, when I am trying to generate makefile

$> docker run --rm -it -v /path/to/ProjectFolder:/data/example theshadowx/qt_nacl:pepper47_qt56 bash -c "/opt/QtNaCl_5.4/qtbase/bin/qmake /data/example -o /data/example/build/"

the following problem occured -

komche@komche-K56CM:/$ sudo docker run --rm -it -v /home/komche/CheckRD:/home/komche/RD_stage theshadowx/qt_nacl:pepper47_qt56 bash -c "/home/komche/QtNaCl_56/qtbase/bin/qmake /home/komche/RD_stage -o /home/komche/RD_stage/build/"
[sudo] password for komche:
bash: /home/komche/QtNaCl_56/qtbase/bin/qmake: No such file or directory
komche@komche-K56CM:/$ cd /home/komche
komche@komche-K56CM:~$

However , /path/to/QtNaCl.sh created this folder (QtNaCl_56) exactly in this path - /home/komche/QtNaCl_56

2017-05-23 23 55 23

@theshadowx
Copy link
Author

theshadowx commented May 24, 2017

This because docker run will start a container and all the commands that are used will be launched inside this container.
so the path /home/komche/QtNaCl_56/qtbase/bin/qmake doesn't exist inside the container but in the host (your computer).
So the solution is to use /opt/QtNaCl_5.4/qtbase/bin/qmake:

sudo docker run --rm -it -v /home/komche/CheckRD:/home/komche/RD_stage theshadowx/qt_nacl:pepper47_qt56 bash -c "/opt/QtNaCl_5.4/qtbase/bin/qmake /home/komche/RD_stage -o /home/komche/RD_stage/build/"

I think you can directly execute qmake without bash -c

sudo docker run --rm -it -v /home/komche/CheckRD:/home/komche/RD_stage theshadowx/qt_nacl:pepper47_qt56 /opt/QtNaCl_5.4/qtbase/bin/qmake /home/komche/RD_stage -o /home/komche/RD_stage/build/

N.B

If you want to use Docker, you don't need to execute the script.
Using Docker image (theshadowx/qt_nacl) is an alternative that simplifies the use of Qt compiled with NaCl, you'll need just to to pull the image and run the container and then voila, you have Qt with qmake and all the binaries needed to build your app and deploy it, no need to clone Qt nor configure, nor compile it. ;)

@kom1che
Copy link

kom1che commented May 24, 2017

Unfortunatelly, it doesn't work properly:

komche@komche-K56CM:$ sudo docker run --rm -it -v /home/komche/CheckRD:/home/komche/RD_stage theshadowx/qt_nacl:pepper47_qt56 bash -c "mkdir /home/komche/RD_stage/build/"
komche@komche-K56CM:
$ sudo docker run --rm -it -v /home/komche/CheckRD:/home/komche/RD_stage theshadowx/qt_nacl:pepper47_qt56 /opt/QtNaCl_5.4/qtbase/bin/qmake /home/komche/RD_stage -o /home/komche/RD_stage/build/
docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: "/opt/QtNaCl_5.4/qtbase/bin/qmake": stat /opt/QtNaCl_5.4/qtbase/bin/qmake: no such file or directory".

When I launched script from your repository, all three folders (nacl_sdk, Qt5.6 and QtNaCl_56) were created inside my home folder (/home/komche). So, there is no QtNaCl_5.4 folder in the path /opt/QtNaCl_5.4/qtbase/bin/qmake.

@kom1che
Copy link

kom1che commented May 24, 2017

May be I need to launch your script inside /opt ?

@theshadowx
Copy link
Author

no need, if you use the script and everything goes well, you should find QtNaCl_56 in the same directory as the script

@kom1che
Copy link

kom1che commented May 24, 2017

yes, you wright. Script created three folders in the same place (/home/komche). But in the command for generating makefile stand /opt/QtNaCl_5.4/qtbase/bin/qmake which is not existed in my host folder /opt (/opt/QtNaCl_5.4/qtbase/bin/qmake: no such file or directory). So what I need to put instead?
image

@kom1che
Copy link

kom1che commented May 24, 2017

In addition, I noticed that in docker command stand QtNaCl_5.4 and script creates QtNaCl_56...

@theshadowx
Copy link
Author

theshadowx commented May 24, 2017

Just forget about the script:
My apologies, I have given you bad docker command line.
Here is what should be done (I have just tested in my machine)

Qmake

I have added workdir argument so it will make things easier. we need just to call qmake add the path to the directory where .pro is present, I presume here that your main .pro is in /home/komche/RD_stage.

sudo docker run --rm -it -v /home/komche/CheckRD:/home/komche/RD_stage -w=/home/komche/RD_stage theshadowx/qt_nacl:pepper47_qt56 /opt/QtNaCl_56/qtbase/bin/qmake ..

Make

The Makefile has been generated in the previous command so as we are setting the workdir as build we need just to call make

sudo docker run --rm -it -v /home/komche/CheckRD:/home/komche/RD_stage -w=/home/komche/RD_stage theshadowx/qt_nacl:pepper47_qt56 make

Deploy

Just be sure that the file generated is CheckRD.bc

sudo docker run --rm -it -v /home/komche/CheckRD:/home/komche/RD_stage -p 8000:8000 -w=/home/komche/RD_stage theshadowx/qt_nacl:pepper47_qt56 /opt/QtNaCl_56/qtbase/bin/nacldeployqt CheckRD.bc --run

@kom1che
Copy link

kom1che commented May 25, 2017

Hi, you are right. this is project folder
image

However, I tried different commands you gave but next error always arises as follows:

komche@komche-K56CM:~$ sudo docker run --rm -it -v /home/komche/CheckRD:/home/komche/RD_stage theshadowx/qt_nacl:pepper47_qt56 bash -c "/opt/QtNaCl_56/qtbase/bin/qmake /home/komche/RD_stage -o /home/komcheRD_stage/build/"
Cannot read /home/komche/RD_stage: file to open is a directory
Error processing project file: /home/komche/RD_stage

komche@komche-K56CM:~$ sudo docker run --rm -it -v /home/komche/CheckRD:/home/komche/RD_stage theshadowx/qt_nacl:pepper47_qt56 /opt/QtNaCl_56/qtbase/bin/qmake /home/komche/RD_stage -o /home/komche/RD_stage/build/
Cannot read /home/komche/RD_stage: file to open is a directory
Error processing project file: /home/komche/RD_stage

komche@komche-K56CM:~$ sudo docker run --rm -it -v /home/komche/CheckRD:/home/komche/RD_stage -w=/home/komche/RD_stage theshadowx/qt_nacl:pepper47_qt56 /opt/QtNaCl_56/qtbase/bin/qmake ..
Cannot read /home/komche: file to open is a directory
Error processing project file: .
.

@theshadowx
Copy link
Author

theshadowx commented May 25, 2017

From the picture, the project folder is RD_stage and not CheckRD that's why it doesn't work. Then the commands should be as the following :

Qmake

sudo docker run --rm -it -v /home/komche/RD_stage:/home/komche/RD_stage -w=/home/komche/RD_stage/build theshadowx/qt_nacl:pepper47_qt56 /opt/QtNaCl_56/qtbase/bin/qmake ..

Make

sudo docker run --rm -it -v /home/komche/RD_stage:/home/komche/RD_stage -w=/home/komche/RD_stage/build theshadowx/qt_nacl:pepper47_qt56 make

Deploy

sudo docker run --rm -it -v /home/komche/RD_stage:/home/komche/RD_stage -p 8000:8000 -w=/home/komche/RD_stage/build theshadowx/qt_nacl:pepper47_qt56 /opt/QtNaCl_56/qtbase/bin/nacldeployqt CheckRD.bc --run

@kom1che
Copy link

kom1che commented May 26, 2017

Hi Ali!

Finally the makefile has been generated but only with this command:

komche@komche-K56CM:~$ sudo docker run --rm -it -v /home/komche/RD_stage:/home/komche/RD_stage theshadowx/qt_nacl:pepper47_qt56 /opt/QtNaCl_56/qtbase/bin/qmake /home/komche/RD_stage -o /home/komche/RD_stage/build/

Then I started command for make as follows:

komche@komche-K56CM:~$ sudo docker run --rm -it -v /home/komche/RD_stage:/home/komche/RD_stage theshadowx/qt_nacl:pepper47_qt56 bash -c "cd /home/komche/RD_stage/build && make"

after the process has started in this way, but has stoped with error as follows

komche@komche-K56CM:~$ sudo docker run --rm -it -v /home/komche/RD_stage:/home/komche/RD_stage theshadowx/qt_nacl:pepper47_qt56 bash -c "cd /home/komche/RD_stage/build && make"
/opt/QtNaCl_56/qtbase/bin/uic ../service.ui -o ui_service.h
/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/bin/x86_64-nacl-g++ -m64 -c -pipe -O2 -std=gnu++0x -Wall -W -fPIC -DQ_OS_NACL_PEPPER -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../RD_stage -I. -I/opt/QtNaCl_56/qtbase/include -I/opt/QtNaCl_56/qtbase/include/QtWidgets -I/opt/QtNaCl_56/qtbase/include/QtGui -I/opt/QtNaCl_56/qtbase/include/QtCore -I. -I. -I/opt/nacl_sdk/pepper_47/include -I/opt/Qt5.6/qtbase/mkspecs/unsupported/nacl-x86-newlib-g++-64 -o main.o ../main.cpp
/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/bin/x86_64-nacl-g++ -m64 -c -pipe -O2 -std=gnu++0x -Wall -W -fPIC -DQ_OS_NACL_PEPPER -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../RD_stage -I. -I/opt/QtNaCl_56/qtbase/include -I/opt/QtNaCl_56/qtbase/include/QtWidgets -I/opt/QtNaCl_56/qtbase/include/QtGui -I/opt/QtNaCl_56/qtbase/include/QtCore -I. -I. -I/opt/nacl_sdk/pepper_47/include -I/opt/Qt5.6/qtbase/mkspecs/unsupported/nacl-x86-newlib-g++-64 -o service.o ../service.cpp
/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/bin/x86_64-nacl-g++ -m64 -c -pipe -O2 -std=gnu++0x -Wall -W -fPIC -DQ_OS_NACL_PEPPER -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../RD_stage -I. -I/opt/QtNaCl_56/qtbase/include -I/opt/QtNaCl_56/qtbase/include/QtWidgets -I/opt/QtNaCl_56/qtbase/include/QtGui -I/opt/QtNaCl_56/qtbase/include/QtCore -I. -I. -I/opt/nacl_sdk/pepper_47/include -I/opt/Qt5.6/qtbase/mkspecs/unsupported/nacl-x86-newlib-g++-64 -o originfpl.o ../originfpl.cpp
/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/bin/x86_64-nacl-g++ -m64 -c -pipe -O2 -std=gnu++0x -Wall -W -fPIC -DQ_OS_NACL_PEPPER -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../RD_stage -I. -I/opt/QtNaCl_56/qtbase/include -I/opt/QtNaCl_56/qtbase/include/QtWidgets -I/opt/QtNaCl_56/qtbase/include/QtGui -I/opt/QtNaCl_56/qtbase/include/QtCore -I. -I. -I/opt/nacl_sdk/pepper_47/include -I/opt/Qt5.6/qtbase/mkspecs/unsupported/nacl-x86-newlib-g++-64 -o anime.o ../anime.cpp
../anime.cpp:11: warning: unused parameter 'parent'
../anime.cpp: In member function 'void Anime::setXY(QList, QList)':
../anime.cpp:38: warning: comparison between signed and unsigned integer expressions
/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/bin/x86_64-nacl-g++ -m64 -c -pipe -O2 -std=gnu++0x -Wall -W -fPIC -DQ_OS_NACL_PEPPER -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../RD_stage -I. -I/opt/QtNaCl_56/qtbase/include -I/opt/QtNaCl_56/qtbase/include/QtWidgets -I/opt/QtNaCl_56/qtbase/include/QtGui -I/opt/QtNaCl_56/qtbase/include/QtCore -I. -I. -I/opt/nacl_sdk/pepper_47/include -I/opt/Qt5.6/qtbase/mkspecs/unsupported/nacl-x86-newlib-g++-64 -o rd-artem.nexe_plugin_import.o rd-artem.nexe_plugin_import.cpp
/opt/QtNaCl_56/qtbase/bin/rcc -name src ../src.qrc -o qrc_src.cpp
/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/bin/x86_64-nacl-g++ -m64 -c -pipe -O2 -std=gnu++0x -Wall -W -fPIC -DQ_OS_NACL_PEPPER -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../RD_stage -I. -I/opt/QtNaCl_56/qtbase/include -I/opt/QtNaCl_56/qtbase/include/QtWidgets -I/opt/QtNaCl_56/qtbase/include/QtGui -I/opt/QtNaCl_56/qtbase/include/QtCore -I. -I. -I/opt/nacl_sdk/pepper_47/include -I/opt/Qt5.6/qtbase/mkspecs/unsupported/nacl-x86-newlib-g++-64 -o qrc_src.o qrc_src.cpp
/opt/QtNaCl_56/qtbase/bin/moc -DQ_OS_NACL_PEPPER -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/opt/Qt5.6/qtbase/mkspecs/unsupported/nacl-x86-newlib-g++-64 -I/home/komche/RD_stage -I/opt/QtNaCl_56/qtbase/include -I/opt/QtNaCl_56/qtbase/include/QtWidgets -I/opt/QtNaCl_56/qtbase/include/QtGui -I/opt/QtNaCl_56/qtbase/include/QtCore -I. -I/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/x86_64-nacl/include/c++/4.4.3 -I/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/x86_64-nacl/include/c++/4.4.3/x86_64-nacl -I/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/x86_64-nacl/include/c++/4.4.3/backward -I/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/lib/gcc/x86_64-nacl/4.4.3/include -I/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/lib/gcc/x86_64-nacl/4.4.3/include-fixed -I/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/x86_64-nacl/include ../service.h -o moc_service.cpp
/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/bin/x86_64-nacl-g++ -m64 -c -pipe -O2 -std=gnu++0x -Wall -W -fPIC -DQ_OS_NACL_PEPPER -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../RD_stage -I. -I/opt/QtNaCl_56/qtbase/include -I/opt/QtNaCl_56/qtbase/include/QtWidgets -I/opt/QtNaCl_56/qtbase/include/QtGui -I/opt/QtNaCl_56/qtbase/include/QtCore -I. -I. -I/opt/nacl_sdk/pepper_47/include -I/opt/Qt5.6/qtbase/mkspecs/unsupported/nacl-x86-newlib-g++-64 -o moc_service.o moc_service.cpp
/opt/QtNaCl_56/qtbase/bin/moc -DQ_OS_NACL_PEPPER -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/opt/Qt5.6/qtbase/mkspecs/unsupported/nacl-x86-newlib-g++-64 -I/home/komche/RD_stage -I/opt/QtNaCl_56/qtbase/include -I/opt/QtNaCl_56/qtbase/include/QtWidgets -I/opt/QtNaCl_56/qtbase/include/QtGui -I/opt/QtNaCl_56/qtbase/include/QtCore -I. -I/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/x86_64-nacl/include/c++/4.4.3 -I/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/x86_64-nacl/include/c++/4.4.3/x86_64-nacl -I/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/x86_64-nacl/include/c++/4.4.3/backward -I/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/lib/gcc/x86_64-nacl/4.4.3/include -I/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/lib/gcc/x86_64-nacl/4.4.3/include-fixed -I/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/x86_64-nacl/include ../originfpl.h -o moc_originfpl.cpp
/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/bin/x86_64-nacl-g++ -m64 -c -pipe -O2 -std=gnu++0x -Wall -W -fPIC -DQ_OS_NACL_PEPPER -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../RD_stage -I. -I/opt/QtNaCl_56/qtbase/include -I/opt/QtNaCl_56/qtbase/include/QtWidgets -I/opt/QtNaCl_56/qtbase/include/QtGui -I/opt/QtNaCl_56/qtbase/include/QtCore -I. -I. -I/opt/nacl_sdk/pepper_47/include -I/opt/Qt5.6/qtbase/mkspecs/unsupported/nacl-x86-newlib-g++-64 -o moc_originfpl.o moc_originfpl.cpp
/opt/QtNaCl_56/qtbase/bin/moc -DQ_OS_NACL_PEPPER -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/opt/Qt5.6/qtbase/mkspecs/unsupported/nacl-x86-newlib-g++-64 -I/home/komche/RD_stage -I/opt/QtNaCl_56/qtbase/include -I/opt/QtNaCl_56/qtbase/include/QtWidgets -I/opt/QtNaCl_56/qtbase/include/QtGui -I/opt/QtNaCl_56/qtbase/include/QtCore -I. -I/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/x86_64-nacl/include/c++/4.4.3 -I/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/x86_64-nacl/include/c++/4.4.3/x86_64-nacl -I/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/x86_64-nacl/include/c++/4.4.3/backward -I/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/lib/gcc/x86_64-nacl/4.4.3/include -I/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/lib/gcc/x86_64-nacl/4.4.3/include-fixed -I/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/x86_64-nacl/include ../anime.h -o moc_anime.cpp
/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/bin/x86_64-nacl-g++ -m64 -c -pipe -O2 -std=gnu++0x -Wall -W -fPIC -DQ_OS_NACL_PEPPER -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../RD_stage -I. -I/opt/QtNaCl_56/qtbase/include -I/opt/QtNaCl_56/qtbase/include/QtWidgets -I/opt/QtNaCl_56/qtbase/include/QtGui -I/opt/QtNaCl_56/qtbase/include/QtCore -I. -I. -I/opt/nacl_sdk/pepper_47/include -I/opt/Qt5.6/qtbase/mkspecs/unsupported/nacl-x86-newlib-g++-64 -o moc_anime.o moc_anime.cpp
/opt/nacl_sdk/pepper_47/toolchain/linux_x86_newlib/bin/x86_64-nacl-g++ -Wl,-O1 -o RD-Artem.nexe main.o service.o originfpl.o anime.o rd-artem.nexe_plugin_import.o qrc_src.o moc_service.o moc_originfpl.o moc_anime.o -L/opt/nacl_sdk/pepper_47/lib/newlib_x86_64/Release -L/opt/QtNaCl_56/qtbase/lib -lQt5Widgets -L/opt/QtNaCl_56/qtbase/plugins/imageformats -lqico -lQt5Gui -lerror_handling -lqtharfbuzzng -lqtfreetype -lQt5Core -lppapi -lppapi_cpp -lqtpcre -lm -lppapi_gles2
/opt/nacl_sdk/pepper_47/lib/newlib_x86_64/Release/libppapi_cpp.a(ppp_entrypoints_x86_64.o): In function PPP_InitializeModule': /mnt/data/b/build/slave/sdk-rel/build/src/out/pepper_47/src/ppapi_cpp/ppp_entrypoints.cc:36: undefined reference to pp::CreateModule()'
collect2: ld returned 1 exit status
Makefile:162: recipe for target 'RD-Artem.nexe' failed
make: *** [RD-Artem.nexe] Error 1

@kom1che
Copy link

kom1che commented May 26, 2017

image

@theshadowx
Copy link
Author

the main function should be modified.
Have a look at :
https://github.com/msorvig/qt-nacl-manualtests/tree/dev/window_widgets

@kom1che
Copy link

kom1che commented May 27, 2017

Hi, thank you for clarification of the main function. I read the your previous description:

@bgrasic here is how the main.cpp should look like
#include
#include
#include "analogclock.h"
AnalogClock *clockA = 0;
// App-provided init and exit functions:
void app_init(int argc, char **argv)
{
clockA = new AnalogClock;
clockA->show();
}
void app_exit()
{
delete clockA;
}
// Register functions with Qt. The type of register function
// selects the QApplicaiton type.
Q_GUI_MAIN(app_init, app_exit);

and inserted some changes in mine project in such way

#include "service.h"
//#include <QApplication>
//#include <QObject>
#include <QtCore>
#include <QtGui>
Service *w = 0;
void app_init(int argc, char **argv)
//int app_init(int argc, char *argv[])
{
    //QApplication a(argc, argv);
    //Service w;
    w = new Service;
    //w.show();
    w->show();
    //return a.exec();
}
void app_exit()
{
    delete w;
}
Q_GUI_MAIN(app_init, app_exit);

Then, finaly project has been compiled. Here is the content of buid folder:

image

After I used run command like this:

sudo docker run --rm -it -p 8000:8000 -v /home/komche/RD_stage:/home/komche/RD_stage theshadowx/qt_nacl:pepper47_qt56 bash -c "cd /home/komche/RD_stage/build && /opt/QtNaCl_56/qtbase/bin/nacldeployqt RD-Artem.nexe --run"

Using Chrome (version 56.0.2924.87 (64-bit)) I linked to http://172.17.0.1:8000/, but unfortunately I saw only white screen with frame and the name of the project((

@kom1che
Copy link

kom1che commented May 27, 2017

image

@theshadowx
Copy link
Author

So do I, and also was reported by some people here. I couldn't debug it as the debug option works just for Mac OS.

I think it's better to contact the person maintaining nacl-wip branch in Qt --> https://github.com/msorvig

@kom1che
Copy link

kom1che commented May 28, 2017

Thank you very much for your support. I appreciate that.
Ok, I will try to contact with him, but Have you already contacted with him?

@theshadowx
Copy link
Author

theshadowx commented May 28, 2017

Yes, but not for this issue.
https://github.com/msorvig/qt5-qtbase-nacl/issues
The nacl-wip branch in Qt hasn't been updated since last year.

@kom1che
Copy link

kom1che commented Jun 4, 2017

Hi Ali!

Did you read this article on official Google web-site:

https://developer.chrome.com/native-client/migration

@theshadowx
Copy link
Author

@kom1che thanks for this info.
hope Qt guys will make Qt able to work with WebAssembly.

@kom1che
Copy link

kom1che commented Jun 10, 2017

@theshadowx
Copy link
Author

Thanks, that's great !!!

@theshadowx
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment