Rain92 / UltimateMangaReader

A feature-rich online manga reader for Kobo E-Ink devices based on Qt5.
GNU Affero General Public License v3.0
176 stars 24 forks source link
cross-platform kobo kobo-eink-devices manga manga-downloader manga-reader manga-scraper qt5

UltimateMangaReader

A feature-rich online manga streamer and reader for Kobo E-Ink devices, based on Qt5.

Main features

Install on Kobo devices

First you will need to install a launcher application. I recomend KFMon, the latest release along with install instructions can be found here.

For the application itself just download the latest release here and extract the archive into the root directiory of your Kobo device.

Build

Building the application requires Qt 5.15+ with OpenSSL 1.1.1+. \ With Qt creator the build process is straight-foreward. \ Building qor kobo targets the requires a cross compiled Qt and a Kobo platform plugin. \ See https://github.com/Rain92/qt5-kobo-platform-plugin. \ Add CONFIG+=kobo to the qmake arguments and put the plugin source in the same parent folder as the app.

Cross-compile for Kobo

Setting up the cross-compile toolchain

The koxtoolchain is recomendet: https://github.com/koreader/koxtoolchain \ Install the dependencies and run:

./gen-tc.sh kobo

Cross-compile OpenSSH for Qt

Download the latest OpenSSL (1.1.1+). \ Configure, make and install, for example like this:

export CROSS=/home/${USER}/x-tools/arm-kobo-linux-gnueabihf/bin/arm-kobo-linux-gnueabihf
export SYSROOT=/home/${USER}/x-tools/arm-kobo-linux-gnueabihf/arm-kobo-linux-gnueabihf/sysroot
export AR=${CROSS}-ar
export AS=${CROSS}-as
export CC=${CROSS}-gcc
export CXX=${CROSS}-g++
export LD=${CROSS}-ld
export RANLIB=${CROSS}-ranlib
export CFLAGS="-O3 -march=armv7-a -mfpu=neon -mfloat-abi=hard -D__arm__ -D__ARM_NEON__ -fPIC -fno-omit-frame-pointer -funwind-tables -Wl,--no-merge-exidx-entries"
./Configure linux-elf no-comp no-asm shared --prefix=${SYSROOT}/usr --openssldir=${SYSROOT}/usr
make -j5
make install

Prepare Qt

Download the latest Qt (5.15+). \ A descriptor for the kobo platform has to be added. \ In the source folder of Qt go to qtbase\mkspecs and add a new folder named linux-kobo-gnueabihf-g++ with theese two files: \ qmake.conf

#
# Kobo qmake configuration
#

MAKEFILE_GENERATOR      = UNIX
CONFIG                 += incremental gdb_dwarf_index
QMAKE_INCREMENTAL_STYLE = sublib

include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)

QMAKE_CFLAGS_RELEASE   = -O3 -march=armv7-a -mfpu=neon -mfloat-abi=hard -D__arm__ -D__ARM_NEON__ -fPIC -fno-omit-frame-pointer -funwind-tables -Wl,--no-merge-exidx-entries
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO -g

QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO

# modifications to g++.conf
QMAKE_CC                = arm-kobo-linux-gnueabihf-gcc
QMAKE_CXX               = arm-kobo-linux-gnueabihf-g++
QMAKE_LINK              = arm-kobo-linux-gnueabihf-g++
QMAKE_LINK_SHLIB        = arm-kobo-linux-gnueabihf-g++

# modifications to linux.conf
QMAKE_AR                = arm-kobo-linux-gnueabihf-ar cqs
QMAKE_OBJCOPY           = arm-kobo-linux-gnueabihf-objcopy
QMAKE_NM                = arm-kobo-linux-gnueabihf-nm -P
QMAKE_STRIP             = arm-kobo-linux-gnueabihf-strip

load(qt_config)

qplatformdefs.h

#include "../linux-g++/qplatformdefs.h"

~As of Qt 5.15.0 there is an open issue that will lead to random artifacts in the gui when using high-dpi scaling with fractional scaling factors. This can be resolved with the following patch~ (Already fixed in Qt 5.15.1):

diff --git a/src/gui/kernel/qhighdpiscaling_p.h b/src/gui/kernel/qhighdpiscaling_p.h
index 55ad6df5c9da3d11a8900754eebc27528aec90ec..9c3d0cdba28a1dd51c18d3fcc0350a11f8000ebc 100644
--- a/src/gui/kernel/qhighdpiscaling_p.h
+++ b/src/gui/kernel/qhighdpiscaling_p.h
@@ -204,7 +204,7 @@ inline QRegion scale(const QRegion &region, qreal scaleFactor, QPoint origin = Q

     QRegion scaled;
     for (const QRect &rect : region)
-        scaled += scale(rect, scaleFactor, origin);
+        scaled += scale(QRectF(rect), scaleFactor, origin).toRect();
     return scaled;
 }

Cross-compile Qt

Open a new terminal. Make sure arm-kobo-linux-gnueabihf-gcc is in your path. If in doubt add it with:

export PATH=$PATH:/home/${USER}/x-tools/arm-kobo-linux-gnueabihf/bin/

Configure, make and install Qt:

export QTDIR=qt-linux-5.15.2-kobo
export SYSROOT=/home/${USER}/x-tools/arm-kobo-linux-gnueabihf/arm-kobo-linux-gnueabihf/sysroot
./configure --recheck-all -opensource -confirm-license -release -verbose \
 -prefix /mnt/onboard/.adds/${QTDIR} \
 -extprefix /home/${USER}/qt-bin/${QTDIR} \
 -xplatform linux-kobo-gnueabihf-g++ \
 -sysroot ${SYSROOT} \
 -openssl-linked OPENSSL_PREFIX="${SYSROOT}/usr" \
 -qt-libjpeg -qt-zlib -qt-libpng -qt-freetype -qt-harfbuzz -qt-pcre -sql-sqlite -linuxfb \
 -no-sse2 -no-xcb -no-xcb-xlib -no-tslib -no-icu -no-iconv -no-dbus \
 -nomake tests -nomake examples -no-compile-examples -no-opengl \
 -skip qtx11extras -skip qtwayland -skip qtwinextras -skip qtmacextras -skip qtandroidextras \
 -skip qttools -skip qtdoc -skip qtlocation -skip qtremoteobjects -skip qtconnectivity -skip qtgamepad \
 -skip qt3d -skip qtquick3d -skip qtquickcontrols -skip qtsensors -skip qtspeech -skip qtdatavis3d \
 -skip qtpurchasing -skip qtserialbus -skip qtserialport -skip multimedia -skip qtquicktimeline -skip qtlottie \
 -skip activeqt -skip qtscript -skip qtxmlpatterns -skip qtscxml -skip qtvirtualkeyboard \
 -skip qtwebengine -skip qtwebview -skip qtwebglplugin \
 -no-cups -no-pch -no-libproxy \
 -no-sql-db2 -no-sql-ibase -no-sql-mysql -no-sql-oci -no-sql-odbc -no-sql-psql -no-sql-sqlite2 -no-sql-tds \
 -no-feature-printdialog -no-feature-printer -no-feature-printpreviewdialog -no-feature-printpreviewwidget

make -j5
make install