Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion webview/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,3 @@ ARG GIT_HASH=0
ENV GIT_HASH=$GIT_HASH

COPY build_qt5.sh /usr/local/bin/
CMD /usr/local/bin/build_qt5.sh
35 changes: 15 additions & 20 deletions webview/build_qt5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -243,38 +243,33 @@ function build_qt () {
echo "QT Build already exist."
fi

if [ ! -f "$BUILD_TARGET/webview-$QT_VERSION-$DEBIAN_VERSION-$1-$GIT_HASH.tar.gz" ]; then
if [ "${BUILD_WEBVIEW-x}" == "1" ]; then
cp -rf /webview "$SRC_DIR/"
if [ "${BUILD_WEBVIEW-x}" == "1" ]; then
cp -rf /webview "$SRC_DIR/"

pushd "$SRC_DIR/webview"
pushd "$SRC_DIR/webview"

"$SRC_DIR/qt${QT_MAJOR}pi/bin/qmake"
make -j"$MAKE_CORES"
make install
"$SRC_DIR/qt${QT_MAJOR}pi/bin/qmake"
make -j"$MAKE_CORES"
make install

mkdir -p fakeroot/bin fakeroot/share/ScreenlyWebview
mv ScreenlyWebview fakeroot/bin/
cp -rf /webview/res fakeroot/share/ScreenlyWebview/
mkdir -p fakeroot/bin fakeroot/share/ScreenlyWebview
mv ScreenlyWebview fakeroot/bin/
cp -rf /webview/res fakeroot/share/ScreenlyWebview/

pushd fakeroot
tar cfz "$BUILD_TARGET/webview-$QT_VERSION-$DEBIAN_VERSION-$1-$GIT_HASH.tar.gz" .
popd
pushd fakeroot
tar cfz "$BUILD_TARGET/webview-$QT_VERSION-$DEBIAN_VERSION-$1.tar.gz" .
popd

pushd "$BUILD_TARGET"
sha256sum "webview-$QT_VERSION-$DEBIAN_VERSION-$1-$GIT_HASH.tar.gz" > "webview-$QT_VERSION-$DEBIAN_VERSION-$1-$GIT_HASH.tar.gz.sha256"
popd
fi
else
echo "Webview Build already exist."
pushd "$BUILD_TARGET"
sha256sum "webview-$QT_VERSION-$DEBIAN_VERSION-$1.tar.gz" > "webview-$QT_VERSION-$DEBIAN_VERSION-$1.tar.gz.sha256"
popd
fi
}

# Modify paths for build process
/usr/local/bin/sysroot-relativelinks.py /sysroot

fetch_cross_compile_tool
fetch_rpi_firmware

if [ ! "${TARGET-}" ]; then
# Let's work our way through all Pis in order of relevance
Expand Down
16 changes: 16 additions & 0 deletions webview/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,28 @@
#include <QtWebEngine>
#include <QWebEngineView>

#include <iostream>
#include <fstream>

#include "mainwindow.h"

int main(int argc, char *argv[])
{
QApplication app(argc, argv);

qInstallMessageHandler([](QtMsgType type, const QMessageLogContext &context, const QString &msg) {
std::ofstream log;
log.open("/tmp/anthias-webview.log", std::ios::out | std::ios::app);

if (log.fail()) {
std::cerr << "Failed to open log file" << std::endl;
return;
}

log << msg.toStdString() << std::endl;
std::cout << msg.toStdString() << std::endl;
});

QCursor cursor(Qt::BlankCursor);
QApplication::setOverrideCursor(cursor);
QApplication::changeOverrideCursor(cursor);
Expand Down